/* Fase Video Manager — Phone Video Styles */

/* Clickable link overlay on phone */
.fase-phone-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    text-decoration: none;
    cursor: pointer;
}

/* Video inside phone mockup */
.fase-phone-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.fase-phone-video.is-loaded {
    opacity: 1;
}

.fase-phone-video.is-error {
    display: none;
}

.fase-phone-fallback-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Platform badge */
.fase-phone-badge {
    position: absolute;
    top: 2rem;
    right: 0.75rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.4rem;
    z-index: 3;
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fase-badge-tiktok {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19.59 6.69a4.83 4.83 0 01-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 01-2.88 2.5 2.89 2.89 0 01-2.88-2.89 2.89 2.89 0 012.88-2.89c.28 0 .54.04.79.1v-3.5a6.37 6.37 0 00-.79-.05A6.34 6.34 0 003.15 15.2a6.34 6.34 0 006.34 6.34 6.34 6.34 0 006.34-6.34V8.73a8.19 8.19 0 004.76 1.53v-3.4a4.85 4.85 0 01-1-.17z'/%3E%3C/svg%3E");
}

.fase-badge-instagram {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z'/%3E%3C/svg%3E");
}

/* Stats overlay */
.fase-phone-stats {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    z-index: 3;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0.25rem 0.5rem;
    border-radius: 0.35rem;
    letter-spacing: 0.02em;
}

/* Skeleton loading state */
.fase-phone-skeleton {
    position: absolute;
    inset: 0;
    background: #1a1f2e;
    z-index: 0;
    overflow: hidden;
}

.fase-phone-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, #252b3b 50%, transparent 70%);
    animation: fvm-shimmer 1.5s ease-in-out infinite;
    will-change: transform;
}

@keyframes fvm-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Scroll-in animation */
.fase-phone {
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fase-phone.is-center {
    transform: translateY(calc(-2.6rem + 2rem));
}

.fase-phone.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.fase-phone.is-center.is-visible {
    transform: translateY(-2.6rem);
}

.fase-phone.is-center.is-visible:hover {
    transform: translateY(-3rem);
}

.fase-phone.is-visible:hover {
    transform: translateY(-8px);
}

/* Hover title overlay */
.fase-phone-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.65);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fase-phone:hover .fase-phone-title {
    opacity: 1;
}

/* Light theme adjustments */
[data-bs-theme="light"] .fase-phone-bezel,
[data-bs-theme="light"] .wp-block-fase-video-manager .fase-phone-bezel {
    border-color: #1d2327;
}

[data-bs-theme="light"] .fase-phone {
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}

[data-bs-theme="light"] .fase-phone-stats {
    background: rgba(0, 0, 0, 0.6);
}

[data-bs-theme="light"] .fase-phone-skeleton {
    background: #e5e7eb;
}

[data-bs-theme="light"] .fase-phone-skeleton::after {
    background: linear-gradient(110deg, transparent 30%, #f3f4f6 50%, transparent 70%);
}

/* ==========================================================================
   RESPONSIVE: Phones & Tablets
   Target devices:
   - Samsung Galaxy S10-S24:    360px
   - iPhone 12 Mini / SE:       375px
   - iPhone 14/15/16:           393px
   - Samsung Galaxy S10+/Ultra: 412px
   - iPhone Pro Max 14-16:      430-440px
   - iPad Mini:                 768px
   - Samsung Galaxy Tab:        800px
   - iPad Air:                  820px
   - iPad Pro 11":              834px
   - iPad Pro 12.9":            1024px
   ========================================================================== */

/* --- Small phones (up to 389px): Samsung Galaxy S10-S24 (360px), iPhone 12 Mini (375px) --- */
@media (max-width: 389px) {
    .fase-phone-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 0.75rem;
        padding: 0 0.5rem 1.5rem;
        scrollbar-width: none;
    }

    .fase-phone-row::-webkit-scrollbar {
        display: none;
    }

    .fase-phone-row > .col-md-4 {
        flex: 0 0 75vw;
        max-width: 75vw;
        scroll-snap-align: center;
    }

    /* Scale phones to fit screen */
    .fase-phone {
        width: 100%;
        height: auto;
        aspect-ratio: 9 / 19;
    }

    /* Remove center phone offset on small mobile */
    .fase-phone.is-center,
    .fase-phone.is-center.is-visible {
        transform: translateY(0) !important;
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
    }

    /* Smaller notch */
    .fase-phone-notch {
        width: 6rem;
        height: 1.2rem;
    }

    /* Smaller badge */
    .fase-phone-badge {
        top: 1.6rem;
        right: 0.5rem;
        width: 1.3rem;
        height: 1.3rem;
    }

    /* Smaller stats */
    .fase-phone-stats {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
        bottom: 0.5rem;
        left: 0.5rem;
    }

    .fase-phone-title {
        font-size: 0.65rem;
        padding: 0.35rem 0.5rem;
    }
}

/* --- Medium phones (390-479px): iPhone 14-16 (393px), Galaxy S10+/Ultra (412px), iPhone Pro Max (430-440px) --- */
@media (min-width: 390px) and (max-width: 479px) {
    .fase-phone-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding: 0 1rem 1.5rem;
        scrollbar-width: none;
    }

    .fase-phone-row::-webkit-scrollbar {
        display: none;
    }

    .fase-phone-row > .col-md-4 {
        flex: 0 0 72vw;
        max-width: 72vw;
        scroll-snap-align: center;
    }

    .fase-phone {
        width: 100%;
        height: auto;
        aspect-ratio: 9 / 19;
    }

    /* Remove center phone offset on mobile */
    .fase-phone.is-center,
    .fase-phone.is-center.is-visible {
        transform: translateY(0) !important;
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
    }

    .fase-phone-notch {
        width: 6.5rem;
        height: 1.3rem;
    }
}

/* --- Large phones / small landscape (480-767px) --- */
@media (min-width: 480px) and (max-width: 767.98px) {
    .fase-phone-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding: 0 1.5rem 1.5rem;
        scrollbar-width: none;
    }

    .fase-phone-row::-webkit-scrollbar {
        display: none;
    }

    .fase-phone-row > .col-md-4 {
        flex: 0 0 260px;
        scroll-snap-align: center;
    }

    .fase-phone {
        width: 100%;
        height: auto;
        aspect-ratio: 9 / 19;
    }

    .fase-phone.is-center,
    .fase-phone.is-center.is-visible {
        transform: translateY(0) !important;
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
    }
}

/* --- Tablets portrait (768-1023px): iPad Mini (768), Galaxy Tab (800), iPad Air (820), iPad Pro 11" (834) --- */
@media (min-width: 768px) and (max-width: 1023px) {
    .fase-phone {
        width: 12.5rem !important;
        height: 25rem !important;
        border-radius: 2rem;
        border-width: 0.35rem;
    }

    .fase-phone-notch {
        width: 5rem;
        height: 0.9rem;
        border-bottom-left-radius: 0.5rem;
        border-bottom-right-radius: 0.5rem;
    }

    .fase-phone.is-center,
    .fase-phone.is-center.is-visible {
        transform: translateY(-1.2rem);
    }

    .fase-phone.is-center.is-visible:hover {
        transform: translateY(-1.5rem);
    }

    .fase-phone-badge {
        top: 1.2rem;
        right: 0.4rem;
        width: 1.1rem;
        height: 1.1rem;
    }

    .fase-phone-stats {
        font-size: 0.55rem;
        padding: 0.15rem 0.3rem;
    }

    .fase-phone-title {
        font-size: 0.55rem;
        padding: 0.25rem 0.4rem;
    }
}

/* --- Tablets landscape / small desktop (1024-1199px): iPad Pro 12.9" (1024) --- */
@media (min-width: 1024px) and (max-width: 1199px) {
    .fase-phone {
        width: 14.5rem !important;
        height: 29rem !important;
        border-radius: 2.6rem;
        border-width: 0.42rem;
    }

    .fase-phone-notch {
        width: 6rem;
        height: 1.1rem;
    }

    .fase-phone.is-center,
    .fase-phone.is-center.is-visible {
        transform: translateY(-1.8rem);
    }

    .fase-phone.is-center.is-visible:hover {
        transform: translateY(-2.2rem);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .fase-phone {
        opacity: 1;
        transform: none !important;
        transition: none !important;
    }
    .fase-phone.is-center {
        transform: translateY(-2.6rem) !important;
    }
    .fase-phone-video {
        opacity: 1;
        transition: none;
    }
    .fase-phone-skeleton {
        animation: none;
    }
    .fase-phone-title {
        transition: none;
    }
}
