/* ===== Premium PBR Phone Component ===== */
/* A realistic, physically-based rendered phone with metallic materials */

/* Phone Container */
.pbr-phone-container {
    position: relative;
    perspective: 1500px;
    transform-style: preserve-3d;
}

.pbr-phone {
    position: relative;
    width: 300px;
    height: 620px;
    transform-style: preserve-3d;
    /* Explicit default transform to prevent sub-pixel jitter */
    transform: rotateY(0deg) rotateX(0deg) translateZ(0px);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.pbr-phone:hover {
    transform: rotateY(-8deg) rotateX(5deg) translateZ(20px);
}

/* Phone Body - Titanium Frame with PBR Materials */
.pbr-phone-body {
    position: absolute;
    inset: 0;
    border-radius: 52px;
    transform-style: preserve-3d;
    
    /* Multi-layer metallic gradient for titanium look */
    background: 
        /* Top highlight - specular reflection */
        linear-gradient(
            165deg,
            rgba(255, 255, 255, 0.35) 0%,
            rgba(255, 255, 255, 0.08) 15%,
            transparent 40%
        ),
        /* Side metallic gradient */
        linear-gradient(
            90deg,
            #1a1a2e 0%,
            #2d2d44 8%,
            #454563 15%,
            #3a3a55 35%,
            #2a2a40 50%,
            #353550 65%,
            #454563 85%,
            #2d2d44 92%,
            #1a1a2e 100%
        ),
        /* Base titanium color */
        linear-gradient(
            180deg,
            #2c2c42 0%,
            #252538 50%,
            #1e1e30 100%
        );
    
    /* Realistic shadows and depth */
    box-shadow:
        /* Inner edge highlight */
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        inset 0 -1px 1px rgba(0, 0, 0, 0.3),
        inset 1px 0 1px rgba(255, 255, 255, 0.08),
        inset -1px 0 1px rgba(0, 0, 0, 0.2),
        /* Outer shadow layers */
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 12px 24px rgba(0, 0, 0, 0.4),
        0 24px 48px rgba(0, 0, 0, 0.3),
        /* Ambient occlusion */
        0 2px 4px rgba(0, 0, 0, 0.5),
        /* Colored ambient light */
        0 0 80px rgba(109, 40, 217, 0.12),
        0 0 120px rgba(2, 132, 199, 0.08);
}

/* Frame edges - 3D depth effect */
.pbr-phone-body::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 54px;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.03) 30%,
        rgba(0, 0, 0, 0.2) 70%,
        rgba(0, 0, 0, 0.3) 100%
    );
    z-index: -1;
}

/* Additional frame chamfer effect */
.pbr-phone-body::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

/* Phone Screen Container */
.pbr-phone-screen-container {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border-radius: 46px;
    overflow: hidden;
    background: #000;
    /* Prevent sub-pixel jitter during parent transform */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    
    /* Screen bezel shadow */
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.8),
        inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Glass Screen Effect */
.pbr-phone-screen {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0a0a14 0%, #12121f 50%, #0d0d18 100%);
    border-radius: 46px;
    overflow: hidden;
}

/* Screen Glass Reflection Overlay */
.pbr-phone-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.02) 30%,
        transparent 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 100;
}

/* Subtle screen edge highlight */
.pbr-phone-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 46px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
    z-index: 101;
}

/* Dynamic Island / Notch */
.pbr-phone-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 34px;
    background: #000;
    border-radius: 20px;
    z-index: 50;
    
    /* Notch depth */
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.5),
        0 1px 1px rgba(255, 255, 255, 0.05);
}

/* Camera and sensors in notch */
.pbr-phone-notch::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: radial-gradient(
        circle,
        #1a1a2e 30%,
        #0d0d15 50%,
        #252538 70%
    );
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pbr-phone-notch::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #2d1f4e 0%, #1a1a2e 100%);
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Screen Content Area */
.pbr-phone-content {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    overflow: hidden;
}

/* Side Buttons - Volume and Power */
.pbr-phone-button {
    position: absolute;
    background: linear-gradient(
        90deg,
        #252538 0%,
        #3a3a55 50%,
        #252538 100%
    );
    border-radius: 2px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        0 0 4px rgba(0, 0, 0, 0.5);
}

.pbr-phone-button--power {
    right: -4px;
    top: 140px;
    width: 4px;
    height: 80px;
}

.pbr-phone-button--volume-up {
    left: -4px;
    top: 100px;
    width: 4px;
    height: 45px;
}

.pbr-phone-button--volume-down {
    left: -4px;
    top: 155px;
    width: 4px;
    height: 45px;
}

.pbr-phone-button--silent {
    left: -4px;
    top: 70px;
    width: 4px;
    height: 20px;
}

/* Ambient Glow Effect */
.pbr-phone-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    
    background: radial-gradient(
        ellipse at center,
        rgba(109, 40, 217, 0.18) 0%,
        rgba(2, 132, 199, 0.10) 30%,
        transparent 60%
    );
    
    filter: blur(40px);
    animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Reflection Layer - Simulates environment reflection */
.pbr-phone-reflection {
    position: absolute;
    inset: 0;
    border-radius: 52px;
    pointer-events: none;
    z-index: 10;
    
    background: linear-gradient(
        155deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.04) 25%,
        transparent 45%,
        transparent 55%,
        rgba(255, 255, 255, 0.02) 75%,
        rgba(255, 255, 255, 0.06) 100%
    );
    
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.pbr-phone:hover .pbr-phone-reflection {
    opacity: 1;
}

/* ===== Screen Content Styles ===== */

/* App Interface Header */
.pbr-app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pbr-app-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.pbr-app-status-bar .time {
    font-weight: 600;
}

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

/* Location Badge */
.pbr-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.pbr-location-badge .icon {
    font-size: 14px;
}

/* Featured Card */
.pbr-featured-card {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.03) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.pbr-featured-card .card-image {
    height: 120px;
    background: linear-gradient(
        135deg,
        #667eea 0%,
        #764ba2 50%,
        #8B5CF6 100%
    );
    position: relative;
}

.pbr-featured-card .card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.5) 100%);
}

.pbr-featured-card .card-body {
    padding: 16px;
}

.pbr-featured-card .card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #fff;
}

.pbr-featured-card .card-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
}

/* Audio Player Bar */
.pbr-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(
        90deg,
        rgba(139, 92, 246, 0.2) 0%,
        rgba(6, 182, 212, 0.2) 100%
    );
    padding: 12px 16px;
    border-radius: 12px;
}

.pbr-audio-play-btn {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary, linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
}

.pbr-audio-waves {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    height: 24px;
}

.pbr-audio-waves span {
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #8B5CF6 0%, #06B6D4 100%);
    border-radius: 2px;
    animation: pbr-wave 1s ease-in-out infinite;
    transform-origin: bottom;
}

.pbr-audio-waves span:nth-child(1) { animation-delay: 0s; height: 40%; }
.pbr-audio-waves span:nth-child(2) { animation-delay: 0.1s; height: 70%; }
.pbr-audio-waves span:nth-child(3) { animation-delay: 0.2s; height: 50%; }
.pbr-audio-waves span:nth-child(4) { animation-delay: 0.3s; height: 90%; }
.pbr-audio-waves span:nth-child(5) { animation-delay: 0.4s; height: 60%; }
.pbr-audio-waves span:nth-child(6) { animation-delay: 0.5s; height: 80%; }
.pbr-audio-waves span:nth-child(7) { animation-delay: 0.6s; height: 45%; }
.pbr-audio-waves span:nth-child(8) { animation-delay: 0.7s; height: 65%; }
.pbr-audio-waves span:nth-child(9) { animation-delay: 0.8s; height: 55%; }
.pbr-audio-waves span:nth-child(10) { animation-delay: 0.9s; height: 75%; }

@keyframes pbr-wave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

/* Home Screen Variant */
.pbr-home-content {
    text-align: center;
    padding-top: 30px;
}

.pbr-greeting {
    margin-bottom: 30px;
}

.pbr-greeting .emoji {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    animation: wave-hand 2s ease-in-out infinite;
}

@keyframes wave-hand {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
}

.pbr-greeting h3 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.pbr-greeting p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* Discovery Card */
.pbr-discovery-card {
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.15) 0%,
        rgba(6, 182, 212, 0.15) 100%
    );
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 20px;
    padding: 20px;
    text-align: left;
}

.pbr-discovery-card .header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.pbr-discovery-card .header .icon {
    font-size: 16px;
}

.pbr-listen-btn {
    width: 100%;
    background: var(--gradient-primary, linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%));
    border: none;
    border-radius: 12px;
    padding: 14px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pbr-listen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

/* Floating Cards - Enhanced */
.pbr-floating-cards {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
}

.pbr-phone:hover ~ .pbr-floating-cards {
    transform: translateZ(-60px);
}

.pbr-float-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(109, 40, 217, 0.12);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(15, 21, 35, 0.85);
    backdrop-filter: blur(20px);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.10),
        0 0 40px rgba(109, 40, 217, 0.06);
    animation: pbr-float 4s ease-in-out infinite;
}

.pbr-float-card .icon {
    font-size: 18px;
}

.pbr-float-card--1 {
    top: 15%;
    left: -100px;
    animation-delay: 0s;
}

.pbr-float-card--2 {
    top: 45%;
    right: -90px;
    animation-delay: 1s;
}

.pbr-float-card--3 {
    bottom: 20%;
    left: -80px;
    animation-delay: 2s;
}

@keyframes pbr-float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-8px) translateX(5px);
    }
    50% {
        transform: translateY(-15px) translateX(-3px);
    }
    75% {
        transform: translateY(-8px) translateX(8px);
    }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .pbr-phone {
        width: 260px;
        height: 540px;
    }
    
    .pbr-phone-body {
        border-radius: 44px;
    }
    
    .pbr-phone-screen-container {
        border-radius: 40px;
    }
    
    .pbr-phone-screen {
        border-radius: 40px;
    }
    
    .pbr-phone-notch {
        width: 100px;
        height: 28px;
    }
    
    .pbr-phone-content {
        top: 48px;
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .pbr-phone-container {
        transform: scale(0.85);
    }
    
    .pbr-float-card--1 {
        left: -60px;
    }
    
    .pbr-float-card--2 {
        right: -50px;
    }
    
    .pbr-float-card--3 {
        left: -50px;
    }
}

@media (max-width: 480px) {
    .pbr-phone-container {
        transform: scale(0.75);
    }
}

/* ===== Enhanced Screen Realism ===== */

/* Screen glow effect */
.pbr-phone-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        /* Subtle scan lines */
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        /* Screen reflection */
        linear-gradient(
            125deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.03) 30%,
            transparent 50%,
            transparent 100%
        );
    pointer-events: none;
    z-index: 100;
    animation: screen-flicker 8s ease-in-out infinite;
}

@keyframes screen-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.98; }
    52% { opacity: 1; }
}

/* Enhanced Status Bar */
.pbr-app-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.pbr-app-status-bar .time {
    font-weight: 600;
    font-size: 14px;
}

.pbr-app-status-bar .status-icons {
    display: flex;
    gap: 8px;
    align-items: center;
    color: rgba(255, 255, 255, 0.85);
}

/* Enhanced Location Badge */
.pbr-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(6, 182, 212, 0.15) 100%);
    border: 1px solid rgba(139, 92, 246, 0.35);
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.pbr-location-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    animation: location-shimmer 3s ease-in-out infinite;
}

@keyframes location-shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

/* ===== Mini Map ===== */
.pbr-mini-map {
    position: relative;
    width: 100%;
    height: 130px;
    border-radius: 16px;
    overflow: hidden;
    margin: 12px 0;
    background: linear-gradient(145deg, #1a1f2e 0%, #0f1319 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

.map-surface {
    position: absolute;
    inset: 0;
    background: 
        /* Water on the right (Mediterranean) */
        linear-gradient(90deg, transparent 70%, rgba(6, 182, 212, 0.15) 100%);
}

.map-grid {
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 20px,
            rgba(255, 255, 255, 0.03) 20px,
            rgba(255, 255, 255, 0.03) 21px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 20px,
            rgba(255, 255, 255, 0.03) 20px,
            rgba(255, 255, 255, 0.03) 21px
        );
}

.map-streets {
    position: absolute;
    inset: 0;
    background:
        /* Main diagonal street (La Diagonal) */
        linear-gradient(135deg, 
            transparent 0%, transparent 35%,
            rgba(255, 255, 255, 0.08) 35%, rgba(255, 255, 255, 0.08) 36%,
            transparent 36%, transparent 100%
        ),
        /* Horizontal street (Gran Via) */
        linear-gradient(0deg,
            transparent 0%, transparent 60%,
            rgba(255, 255, 255, 0.06) 60%, rgba(255, 255, 255, 0.06) 62%,
            transparent 62%, transparent 100%
        ),
        /* Vertical street (Passeig de Gràcia) */
        linear-gradient(90deg,
            transparent 0%, transparent 40%,
            rgba(255, 255, 255, 0.06) 40%, rgba(255, 255, 255, 0.06) 42%,
            transparent 42%, transparent 100%
        );
}

/* Map Markers */
.map-marker {
    position: absolute;
    cursor: pointer;
    z-index: 10;
}

.marker-pin {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: marker-bounce 2s ease-in-out infinite;
}

@keyframes marker-bounce {
    0%, 100% { transform: rotate(-45deg) translateY(0); }
    50% { transform: rotate(-45deg) translateY(-3px); }
}

.marker-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px) scale(0);
    background: rgba(18, 18, 26, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.4);
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.marker-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(139, 92, 246, 0.4);
}

.popup-icon {
    font-size: 11px;
}

/* Show popup on hover or cycle through */
.map-marker:hover .marker-popup,
.map-marker.active .marker-popup {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px) scale(1);
}

.map-marker:hover .marker-pin {
    transform: rotate(-45deg) scale(1.2);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.7);
}

/* Specific marker positions (Barcelona layout approximation) */
.marker-sagrada {
    top: 25%;
    left: 60%;
    animation-delay: 0s;
}

.marker-guell {
    top: 15%;
    left: 35%;
    animation-delay: 0.3s;
}

.marker-rambla {
    top: 65%;
    left: 30%;
    animation-delay: 0.6s;
}

.marker-casa {
    top: 30%;
    left: 25%;
    animation-delay: 0.9s;
}

.marker-beach {
    top: 75%;
    left: 75%;
    animation-delay: 1.2s;
}

/* Current Location Indicator */
.map-current-location {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
}

/* Google Maps-style heading cone */
.current-heading {
    position: absolute;
    width: 40px;
    height: 40px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    background: conic-gradient(
        from -30deg,
        transparent 0deg,
        rgba(59, 130, 246, 0.3) 30deg,
        rgba(59, 130, 246, 0.15) 60deg,
        transparent 60deg
    );
    border-radius: 50%;
    z-index: -1;
}

.current-dot {
    width: 12px;
    height: 12px;
    background: #3B82F6;
    border-radius: 50%;
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.6);
    position: relative;
    z-index: 2;
}

.current-pulse {
    position: absolute;
    inset: -8px;
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 50%;
    animation: current-pulse-anim 2s ease-out infinite;
}

@keyframes current-pulse-anim {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* Map Overlay (gradient fade) */
.map-overlay {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(0deg, rgba(10, 10, 15, 0.6) 0%, transparent 30%),
        linear-gradient(180deg, rgba(10, 10, 15, 0.3) 0%, transparent 20%);
    pointer-events: none;
}

/* ===== Conversation Audio Visualizer ===== */
.pbr-conversation-player {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(6, 182, 212, 0.08) 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    padding: 14px;
    backdrop-filter: blur(10px);
}

.conversation-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    animation: avatar-pulse 3s ease-in-out infinite;
}

@keyframes avatar-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 4px 16px rgba(139, 92, 246, 0.6); }
}

.conversation-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.conversation-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.conversation-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* Conversation Waveform */
.conversation-waveform {
    margin-bottom: 12px;
}

.waveform-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 32px;
    margin-bottom: 8px;
}

.waveform-bars span {
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #8B5CF6 0%, #06B6D4 100%);
    border-radius: 2px;
    transform-origin: center;
    animation: conversation-wave var(--wave-duration, 1.8s) ease-in-out infinite;
}

/* Slow, coordinated wave pattern - simulating natural speech */
.waveform-bars span:nth-child(1) { --wave-duration: 2.0s; animation-delay: 0s; }
.waveform-bars span:nth-child(2) { --wave-duration: 2.2s; animation-delay: 0.08s; }
.waveform-bars span:nth-child(3) { --wave-duration: 1.8s; animation-delay: 0.16s; }
.waveform-bars span:nth-child(4) { --wave-duration: 2.4s; animation-delay: 0.24s; }
.waveform-bars span:nth-child(5) { --wave-duration: 2.0s; animation-delay: 0.32s; }
.waveform-bars span:nth-child(6) { --wave-duration: 1.9s; animation-delay: 0.40s; }
.waveform-bars span:nth-child(7) { --wave-duration: 2.3s; animation-delay: 0.48s; }
.waveform-bars span:nth-child(8) { --wave-duration: 1.7s; animation-delay: 0.56s; }
.waveform-bars span:nth-child(9) { --wave-duration: 2.1s; animation-delay: 0.64s; }
.waveform-bars span:nth-child(10) { --wave-duration: 2.0s; animation-delay: 0.72s; }
.waveform-bars span:nth-child(11) { --wave-duration: 2.2s; animation-delay: 0.80s; }
.waveform-bars span:nth-child(12) { --wave-duration: 1.8s; animation-delay: 0.88s; }
.waveform-bars span:nth-child(13) { --wave-duration: 2.4s; animation-delay: 0.96s; }
.waveform-bars span:nth-child(14) { --wave-duration: 1.9s; animation-delay: 1.04s; }
.waveform-bars span:nth-child(15) { --wave-duration: 2.1s; animation-delay: 1.12s; }
.waveform-bars span:nth-child(16) { --wave-duration: 2.3s; animation-delay: 1.20s; }
.waveform-bars span:nth-child(17) { --wave-duration: 1.7s; animation-delay: 1.28s; }
.waveform-bars span:nth-child(18) { --wave-duration: 2.0s; animation-delay: 1.36s; }
.waveform-bars span:nth-child(19) { --wave-duration: 2.2s; animation-delay: 1.44s; }
.waveform-bars span:nth-child(20) { --wave-duration: 2.1s; animation-delay: 1.52s; }
.waveform-bars span:nth-child(21) { --wave-duration: 1.9s; animation-delay: 1.60s; }
.waveform-bars span:nth-child(22) { --wave-duration: 2.0s; animation-delay: 1.68s; }
.waveform-bars span:nth-child(23) { --wave-duration: 2.3s; animation-delay: 1.76s; }
.waveform-bars span:nth-child(24) { --wave-duration: 1.8s; animation-delay: 1.84s; }
.waveform-bars span:nth-child(25) { --wave-duration: 2.1s; animation-delay: 1.92s; }

@keyframes conversation-wave {
    0%, 100% { 
        transform: scaleY(0.2);
        opacity: 0.6;
    }
    50% { 
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Waveform Progress Bar */
.waveform-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.waveform-progress .progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8B5CF6, #06B6D4);
    border-radius: 2px;
    animation: progress-slide 12s linear infinite;
}

@keyframes progress-slide {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Conversation Controls */
.conversation-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.control-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    color: #fff;
    transform: scale(1.05);
}

.control-btn.control-play {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.control-btn.control-play:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

/* ===== Auto-cycling popup animation ===== */
.marker-sagrada { animation: popup-cycle 15s ease-in-out infinite; animation-delay: 0s; }
.marker-guell { animation: popup-cycle 15s ease-in-out infinite; animation-delay: 3s; }
.marker-rambla { animation: popup-cycle 15s ease-in-out infinite; animation-delay: 6s; }
.marker-casa { animation: popup-cycle 15s ease-in-out infinite; animation-delay: 9s; }
.marker-beach { animation: popup-cycle 15s ease-in-out infinite; animation-delay: 12s; }

@keyframes popup-cycle {
    0%, 15% { z-index: 20; }
    0%, 5% { --popup-visible: 1; }
    5%, 100% { --popup-visible: 0; }
}

.marker-sagrada .marker-popup,
.marker-guell .marker-popup,
.marker-rambla .marker-popup,
.marker-casa .marker-popup,
.marker-beach .marker-popup {
    animation: popup-show 15s ease-in-out infinite;
}

.marker-sagrada .marker-popup { animation-delay: 0s; }
.marker-guell .marker-popup { animation-delay: 3s; }
.marker-rambla .marker-popup { animation-delay: 6s; }
.marker-casa .marker-popup { animation-delay: 9s; }
.marker-beach .marker-popup { animation-delay: 12s; }

@keyframes popup-show {
    0%, 3% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-8px) scale(0.8);
    }
    5%, 18% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(-8px) scale(1);
    }
    20%, 100% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-8px) scale(0.8);
    }
}
