/* ===== ROOT VARIABLES ===== */
:root {
    --color-primary: #ffffff;
    --color-secondary: #7c3aed;
    --color-accent: #f59e0b;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-bg-dark: #0a0e1a;
    --color-bg-darker: #060913;
    --color-bg-card: rgba(15, 23, 42, 0.8);
    --color-bg-input: rgba(30, 41, 59, 0.4);
    --color-bg-hover: rgba(30, 41, 59, 0.6);
    --color-text-primary: #f8fafc;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #64748b;
    --color-text: #64748b;
    --color-border: rgba(148, 163, 184, 0.1);
    --color-border-light: rgba(148, 163, 184, 0.05);
    --color-border-focus: rgba(0, 212, 255, 0.5);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-input: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-sans);
    color: var(--color-text-primary);
    background: var(--color-bg-darker);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-secondary);
}

/* ===== ANIMATED BACKGROUND ===== */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-primary), transparent);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-secondary), transparent);
    bottom: -150px;
    left: -150px;
    animation-delay: 7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--color-accent), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 60px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 50px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(2px 2px at 90px 10px, white, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.4;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.6;
    }
}

.grid-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(var(--color-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.1;
}

/* ===== MAIN CONTAINER ===== */
.container {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
    z-index: 1;
}

/* ===== LEFT PANEL - BRANDING ===== */
.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px;
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--color-border);
}

.brand-section {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.logo-container {
    display: inline-block;
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
}

.logo-svg {
    width: 300px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.4));
    color: var(--color-primary);
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 25px rgba(0, 212, 255, 0.4)) drop-shadow(0 0 50px rgba(124, 58, 237, 0.2));
    }

    50% {
        transform: scale(1.03);
        filter: drop-shadow(0 0 35px rgba(0, 212, 255, 0.6)) drop-shadow(0 0 70px rgba(124, 58, 237, 0.4));
    }
}

.brand-name {
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.brand-tagline {
    font-size: 18px;
    color: var(--color-text-secondary);
    font-weight: 300;
}

.features-section {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: var(--color-primary);
    transform: translateX(10px);
}

.feature-icon {
    font-size: 32px;
    min-width: 50px;
    text-align: center;
}

.feature-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--color-text-primary);
}

.feature-text p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: var(--color-primary);
    transform: translateY(-5px);
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== RIGHT PANEL - LOGIN FORM ===== */
.right-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background: rgba(6, 9, 19, 0.8);
    backdrop-filter: blur(20px);
}

.login-card {
    width: 100%;
    max-width: 540px; /* slightly wider for better balance */
    padding: 44px; /* a little more space */
    min-height: 420px;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 24px; /* a bit more vertical breathing room */
}

.login-header h2 {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 22px; /* slightly smaller */
    margin: 0 0 8px 0;
}

.login-header p {
    color: var(--color-text-muted);
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 32px; /* more even vertical spacing */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-left: 4px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 20px 50px 20px 44px; /* taller inputs and consistent left padding */
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--color-text-primary);
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.input-wrapper .input-icon svg {
    stroke: var(--color-text-muted);
    opacity: 0.95;
}

.input-wrapper input::placeholder {
    color: var(--color-text-muted);
}

.input-wrapper input:focus {
    background: rgba(30, 41, 59, 0.6);
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1);
}

.input-wrapper .input-icon {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Adjust toggle-password button to avoid overlap */
.toggle-password {
    background: none;
    border: none;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 2;
}

.toggle-password svg {
    stroke: var(--color-text-secondary);
    transition: stroke 0.3s ease;
}

.toggle-password:hover svg {
    stroke: var(--color-primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(148,163,184,0.12);
    border-radius: 8px; /* match button rounding */
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.25s ease, border-color 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    /* match Sign In button visual style */
    background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(0,212,255,0.08));
    border-color: rgba(124,58,237,0.95);
    box-shadow: 0 8px 20px rgba(0,212,255,0.08), inset 0 -6px 12px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transform: none;
}

.checkbox-label {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.forgot-password {
    font-size: 14px;
    font-weight: 500;
}

.login-button {
    width: 100%;
    padding: 12px; /* smaller button */
    margin-top: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: white;
    background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(0,212,255,0.08));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transition: left 0.45s ease;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0,212,255,0.18);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(0,0,0,0.45);
} 

.button-loader svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-danger);
    border-radius: 12px;
    color: var(--color-danger);
    font-size: 14px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
}

.login-footer p {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.system-status {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 10px var(--color-success);
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 20px var(--color-success);
    }
}

.status-text {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.api-status {
    display: flex;
    gap: 8px;
}

.api-badge {
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--color-primary);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 6px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .left-panel {
        padding: 40px;
    }

    .features-section {
        flex-direction: row;
        overflow-x: auto;
    }

    .feature-item {
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    .left-panel {
        display: none;
    }

    .right-panel {
        padding: 30px;
    }

    .login-card {
        padding: 40px 30px;
    }

    .brand-name {
        font-size: 36px;
    }
}

/* ===== GLOBE PAGE STYLES ===== */
body.globe-page {
    overflow: hidden;
    background: var(--color-bg-darker);
}

.globe-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vmax;
    height: 100vmax;
    z-index: 0;
    pointer-events: none;
}

.spinning-globe {
    width: 100%;
    height: 100%;
    animation: spin 120s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Login Button (Top Right) */
.login-btn-topright {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #050913;
    backdrop-filter: blur(12px);
    border: 1px solid #070d19;
    border-radius: 50px;
    color: var(--color-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px -5px rgba(0,212,255,0.2);
}

.login-btn-topright:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--color-primary);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.4);
    transform: translateY(-2px);
}

.login-btn-topright svg {
    width: 20px;
    height: 20px;
}

/* Centered Logo Overlay */
.logo-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    animation: fadeInScale 1.5s ease-out;
}

.hero-logo {
    width: 500px;
    max-width: 80vw;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 40px rgba(0, 212, 255, 0.5)) drop-shadow(0 0 80px rgba(124, 58, 237, 0.3));
    animation: heroGlow 4s ease-in-out infinite;
}

@keyframes heroGlow {
    0%,
    100% {
        filter: drop-shadow(0 0 40px rgba(0, 212, 255, 0.5)) drop-shadow(0 0 80px rgba(124, 58, 237, 0.3));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 60px rgba(0, 212, 255, 0.7)) drop-shadow(0 0 100px rgba(124, 58, 237, 0.5));
        transform: scale(1.02);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.tagline {
    margin-top: 25px;
    font-size: 20px;
    font-weight: 300;
    color: var(--color-text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.8s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    padding: 24px;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.login-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    z-index: 2001;
    max-width: 480px;
    width: 90%;
    max-height: calc(100vh - 48px);
    overflow: visible;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent; /* removed background */
    border: none; /* removed border */
    border-radius: 6px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    z-index: 2100;
}

.modal-close:hover {
    transform: translateY(-2px);
    color: var(--color-primary);
} 

/* Modal Login Card Adjustments */
.login-modal .login-card {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.demo-credentials {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.demo-credentials p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 5px 0;
}

.demo-credentials code {
    background: rgba(0, 212, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Responsive Globe Page */
@media (max-width: 768px) {
    .hero-logo {
        width: 300px;
    }

    .tagline {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .login-btn-topright {
        top: 20px;
        right: 20px;
        padding: 10px 20px;
        font-size: 13px;
    }

    .modal-close {
        top: 12px; /* ensure close button is inside card on small screens */
        width: 36px;
        height: 36px;
    }
}

