:root {
    --bg-dark: #000000;
    --text-main: #ffffff;
    --text-muted: #86868b;
    --accent: #e5e7eb;
}

body {
    font-family: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, rgba(26, 26, 46, 0.8) 0%, rgba(0, 0, 0, 0.95) 70%);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}

::-webkit-scrollbar { width: 0px; background: transparent; }

.hidden { display: none !important; }

/* --- BACKGROUND CONSOLE EFFECT --- */
.console-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

#console-canvas {
    filter: blur(2px);
    opacity: 0.35;
}

/* --- LIQUID GLASS STYLE --- */
.glass-card {
    background: rgba(30, 30, 35, 0.4);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 28px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.02);
    transition: background 1s ease, border-color 1s ease, box-shadow 1s ease, backdrop-filter 1s ease;
}

.glass-card.loading-state {
    background: rgba(30, 30, 35, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border-color: transparent;
    box-shadow: none;
}

.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding-bottom: 120px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Floating Liquid Glass Nav Bar */
.nav-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 280px;
    height: 64px;
    padding: 0 10px;
    z-index: 50;
    background: rgba(30, 30, 35, 0.65);
    backdrop-filter: blur(35px) saturate(180%);
    -webkit-backdrop-filter: blur(35px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.15);
}

.nav-item {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: var(--text-muted);
    opacity: 0.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 100%;
    border-radius: 50px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.03);
    opacity: 0.8;
}

.nav-item.active {
    color: #ffffff;
    opacity: 1;
    transform: scale(1.05);
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
}

.nav-item.active i {
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.4));
    color: #fff;
}

/* Plan Cards */
.plan-card {
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: rgba(255,255,255,0.03);
}
.plan-card:active { transform: scale(0.96); }
.plan-card.selected {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

/* Device Segmented Control */
.segmented-control {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 4px;
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}
.segment-btn {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    transition: all 0.3s ease;
}
.segment-btn.active {
    background: #ffffff;
    color: #000000;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Price Animation Styles */
.price-text {
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.price-text.updating {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
    filter: blur(4px);
}

/* Modal Styles */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-content {
    width: 90%; max-width: 360px;
    background: rgba(30, 30, 35, 0.7);
    backdrop-filter: blur(35px) saturate(200%);
    -webkit-backdrop-filter: blur(35px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 32px;
    padding: 30px;
    transform: scale(0.85) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 40px 60px rgba(0,0,0,0.6);
}
.modal-overlay.open .modal-content { transform: scale(1) translateY(0); }

.step-slide { display: none; animation: slideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.step-slide.active { display: block; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Pulse Button Modern */
.pulse-btn { position: relative; overflow: hidden; }
.pulse-btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}
.pulse-btn:hover::before { left: 100%; transition: 0.5s; }

/* --- ROBO EYE (SENTRY MODE) --- */
.robo-eye-socket {
    width: 68px;
    height: 68px;
    background: radial-gradient(circle at 30% 30%, #27272a, #000000); /* Dark metallic lens housing */
    border-radius: 50%;
    position: relative;
    box-shadow:
            0 0 0 1px #3f3f46, /* Rim */
            0 10px 30px rgba(0,0,0,0.8), /* Deep shadow */
            inset 0 0 20px rgba(0,0,0,1); /* Inner depth */
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 10;
}

/* Glass reflection */
.robo-eye-socket::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 25%;
    height: 15%;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    border-radius: 50%;
    filter: blur(1px);
    z-index: 30;
    pointer-events: none;
}

/* Container for the display content (Pupil) to animate */
.crt-screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    will-change: transform, opacity, filter;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s ease;
}

/* Hide main pupil when loading ring is active */
.robo-eye-socket.loading .crt-screen {
    opacity: 0;
}

/* Initial Turn On Animation Class */
.crt-screen.turn-on {
    animation: tv-on 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.pupil {
    width: 24px;
    height: 24px;
    background: #ef4444; /* Red core */
    border-radius: 50%;
    position: relative;
    z-index: 5;
    box-shadow:
            0 0 10px #ef4444,
            0 0 30px #b91c1c,
            0 0 60px #7f1d1d,
            inset 0 0 10px rgba(0,0,0,0.5);
    transition: opacity 0.2s ease, width 0.3s ease, height 0.3s ease, border-radius 0.3s ease;
    --translate-x: 0px;
    --translate-y: 0px;
    transform: translate(var(--translate-x), var(--translate-y));
    animation: sentinel-pulse 3s infinite ease-in-out;

    /* Center content (for text) */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- LOADING SPIN ANIMATION (ORBITAL TRAIL) --- */
.loading-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: none; /* Hidden by default */
    animation: loading-spin 1.2s linear infinite;
    z-index: 15;
}

.robo-eye-socket.loading .loading-ring {
    display: block;
}

.eye-trail {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px; /* Slightly smaller than main pupil */
    height: 20px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 15px #ef4444;
    transform-origin: center center;
}

/* Positioning trail elements along the orbit */
.eye-trail:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg) translateY(-16px); opacity: 1; }
.eye-trail:nth-child(2) { transform: translate(-50%, -50%) rotate(-20deg) translateY(-16px) scale(0.9); opacity: 0.6; }
.eye-trail:nth-child(3) { transform: translate(-50%, -50%) rotate(-40deg) translateY(-16px) scale(0.85); opacity: 0.3; }
.eye-trail:nth-child(4) { transform: translate(-50%, -50%) rotate(-60deg) translateY(-16px) scale(0.7); opacity: 0.1; }

@keyframes loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Fixed pulse animation (no translate) */
@keyframes sentinel-pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(0.95); opacity: 0.7; }
}

/* --- GLITCH / INTERFERENCE ANIMATION --- */
.robo-eye-socket.glitch .crt-screen {
    animation: noise 0.2s steps(3) infinite;
    opacity: 1 !important;
    transform: scale(1) !important;
}

.robo-eye-socket.glitch .pupil {
    box-shadow: 0 0 20px #ef4444, 0 0 50px #ff0000, 0 0 10px #ffffff;
    filter: contrast(2);
}

@keyframes noise {
    0% { transform: translate(0, 0) scale(1); filter: hue-rotate(0deg); opacity: 1; }
    10% { transform: translate(-2px, 2px) scale(1.02); filter: hue-rotate(90deg); opacity: 0.9; }
    20% { transform: translate(2px, -2px) scale(0.98); filter: hue-rotate(-90deg); opacity: 1; }
    30% { transform: translate(-2px, -2px) scale(1.05); filter: hue-rotate(0deg); opacity: 0.8; }
    40% { transform: translate(2px, 2px) scale(0.95); filter: hue-rotate(45deg); opacity: 1; }
    50% { transform: translate(-1px, 2px) scale(1); filter: hue-rotate(0deg); opacity: 1; }
    60% { transform: translate(1px, -2px) scale(1.02); filter: hue-rotate(-45deg); opacity: 0.9; }
    70% { transform: translate(-2px, 1px) scale(0.98); filter: hue-rotate(0deg); opacity: 1; }
    80% { transform: translate(2px, -1px) scale(1.05); filter: hue-rotate(90deg); opacity: 0.8; }
    90% { transform: translate(0, 2px) scale(0.95); filter: hue-rotate(0deg); opacity: 1; }
    100% { transform: translate(0, 0) scale(1); filter: hue-rotate(0deg); opacity: 1; }
}

/* --- TV TURN OFF ANIMATION --- */
.robo-eye-socket.turn-off .crt-screen {
    animation: tv-off 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.robo-eye-socket.turn-off .pupil {
    animation: none;
    box-shadow: 0 0 20px #ef4444, 0 0 50px #ffffff;
}

/* --- SYSTEM ONLINE (GREEN EYE) --- */
.robo-eye-socket.system-online .pupil {
    background: #22c55e; /* Green */
    box-shadow:
            0 0 15px #22c55e,
            0 0 40px #16a34a,
            0 0 80px #15803d,
            inset 0 0 10px rgba(0,0,0,0.5);
    animation: sentinel-pulse 4s infinite ease-in-out;
}

.robo-eye-socket.system-online .crt-screen {
    animation: tv-on 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes tv-off {
    0% { transform: scale(1, 1); filter: brightness(1); opacity: 1; }
    40% { transform: scale(1.3, 0.05); filter: brightness(5); opacity: 1; }
    70% { transform: scale(0.05, 0.05); filter: brightness(5); opacity: 1; }
    100% { transform: scale(0, 0); filter: brightness(0); opacity: 0; }
}

@keyframes tv-on {
    0% { transform: scale(0, 0); filter: brightness(5); opacity: 0; }
    30% { transform: scale(0.05, 0.05); filter: brightness(5); opacity: 1; }
    60% { transform: scale(1.3, 0.05); filter: brightness(3); opacity: 1; }
    100% { transform: scale(1, 1); filter: brightness(1); opacity: 1; }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(30, 30, 35, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 200;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.show {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto !important;
}
