@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=Oxanium:wght@300;400;500;600;700;800&display=swap');

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Animated Deep Space Purple Background */
body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Inter", "Segoe UI", sans-serif;
    overflow: hidden;
    background: radial-gradient(circle at center, #0e0822 0%, #030107 100%);
    position: relative;
}

/* Cybernetic Grid Overlay */
body::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(181, 87, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(181, 87, 255, 0.03) 1px, transparent 1px);
    background-size: 38px 38px;
}

/* Moving Scanline Overlay for Background */
.system-background {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: radial-gradient(circle at center, #100828 0%, #04020a 100%);
    overflow: hidden;
}

.system-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(181, 87, 255, 0.04) 50%,
        transparent 50%
    );
    background-size: 100% 200%;
    animation: scanLine 8s linear infinite;
    pointer-events: none;
}

@keyframes scanLine {
    from { background-position: 0 -100%; }
    to { background-position: 0 100%; }
}

/* Glass Card - Holographic Solo Leveling Style */
.card, .system-box {
    position: relative;
    width: 360px;
    padding: 24px 28px !important;
    border-radius: 3px !important;
    border: 1px solid rgba(181, 87, 255, 0.3) !important;
    background: 
        /* Top-Left Corner Decal */
        linear-gradient(to right, #d857ff 2px, transparent 2px) 0 0 / 12px 12px no-repeat,
        linear-gradient(to bottom, #d857ff 2px, transparent 2px) 0 0 / 12px 12px no-repeat,
        /* Top-Right Corner Decal */
        linear-gradient(to left, #d857ff 2px, transparent 2px) 100% 0 / 12px 12px no-repeat,
        linear-gradient(to bottom, #d857ff 2px, transparent 2px) 100% 0 / 12px 12px no-repeat,
        /* Bottom-Left Corner Decal */
        linear-gradient(to right, #d857ff 2px, transparent 2px) 0 100% / 12px 12px no-repeat,
        linear-gradient(to top, #d857ff 2px, transparent 2px) 0 100% / 12px 12px no-repeat,
        /* Bottom-Right Corner Decal */
        linear-gradient(to left, #d857ff 2px, transparent 2px) 100% 100% / 12px 12px no-repeat,
        linear-gradient(to top, #d857ff 2px, transparent 2px) 100% 100% / 12px 12px no-repeat,
        /* Subtle Inner Grid Overlay */
        linear-gradient(rgba(181, 87, 255, 0.05) 1px, transparent 1px) 0 0 / 22px 22px,
        linear-gradient(90deg, rgba(181, 87, 255, 0.05) 1px, transparent 1px) 0 0 / 22px 22px,
        /* Card Body Gradient Base */
        linear-gradient(135deg, rgba(16, 9, 36, 0.82) 0%, rgba(6, 3, 14, 0.94) 100%) !important;
    backdrop-filter: blur(20px) saturate(170%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(170%) !important;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.65), 
        inset 0 0 25px rgba(181, 87, 255, 0.08),
        0 0 20px rgba(181, 87, 255, 0.15) !important;
    animation: glowPulse 4s infinite alternate ease-in-out;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Cybernetic Glowing Top Rail */
.card::before, .system-box::before {
    content: "";
    position: absolute;
    top: -8px;
    left: -18px;
    right: -18px;
    height: 8px;
    background: linear-gradient(90deg, rgba(181, 87, 255, 0) 0%, rgba(181, 87, 255, 0.9) 15%, rgba(255, 255, 255, 0.95) 50%, rgba(181, 87, 255, 0.9) 85%, rgba(181, 87, 255, 0) 100%) 0 0 / 100% 4px no-repeat;
    clip-path: polygon(
        0% 0%, 100% 0%, 
        100% 50%, calc(100% - 12px) 100%, 
        12px 100%, 0% 50%
    );
    filter: drop-shadow(0 0 10px rgba(181, 87, 255, 0.85));
    pointer-events: none;
    z-index: 10;
    animation: railPulse 2s infinite alternate ease-in-out;
}

/* Cybernetic Glowing Bottom Rail */
.card::after, .system-box::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: -18px;
    right: -18px;
    height: 8px;
    background: linear-gradient(90deg, rgba(181, 87, 255, 0) 0%, rgba(181, 87, 255, 0.9) 15%, rgba(255, 255, 255, 0.95) 50%, rgba(181, 87, 255, 0.9) 85%, rgba(181, 87, 255, 0) 100%) 0 4px / 100% 4px no-repeat;
    clip-path: polygon(
        12px 0%, calc(100% - 12px) 0%, 
        100% 50%, 100% 100%, 
        0% 100%, 0% 50%
    );
    filter: drop-shadow(0 0 10px rgba(181, 87, 255, 0.85));
    pointer-events: none;
    z-index: 10;
    animation: railPulse 2s infinite alternate ease-in-out;
}

/* Animations for Cyber Glows */
@keyframes glowPulse {
    from {
        border-color: rgba(181, 87, 255, 0.25) !important;
        box-shadow: 
            0 15px 45px rgba(0, 0, 0, 0.65), 
            inset 0 0 25px rgba(181, 87, 255, 0.06),
            0 0 15px rgba(181, 87, 255, 0.1) !important;
    }
    to {
        border-color: rgba(181, 87, 255, 0.45) !important;
        box-shadow: 
            0 20px 52px rgba(0, 0, 0, 0.75), 
            inset 0 0 25px rgba(181, 87, 255, 0.12),
            0 0 25px rgba(181, 87, 255, 0.22) !important;
    }
}

@keyframes railPulse {
    from {
        filter: drop-shadow(0 0 6px rgba(181, 87, 255, 0.7));
        opacity: 0.85;
    }
    to {
        filter: drop-shadow(0 0 14px rgba(216, 87, 255, 0.95));
        opacity: 1;
    }
}

/* Title */
.system-title {
    font-family: "Orbitron", sans-serif;
    text-align: center;
    color: #ffffff;
    text-transform: uppercase;
    font-weight: 900;
    margin-bottom: 18px !important;
    letter-spacing: 4px;
    font-size: 19px;
    text-shadow: 
        0 0 10px rgba(181, 87, 255, 0.8),
        0 0 20px rgba(181, 87, 255, 0.3);
}

/* Cybernetic Boxed Input Containers */
.input-box-container {
    width: 100%;
    margin-bottom: 20px !important;
}

.input-box-container input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(16, 9, 36, 0.65) !important;
    border: 1px solid rgba(181, 87, 255, 0.35) !important;
    border-radius: 4px !important;
    outline: none;
    color: #ffffff;
    font-family: "Orbitron", sans-serif;
    font-size: 13px;
    letter-spacing: 1px;
    transition: all 0.25s ease;
    box-shadow: inset 0 0 10px rgba(181, 87, 255, 0.05);
}

.input-box-container input::placeholder {
    color: rgba(223, 128, 255, 0.45);
    font-family: "Orbitron", sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.input-box-container input:focus {
    border-color: #df80ff !important;
    box-shadow: 
        0 0 15px rgba(181, 87, 255, 0.35), 
        inset 0 0 10px rgba(181, 87, 255, 0.15) !important;
    background: rgba(181, 87, 255, 0.05) !important;
}

/* Action Buttons (Mimicking YES/NO choices in notification pop-up) */
button {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(181, 87, 255, 0.5) !important;
    border-radius: 4px !important;
    background: rgba(22, 13, 52, 0.5) !important;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(181, 87, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: "Orbitron", "Rajdhani", sans-serif;
}

button:hover {
    background: #b557ff !important;
    color: #ffffff !important;
    border-color: #df80ff !important;
    box-shadow: 0 0 22px rgba(181, 87, 255, 0.6) !important;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* Login section */
.login-link {
    margin-top: 25px;
    text-align: center;
    color: white;
    font-size: 14px;
}

.login-link span {
    display: block;
    margin-bottom: 5px;
    opacity: 0.7;
}

.login-link a {
    color: #df80ff;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.login-link a:hover {
    text-shadow: 0 0 8px #df80ff;
}

/* ================= HOME SYSTEM SCREEN ================= */

.system-home {
    background: radial-gradient(circle at center, #0f0a24 0%, #000000 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* Dark overlay animation */
.system-overlay {
    text-align: center;
    animation: fadeIn 2s ease-in-out;
}

/* Glass Box - Custom Holographic styling inherits from base .card style */
.system-box {
    padding: 50px;
    width: 440px; /* Wider for index view compatibility */
    max-width: 90vw;
}

/* Main system text */
.system-text {
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-shadow: 0 0 12px rgba(181, 87, 255, 0.8);
}

/* Sub text */
.system-subtext {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 30px;
    font-size: 14px;
}

/* Accept Button (Specific style wrapper inheriting base button style) */
.system-button {
    width: auto !important;
    display: inline-block !important;
    padding: 12px 38px !important;
}

/* Fade animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Glitch effect for warning text */
.glitch {
    position: relative;
    animation: glitch 1.5s infinite;
}

@keyframes glitch {
    0% { text-shadow: 2px 2px #d857ff; }
    25% { text-shadow: -2px -2px #ff3b70; }
    50% { text-shadow: 2px -2px #b557ff; }
    75% { text-shadow: -2px 2px #ff3b70; }
    100% { text-shadow: 2px 2px #d857ff; }
}

/* System Question */
.system-question {
    color: #ff3b70;
    font-size: 18px;
    margin-bottom: 20px;
    letter-spacing: 2px;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(255, 59, 112, 0.4);
    animation: pulse 1.5s infinite alternate;
}

/* Countdown styling in matching colors */
.countdown {
    font-size: 52px;
    color: #df80ff;
    margin-top: 20px;
    text-shadow: 0 0 15px rgba(181, 87, 255, 0.8);
    font-family: "Orbitron", sans-serif;
    font-weight: 900;
    animation: pulse 1s infinite alternate;
}

/* Flash effect */
.flash {
    animation: screenFlash 0.5s ease;
}

@keyframes screenFlash {
    0% { background-color: white; }
    100% { background-color: transparent; }
}

/* Typewriter text style */
.system-subtext {
    color: #ffffff;
    font-size: 14px;
    min-height: 40px;
    margin-bottom: 15px;
}

/* Auto-click animation */
.auto-click {
    animation: clickEffect 1s forwards;
}

@keyframes clickEffect {
    0% {
        transform: scale(1);
        background: rgba(22, 13, 52, 0.5);
    }
    50% {
        transform: scale(0.9);
        background: #b557ff;
        color: white;
        border-color: #df80ff;
        box-shadow: 0 0 30px rgba(181, 87, 255, 0.7);
    }
    100% {
        transform: scale(1.05);
        background: #b557ff;
        color: white;
        border-color: #df80ff;
    }
}

/* Logo Decals styling */
.auth-logo,
.intro-logo {
    display: block;
    width: 72px !important;
    height: 72px !important;
    margin: 0 auto 12px !important;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(181, 87, 255, 0.75));
}

.intro-logo {
    width: 124px;
    height: 124px;
}

.auth-message {
    min-height: 20px;
    margin: 14px 0 0;
    color: #e2c1ff;
    text-align: center;
    font-size: 12px;
}

.auth-message[data-type="error"] {
    color: #ff6e8d;
}

@media (max-width: 400px) {
    .card, .system-box {
        width: calc(100% - 24px) !important;
        margin-left: 12px !important;
        margin-right: 12px !important;
    }
}

/* Onboarding slide styling */
.onboarding-step {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.onboarding-step.is-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.rpg-option-card, .rpg-checkbox-card {
    display: block;
    cursor: pointer;
    user-select: none;
    margin-bottom: 2px;
}

.option-box, .checkbox-box {
    padding: 14px 18px;
    border: 1px solid rgba(181, 87, 255, 0.25);
    border-radius: 4px;
    background: rgba(16, 9, 36, 0.7);
    color: white;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: left;
    box-shadow: inset 0 0 10px rgba(181, 87, 255, 0.05);
}

.option-box strong {
    display: block;
    font-size: 14px;
    color: #ffffff;
    font-family: "Orbitron", sans-serif;
    letter-spacing: 0.75px;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
}
.option-box small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 5px;
    font-family: "Inter", sans-serif;
}

.option-box.compact {
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    font-family: "Orbitron", sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 14px;
}

.checkbox-box {
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    font-family: "Orbitron", sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 8px;
}

/* Hover & Active animations for cards */
.option-box:hover, .checkbox-box:hover {
    border-color: rgba(223, 128, 255, 0.85);
    background: rgba(181, 87, 255, 0.08);
    box-shadow: 0 0 18px rgba(181, 87, 255, 0.25);
    transform: translateY(-2px);
}

/* Selected state styling */
.rpg-option-card input:checked + .option-box,
.rpg-checkbox-card input:checked + .checkbox-box {
    border-color: #df80ff;
    background: rgba(181, 87, 255, 0.18);
    box-shadow: 
        0 0 20px rgba(181, 87, 255, 0.4), 
        inset 0 0 10px rgba(181, 87, 255, 0.15);
    transform: scale(1.02);
}

/* Unit selectors (lbs/kg, cm/ft) */
.weight-unit-selector label, .height-unit-selector label {
    padding: 8px 20px;
    background: rgba(16, 9, 36, 0.8);
    border: 1px solid rgba(181, 87, 255, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-family: "Orbitron", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.weight-unit-selector label:hover, .height-unit-selector label:hover {
    border-color: #df80ff;
    background: rgba(181, 87, 255, 0.08);
    color: #ffffff;
}

.weight-unit-selector input:checked + span, .height-unit-selector input:checked + span {
    color: #df80ff;
    text-shadow: 0 0 8px rgba(223, 128, 255, 0.6);
}

.weight-unit-selector input:checked, .height-unit-selector input:checked {
    accent-color: #df80ff;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: none !important;
}

.flex-1 {
    flex: 1;
}

.google-signin-btn {
    transition: all 0.3s ease;
    font-family: "Orbitron", sans-serif;
    font-size: 12px;
}
.google-signin-btn:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1) !important;
}

/* Custom Holographic RPG Cursor (Matching styles.css) */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: none !important; /* Hide default cursor */
    }
    
    /* Ensure interactive elements don't show default cursor */
    a, button, select, input, textarea, [role="button"], .tab, .toggle, .set-btn, .ghost-action, .tick-box, .rpg-option-card, .rpg-checkbox-card, label {
        cursor: none !important;
    }
    
    .custom-cursor-dot {
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 16px solid #ffffff;
        filter: drop-shadow(0 0 6px #df80ff) drop-shadow(0 0 12px #b557ff);
        position: fixed;
        top: 0;
        left: 0;
        pointer-events: none;
        z-index: 99999;
        transform: translate(-30%, -10%) rotate(-35deg); /* Point top-left crystal tip */
        transition: border-bottom-color 0.15s ease, transform 0.15s ease;
    }
    
    .custom-cursor-ring {
        width: 36px;
        height: 36px;
        border: 1.5px dashed rgba(181, 87, 255, 0.7);
        border-radius: 50%;
        box-shadow: 0 0 10px rgba(181, 87, 255, 0.3), inset 0 0 5px rgba(181, 87, 255, 0.15);
        position: fixed;
        top: 0;
        left: 0;
        pointer-events: none;
        z-index: 99998;
        transform: translate(-50%, -50%);
        animation: cursorRingRotate 20s linear infinite;
        transition: width 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), height 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.2s ease, background-color 0.2s ease;
    }

    body.cursor-hovering .custom-cursor-dot {
        border-bottom-color: #df80ff !important;
        transform: translate(-30%, -10%) rotate(-35deg) scale(0.9);
    }
    body.cursor-hovering .custom-cursor-ring {
        width: 46px;
        height: 46px;
        border: 1.5px solid #df80ff !important;
        background: rgba(181, 87, 255, 0.08) !important;
        box-shadow: 0 0 18px rgba(181, 87, 255, 0.6), inset 0 0 10px rgba(181, 87, 255, 0.3) !important;
        animation: cursorRingRotate 5s linear infinite; /* Spin faster on hover lock-on! */
    }
    
    /* Shockwave Ripple Click Effect */
    .cursor-ripple {
        position: fixed;
        border: 2px solid #ffffff;
        border-radius: 50%;
        pointer-events: none;
        z-index: 99997;
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
        animation: cursorRippleAnim 0.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    }
}

@keyframes cursorRingRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes cursorRippleAnim {
    0% {
        width: 10px;
        height: 10px;
        border-color: #ffffff;
        box-shadow: 0 0 10px #df80ff, inset 0 0 5px #df80ff;
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        border-color: #df80ff;
        box-shadow: 0 0 15px #b557ff, inset 0 0 8px #b557ff;
        opacity: 0.8;
    }
    100% {
        width: 80px;
        height: 80px;
        border-color: rgba(181, 87, 255, 0);
        box-shadow: 0 0 20px rgba(181, 87, 255, 0), inset 0 0 10px rgba(181, 87, 255, 0);
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* ================= COMPACT LOGIN & STYLE TWEAKS ================= */

/* Hide native up/down number spinners globally */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* Center all content in the Awakening Screen */
#awakeningBox {
    text-align: center !important;
}
#awakeningBox .system-text {
    text-align: center !important;
}
#awakeningBox .system-subtext {
    text-align: center !important;
}
#awakeningBox .system-question {
    text-align: center !important;
}
#awakeningBox .countdown {
    text-align: center !important;
    margin: 20px auto !important;
}
#awakeningBox .system-button {
    margin: 15px auto 0 !important;
    display: inline-block !important;
}

/* Step 9 Login Slide Spacing Optimization */
.onboarding-step[data-step="9"] .intro-logo {
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto 8px !important;
}

.onboarding-step[data-step="9"] .system-title {
    font-size: 20px !important;
    margin-bottom: 4px !important;
}

.onboarding-step[data-step="9"] .system-subtext {
    margin-bottom: 12px !important;
    font-size: 10px !important;
}

.onboarding-step[data-step="9"] .google-signin-btn {
    padding: 10px !important;
    margin-bottom: 8px !important;
}

.onboarding-step[data-step="9"] .input-box-container {
    margin-bottom: 12px !important;
}

.onboarding-step[data-step="9"] .input-box-container input {
    padding: 11px 14px !important;
    font-size: 12px !important;
}

.onboarding-step[data-step="9"] .login-link {
    margin-top: 16px !important;
}

/* Override popover user-agent styles for top-layer custom cursor compatibility */
[popover].custom-cursor-dot, [popover].custom-cursor-ring {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  left: auto;
  top: auto;
  right: auto !important;
  bottom: auto !important;
  overflow: visible !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

[popover].custom-cursor-dot {
  border: none !important;
  border-left: 6px solid transparent !important;
  border-right: 6px solid transparent !important;
  border-bottom: 16px solid #ffffff !important;
}

[popover].custom-cursor-ring {
  border: 1.5px dashed rgba(181, 87, 255, 0.7) !important;
}

/* Onboarding Font Enhancements - Immersive RPG Styling */
.option-box strong, 
.checkbox-box, 
.system-title, 
.system-text, 
.system-question, 
.countdown, 
#obName, 
input, 
button, 
.google-signin-btn, 
.login-link a {
  font-family: "Oxanium", "Orbitron", sans-serif !important;
}

