/**
 * Maldively & More - Custom Styles
 */

/* Hide reCAPTCHA v3 badge */
.grecaptcha-badge { visibility: hidden !important; }

/* Line clamp utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #0ea5e9;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0284c7;
}

/* Aspect ratios */
.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* Transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Focus visible */
*:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* Image loading placeholder */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Print styles */
@media print {
    nav, footer, .no-print {
        display: none !important;
    }
}

/* Resort card hover effect */
.resort-card {
    transition: all 0.3s ease;
}

.resort-card:hover {
    transform: translateY(-4px);
}

/* Calendar widget styles */
.calendar-day {
    transition: all 0.2s ease;
}

.calendar-day:hover:not(:disabled) {
    transform: scale(1.1);
}

/* Active filters badges animation */
.active-filters span {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loader spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0ea5e9;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .mobile-menu {
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }
}

/* Image gallery */
.image-gallery {
    display: grid;
    gap: 8px;
}

.image-gallery-main {
    grid-column: span 2;
    grid-row: span 2;
}

/* Star rating */
.star-rating {
    display: inline-flex;
    align-items: center;
}

.star-rating svg {
    transition: transform 0.2s ease;
}

.star-rating:hover svg {
    transform: scale(1.1);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 12px;
}

.skeleton-image {
    width: 100%;
    height: 200px;
}

/* ============================================================
   Popover - Stile Eludia
   ============================================================ */

.mly-popover {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.mly-popover-header {
    background: #0f4c5c;
    color: #fff;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    letter-spacing: 0.01em;
}

.mly-popover-body {
    background: #f0fdfa;
    color: #1e3a3a;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.55;
    border-radius: 0 0 8px 8px;
    border: 1px solid #ccfbf1;
    border-top: none;
}

.mly-popover-body strong {
    color: #0f4c5c;
}

.mly-popover-arrow {
    position: absolute;
    top: 12px;
    left: -6px;
    width: 12px;
    height: 12px;
    background: #0f4c5c;
    transform: rotate(45deg);
}

.mly-popover-arrow-bottom {
    top: auto;
    bottom: -6px;
    left: 12px;
    background: #f0fdfa;
    border-right: 1px solid #ccfbf1;
    border-bottom: 1px solid #ccfbf1;
}

/* ============================================================
   Image Manager - Admin
   ============================================================ */

.mly-image-card {
    transition: all 0.2s ease;
}

.mly-image-card:hover {
    z-index: 5;
}

.mly-drag-handle {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mly-image-card:hover .mly-drag-handle {
    opacity: 1;
}

/* SortableJS states */
.mly-sortable-ghost {
    opacity: 0.3;
}

.mly-sortable-chosen {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.4);
    border-radius: 8px;
}

.mly-sortable-drag {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: rotate(2deg);
}

/* Upload spinner small */
.spinner-sm {
    border: 2px solid #e0e7ff;
    border-top: 2px solid #0ea5e9;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.spinner-white {
    border-color: rgba(255,255,255,0.3);
    border-top-color: #fff;
}

/* Cropper.js overrides per modal */
.cropper-view-box,
.cropper-face {
    border-radius: 0;
}

.cropper-view-box {
    outline: 2px solid #0ea5e9;
    outline-offset: -2px;
}

.cropper-point {
    background-color: #0ea5e9;
    width: 8px;
    height: 8px;
}

.cropper-line {
    background-color: #0ea5e9;
}
