/* Virtual Smartphone UI - Shared Component */

:root {
    --phone-accent-gold: #e0cca7;
    --phone-glass-bg: rgba(255, 255, 255, 0.03);
    --phone-glass-border: rgba(255, 255, 255, 0.08);
}

/* Smartphone UI */
.virtual-phone {
    width: 320px;
    height: 660px;
    background: #000;
    border: 14px solid #1f1f1f;
    border-radius: 56px;
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(212, 175, 55, 0.15),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    outline: 2px solid #2a2a2a;
    outline-offset: -2px;
    margin: 0 auto;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active .virtual-phone,
.mobile-showroom-section.active .virtual-phone {
    opacity: 1;
    transform: translateY(0);
}

.virtual-phone::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(115deg,
            transparent 0%,
            rgba(255, 255, 255, 0.05) 30%,
            rgba(255, 255, 255, 0.1) 32%,
            transparent 35%);
    pointer-events: none;
    z-index: 101;
    animation: reflection-sweep 10s infinite;
}

@keyframes reflection-sweep {
    0% {
        transform: translateX(-100%);
    }

    20% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.virtual-phone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 43px;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.05);
    pointer-events: none;
    z-index: 100;
}

.app-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-top: 35px;
    /* Reduced from 50px */
    color: white;
    position: relative;
    background: radial-gradient(circle at top, #111 0%, #000 100%);
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-screen::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* System Elements */
.dynamic-island {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 25px;
    background: #000;
    border-radius: 20px;
    z-index: 1000;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-bar {
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 900;
    box-sizing: border-box;
    color: #fff;
}

.status-bar .icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Notification Popup */
.phone-notification {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(245, 245, 240, 0.95);
    /* Light Porcelain for visibility */
    backdrop-filter: blur(12px);
    padding: 10px 18px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: max-content;
    max-width: 90%;
}

.phone-notification.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.phone-notification i {
    color: var(--gold-primary);
    /* Keep gold icon */
    font-size: 1rem;
}

.phone-notification span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #222;
    /* Dark text for contrast */
    white-space: nowrap;
}

.home-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    z-index: 1000;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    /* Reduced from 25px */
}

.app-header .title {
    font-weight: 700;
    color: var(--phone-accent-gold);
    font-size: 1.1rem;
}

.app-header .status {
    font-size: 0.65rem;
    opacity: 0.5;
    text-transform: uppercase;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    /* Reduced from 15px */
    margin-bottom: 15px;
    /* Reduced from 20px */
}

.app-tile {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    /* Reduced from 24px */
    padding: 16px 14px;
    /* Reduced from 20px 15px */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
}

.app-tile:active {
    transform: scale(0.95);
}

.app-tile.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25) 0%, rgba(212, 175, 55, 0.1) 100%);
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(212, 175, 55, 0.1);
}

.app-tile i {
    font-size: 1.3rem;
    /* Reduced from 1.4rem */
    margin-bottom: 10px;
    /* Reduced from 12px */
    color: var(--phone-accent-gold);
}

.app-tile .name {
    font-size: 0.8rem;
    /* Reduced from 0.85rem */
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.app-tile .state {
    font-size: 0.65rem;
    /* Reduced from 0.7rem */
    opacity: 0.5;
    font-weight: 500;
}

.app-slider-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    /* Reduced from 15px */
    border-radius: 20px;
    margin-bottom: 15px;
}

.app-slider-box label {
    display: block;
    font-size: 0.7rem;
    margin-bottom: 8px;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.app-slider {
    width: 100%;
    accent-color: var(--phone-accent-gold);
    cursor: pointer;
}

.app-action-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(224, 204, 167, 0.5);
    background: rgba(224, 204, 167, 0.1);
    color: var(--phone-accent-gold);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
}

.app-action-btn:hover {
    background: var(--phone-accent-gold);
    color: #000;
}

.app-action-btn.gold {
    background: var(--phone-accent-gold);
    color: #000;
    border: none;
}

.app-back {
    text-align: center;
    margin-top: 15px;
    font-size: 0.75rem;
    opacity: 0.4;
    cursor: pointer;
    transition: 0.3s;
}

.app-back:hover {
    opacity: 1;
    color: var(--phone-accent-gold);
}

.flow-container-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.flow-container-small .card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 20px;
    border-radius: 20px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2px;
    backdrop-filter: blur(10px);
}

.flow-container-small .card i {
    margin-right: 15px;
    color: var(--phone-accent-gold);
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.connector-small {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.line-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateY(-101%);
}

.blue-fill {
    background: #0984e3;
    box-shadow: 0 0 10px #0984e3;
}

.red-fill {
    background: #d63031;
    box-shadow: 0 0 10px #d63031;
}

.app-nav {
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-item {
    font-size: 1.2rem;
    opacity: 0.3;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item.active {
    opacity: 1;
    color: var(--phone-accent-gold);
}

/* ---------------------------------- */
/* Desktop Feature Badges (Floating)  */
/* ---------------------------------- */
.feature-badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(25, 25, 25, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 16px;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 5;
    /* transition and animation removed to prevent GSAP conflict */
    max-width: 250px;
    opacity: 0;
    /* Hidden initially, revealed by GSAP */
}

.feature-badge:hover {
    background: rgba(40, 40, 40, 0.8);
    border-color: var(--phone-accent-gold);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.15);
}

.badge-icon {
    width: 40px;
    height: 40px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--phone-accent-gold);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.badge-content {
    display: flex;
    flex-direction: column;
}

.badge-content strong {
    font-size: 0.9rem;
    color: white;
    margin-bottom: 2px;
}

.badge-content span {
    font-size: 0.75rem;
    color: #aaa;
    line-height: 1.3;
}

/* Positioning - Relative to Container Center (Phone is ~360px wide) */
/* We want badges to be ~180px from center line */

.badge-left-top {
    top: 15%;
    right: 50%;
    margin-right: 200px;
    /* Distance from center */
    left: auto;
    transform: translateX(0);
}

.badge-right-top {
    top: 20%;
    left: 50%;
    margin-left: 200px;
    right: auto;
    transform: translateX(0);
}

.badge-left-bottom {
    bottom: 20%;
    right: 50%;
    margin-right: 200px;
    left: auto;
    transform: translateX(0);
}

.badge-right-bottom {
    bottom: 15%;
    left: 50%;
    margin-left: 200px;
    right: auto;
    transform: translateX(0);
}

/* Connectors (Line pointing to phone) */
.feature-badge::after {
    content: '';
    position: absolute;
    width: 60px;
    /* Longer line */
    height: 1px;
    background: linear-gradient(90deg, var(--phone-accent-gold), transparent);
    opacity: 0.6;
    top: 50%;
    pointer-events: none;
}

/* Lines point INWARD */
.badge-left-top::after {
    right: -60px;
    left: auto;
}

.badge-right-top::after {
    left: -60px;
    right: auto;
    transform: rotate(180deg);
}

.badge-left-bottom::after {
    right: -60px;
    left: auto;
}

.badge-right-bottom::after {
    left: -60px;
    right: auto;
    transform: rotate(180deg);
}


@keyframes floatBadge {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Mobile Badge Carousel Wrapper */
.mobile-badge-wrapper {
    display: contents;
    /* Desktop: Behave as if wrapper doesn't exist */
}

@media (max-width: 1024px) {
    .virtual-phone-container {
        display: flex !important;
        /* Changed from grid to flex column */
        flex-direction: column;
        align-items: center;
        width: 100%;
        overflow: hidden;
        /* Prevent horizontal container overflow */
    }

    .virtual-phone {
        margin-bottom: 30px !important;
        transform: scale(0.9);
        /* Slightly smaller phone to fit badges better */
    }

    .mobile-badge-wrapper {
        display: flex;
        /* Mobile: It's a flex container */
        width: 100%;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding: 10px 20px 30px;
        /* Padding for scroll/shadow space */
        -webkit-overflow-scrolling: touch;

        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .mobile-badge-wrapper::-webkit-scrollbar {
        display: none;
    }

    .feature-badge {
        display: flex !important;
        position: relative !important;
        /* Reset positioning coordinates from desktop */
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin: 0 !important;

        /* Card Styling for Carousel */
        min-width: 85%;
        /* Shows next card peeking */
        scroll-snap-align: center;
        flex-direction: row;
        /* Horizontal layout for badge content */
        text-align: left;
        align-items: center;
        gap: 15px;
        padding: 20px;
        background: rgba(25, 25, 25, 0.6);
        /* Slightly more transparent */
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px;
    }

    .feature-badge::after {
        display: none !important;
    }

    .badge-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        background: rgba(212, 175, 55, 0.1);
    }

    .badge-left-top,
    .badge-right-top,
    .badge-left-bottom,
    .badge-right-bottom {
        margin: 0 !important;
    }
}
