/* ==========================================================================
   Premium Device Showcase Enhancements
   Ultra-realistic 3D device mockups with depth and detail
   ========================================================================== */

/* --------------------------------------------------------------------------
   3D PERSPECTIVE CONTAINER
   -------------------------------------------------------------------------- */
.hero-devices-showcase {
    perspective: 1500px;
    perspective-origin: 50% 40%;
    transform-style: preserve-3d;
}

/* --------------------------------------------------------------------------
   ENHANCED TV — Samsung/LG Style
   -------------------------------------------------------------------------- */
.device-tv {
    transform: perspective(1500px) rotateY(25deg) rotateX(-5deg) translateZ(20px);
    transform-style: preserve-3d;
}

.device-tv:hover {
    transform: perspective(1500px) rotateY(18deg) rotateX(-3deg) translateZ(40px) translateY(-10px);
}

.device-tv .device-frame-tv {
    position: relative;
}

/* TV ambient backlight (Ambilight effect) */
.device-tv::before {
    content: '';
    position: absolute;
    inset: -15px;
    background: radial-gradient(ellipse at center, rgba(255, 107, 74, 0.15) 0%, transparent 60%);
    filter: blur(20px);
    z-index: -1;
    opacity: 0.8;
    animation: ambilight 4s ease-in-out infinite;
}

@keyframes ambilight {
    0%, 100% { 
        background: radial-gradient(ellipse at center, rgba(255, 107, 74, 0.15) 0%, transparent 60%);
    }
    33% { 
        background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.12) 0%, transparent 60%);
    }
    66% { 
        background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.12) 0%, transparent 60%);
    }
}

/* Premium TV bezel - ultra thin */
.device-screen-tv {
    background: linear-gradient(165deg, #2a2a35 0%, #18181f 50%, #0c0c10 100%);
    border: 1px solid rgba(80, 80, 90, 0.3);
    box-shadow: 
        0 30px 60px -15px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5),
        /* Screen glow */
        0 0 80px -20px rgba(255, 107, 74, 0.2);
}

/* TV Samsung-style brand bar */
.device-screen-tv .device-game::after {
    content: 'NimbusPlay';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
    white-space: nowrap;
}

/* TV screen reflection/gloss */
.device-screen-tv .device-game::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.03) 0%, 
        transparent 40%,
        transparent 60%,
        rgba(255, 255, 255, 0.01) 100%
    );
    pointer-events: none;
    z-index: 10;
}

/* --------------------------------------------------------------------------
   ENHANCED LAPTOP — MacBook Pro Style
   -------------------------------------------------------------------------- */
.device-laptop {
    transform: perspective(1500px) rotateY(-20deg) rotateX(3deg) translateZ(10px);
    transform-style: preserve-3d;
}

.device-laptop:hover {
    transform: perspective(1500px) rotateY(-12deg) rotateX(2deg) translateZ(30px) translateY(-10px);
}

/* Laptop lid Apple logo glow */
.laptop-screen::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #4ade80 30%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(74, 222, 128, 0.5);
    animation: webcamBlink 5s ease-in-out infinite;
}

@keyframes webcamBlink {
    0%, 90%, 100% { opacity: 0; }
    92%, 98% { opacity: 1; }
}

/* Premium metal texture */
.laptop-screen {
    background: linear-gradient(165deg, 
        #3a3a45 0%, 
        #2a2a35 20%, 
        #1f1f28 50%, 
        #18181f 80%, 
        #0c0c10 100%
    );
    border: 1px solid rgba(80, 80, 90, 0.2);
    box-shadow: 
        0 -20px 50px -10px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Laptop screen IPS glow effect */
.device-screen-laptop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.02) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
    border-radius: 4px 4px 0 0;
}

/* Keyboard backlight enhancement */
.laptop-base {
    background: linear-gradient(180deg, 
        #2a2a35 0%, 
        #222229 30%,
        #1a1a22 100%
    );
    box-shadow: 
        0 20px 40px -5px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        /* Keyboard glow */
        0 2px 10px rgba(255, 107, 74, 0.1);
}

/* Speaker grilles */
.laptop-hinge::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 2px;
    background: repeating-linear-gradient(90deg, 
        #1a1a22 0px, #1a1a22 2px, 
        #2a2a35 2px, #2a2a35 4px
    );
    border-radius: 1px;
}

.laptop-hinge::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 2px;
    background: repeating-linear-gradient(90deg, 
        #1a1a22 0px, #1a1a22 2px, 
        #2a2a35 2px, #2a2a35 4px
    );
    border-radius: 1px;
}

/* --------------------------------------------------------------------------
   ENHANCED PHONE — iPhone 15 Pro Style
   -------------------------------------------------------------------------- */
.device-phone {
    transform: perspective(1500px) rotateX(5deg) translateZ(50px);
    transform-style: preserve-3d;
}

.device-phone:hover {
    transform: perspective(1500px) rotateX(2deg) translateZ(80px) translateY(-15px) scale(1.02);
}

/* Titanium frame gradient */
.device-frame-phone {
    background: linear-gradient(165deg, 
        #4a4a55 0%,
        #3a3a45 15%,
        #2a2a35 30%,
        #1a1a22 60%,
        #0c0c10 100%
    );
    border: 1px solid rgba(100, 100, 110, 0.3);
    box-shadow: 
        0 70px 120px -30px rgba(0, 0, 0, 0.7),
        0 35px 70px -20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        /* Screen glow */
        0 0 100px -30px rgba(255, 107, 74, 0.25);
}

/* Action button (iPhone 15 Pro) */
.device-frame-phone .phone-notch::before {
    content: '';
    position: absolute;
    left: -200px;
    top: 85px;
    width: 3px;
    height: 25px;
    background: linear-gradient(180deg, #3a3a45 0%, #2a2a35 100%);
    border-radius: 0 2px 2px 0;
}

/* Dynamic Island animation */
.phone-notch {
    background: #000;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.device-phone:hover .phone-notch {
    width: 110px;
    height: 32px;
    border-radius: 22px;
}

/* Front camera in Dynamic Island */
.phone-notch::before {
    background: radial-gradient(circle at 35% 35%, 
        #3a3a45 0%, 
        #1a1a22 40%, 
        #0a0a0a 70%
    );
    box-shadow: 
        0 0 0 1.5px #1a1a1a,
        inset 0 0 2px rgba(60, 60, 100, 0.5),
        inset 1px 1px 2px rgba(255, 255, 255, 0.05);
}

/* Face ID IR dot projector */
.phone-notch::after {
    background: radial-gradient(circle at 30% 30%,
        #252530 0%,
        #1a1a1a 100%
    );
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.5);
}

/* OLED screen depth */
.device-screen-phone {
    background: #000;
    box-shadow: 
        inset 0 0 40px rgba(0, 0, 0, 0.8),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

/* Screen edge highlight (curved glass effect) */
.device-screen-phone::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 100%
    );
    border-radius: 28px 28px 0 0;
    pointer-events: none;
}

/* Home indicator with better styling */
.phone-home-indicator {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.2) 100%
    );
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

/* --------------------------------------------------------------------------
   GAME CONTENT ENHANCEMENTS
   -------------------------------------------------------------------------- */
/* Game title with better typography */
.game-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Stats badges */
.game-stat {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.game-stat-live {
    color: #22c55e;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Device screens with real dashboard SVGs */
.device-game {
    position: relative;
    height: 100%;
    overflow: hidden;
}

/* TV shows dashboard overview */
.device-tv .device-game {
    background: url('assets/screen-tv.svg') center/cover no-repeat;
}

/* Laptop shows games library */
.device-laptop .device-game {
    background: url('assets/screen-laptop.svg') center/cover no-repeat;
}

/* Phone shows gameplay */
.device-phone .device-game {
    background: url('assets/screen-phone.svg') center/cover no-repeat;
}

/* Screen glare overlay */
.device-game::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 10;
}

/* Game UI positioning */
.game-ui {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 5;
}

.game-stats {
    display: flex;
    gap: 6px;
}

/* Touch controller overlay on phone */
.game-controller {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    opacity: 0.4;
}

.controller-dpad {
    width: 50px;
    height: 50px;
    background: 
        linear-gradient(0deg, transparent 40%, rgba(255,255,255,0.15) 40%, rgba(255,255,255,0.15) 60%, transparent 60%),
        linear-gradient(90deg, transparent 40%, rgba(255,255,255,0.15) 40%, rgba(255,255,255,0.15) 60%, transparent 60%);
    border-radius: 8px;
}

.controller-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    width: 50px;
}

.controller-buttons span {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.controller-buttons span:nth-child(1) { background: rgba(255, 107, 74, 0.2); }
.controller-buttons span:nth-child(2) { background: rgba(59, 130, 246, 0.2); }
.controller-buttons span:nth-child(3) { background: rgba(251, 191, 36, 0.2); }
.controller-buttons span:nth-child(4) { background: rgba(34, 197, 94, 0.2); }

/* --------------------------------------------------------------------------
   DEVICE HOVER MICRO-INTERACTIONS
   -------------------------------------------------------------------------- */
.device-tv:hover .device-screen-tv,
.device-laptop:hover .laptop-screen,
.device-phone:hover .device-frame-phone {
    box-shadow: 
        0 80px 140px -40px rgba(0, 0, 0, 0.7),
        0 0 100px -20px rgba(255, 107, 74, 0.3);
}

/* Screen brightness on hover */
.device-tv:hover .device-game,
.device-laptop:hover .device-game,
.device-phone:hover .device-game {
    filter: brightness(1.05);
}

/* --------------------------------------------------------------------------
   FULLSCREEN MODE
   -------------------------------------------------------------------------- */

/* Fullscreen expand button */
.device-fullscreen-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
}

.device-fullscreen-btn svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

.device:hover .device-fullscreen-btn {
    opacity: 1;
    transform: scale(1);
}

.device-fullscreen-btn:hover {
    background: rgba(255, 107, 74, 0.8);
    border-color: rgba(255, 107, 74, 0.6);
}

.device-fullscreen-btn:hover svg {
    color: white;
}

/* Phone-specific positioning */
.device-phone .device-fullscreen-btn {
    bottom: 50px;
    right: 12px;
}

/* Laptop-specific positioning */
.device-laptop .device-fullscreen-btn {
    bottom: 12px;
    right: 12px;
}

/* TV-specific positioning */
.device-tv .device-fullscreen-btn {
    bottom: 10px;
    right: 10px;
}

/* Fullscreen overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
}

.fullscreen-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Fullscreen content container */
.fullscreen-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fullscreen-overlay.active .fullscreen-content {
    transform: scale(1);
}

/* Fullscreen game display */
.fullscreen-game {
    width: 90vw;
    max-width: 1600px;
    height: 80vh;
    max-height: 900px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 50px 100px -20px rgba(0, 0, 0, 0.8),
        0 0 150px -50px rgba(255, 107, 74, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: fullscreenEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fullscreenEnter {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Close button */
.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
}

.fullscreen-close svg {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

.fullscreen-close:hover {
    background: rgba(255, 107, 74, 0.8);
    border-color: transparent;
    transform: scale(1.1);
}

.fullscreen-close:hover svg {
    color: white;
}

/* Device label in fullscreen */
.fullscreen-label {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    z-index: 10001;
}

.fullscreen-label svg {
    width: 20px;
    height: 20px;
    color: #ff6b4a;
}

/* Hint text */
.fullscreen-hint {
    position: absolute;
    bottom: 30px;
    right: 30px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    z-index: 10001;
}

.fullscreen-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    margin-left: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: inherit;
}

/* Body class when fullscreen is active */
body.fullscreen-active {
    overflow: hidden;
}

/* Responsive fullscreen */
@media (max-width: 768px) {
    .fullscreen-game {
        width: 95vw;
        height: 60vh;
        border-radius: 12px;
    }
    
    .fullscreen-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .fullscreen-close svg {
        width: 20px;
        height: 20px;
    }
    
    .fullscreen-label {
        bottom: 20px;
        padding: 10px 18px;
        font-size: 13px;
    }
    
    .fullscreen-hint {
        display: none;
    }

    .device-fullscreen-btn {
        width: 28px;
        height: 28px;
    }
    
    .device-fullscreen-btn svg {
        width: 14px;
        height: 14px;
    }
}
