/* ============================================
   SahinOS — Lock Screen & Login Styles
   ============================================ */

/* Shared Wallpaper */
.lock-wallpaper,
.login-wallpaper {
    position: absolute;
    inset: 0;
    background: url('/uploads/wallpaper/dark-bg.webp') center/cover no-repeat;
}

.matrix-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.55;
    pointer-events: none;
}

.lock-overlay,
.login-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 1;
}

/* ---- LOCK SCREEN ---- */
.lock-screen {
    position: fixed;
    inset: 0;
    z-index: var(--z-lock);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.lock-screen.active {
    opacity: 1;
    visibility: visible;
}

.lock-content {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: fadeIn 1s ease;
}

.lock-time {
    font-size: 96px;
    font-weight: 300;
    letter-spacing: -2px;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    line-height: 1;
    margin-bottom: 8px;
}

.lock-date {
    font-size: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

.lock-message {
    position: absolute;
    bottom: 175px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    max-width: 600px;
    width: 85%;
    text-align: center;
    font-size: 15px;
    line-height: 1.8;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.85);
    pointer-events: none;
}

.lock-message .char {
    display: inline-block;
    opacity: 0;
}

.lock-message .char-space {
    display: inline;
    width: 0.25em;
}

/* Matrix rain style: fast drop like background canvas, bright head flash, stays white */
.lock-message .char-visible {
    animation: charMatrixRain 0.45s linear forwards;
}

@keyframes charMatrixRain {
    0% {
        opacity: 0.6;
        transform: translateY(-30px);
        color: rgba(220, 40, 160, 0.8);
        text-shadow: 0 0 4px rgba(220, 40, 160, 0.5);
    }
    30% {
        opacity: 0.8;
        transform: translateY(-12px);
        color: rgba(180, 50, 240, 0.9);
        text-shadow: 0 0 6px rgba(180, 50, 240, 0.6);
    }
    60% {
        opacity: 1;
        transform: translateY(0);
        color: rgba(255, 180, 255, 1);
        text-shadow: 0 0 12px rgba(255, 100, 220, 0.9), 0 0 24px rgba(180, 50, 240, 0.5);
    }
    80% {
        color: rgba(255, 220, 255, 1);
        text-shadow: 0 0 8px rgba(220, 100, 255, 0.5);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        color: rgba(255, 255, 255, 0.8);
        text-shadow: none;
    }
}

.lock-hint {
    position: absolute;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    animation: pulse 2.5s ease-in-out infinite;
    letter-spacing: 0.3px;
}

/* ---- LOCK SCREEN THEME SELECTOR ---- */
.lock-themes {
    position: absolute;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 10px;
}
.lock-theme-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-family: var(--font-sans);
}
.lock-theme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    transform: scale(1.05);
}
.lock-theme-btn.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}
/* Theme-specific active button colors */
[data-theme="codefather"] .lock-theme-btn.active {
    background: rgba(139, 0, 0, 0.35);
    border-color: rgba(200, 0, 0, 0.6);
    color: #ff8a8a;
    box-shadow: 0 0 12px rgba(139, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}
[data-theme="dark"] .lock-theme-btn.active {
    background: rgba(30, 80, 200, 0.3);
    border-color: rgba(60, 120, 255, 0.5);
    color: #8ab4ff;
    box-shadow: 0 0 12px rgba(30, 80, 200, 0.35);
    backdrop-filter: blur(10px);
}
[data-theme="light"] .lock-theme-btn {
    color: rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .lock-theme-btn:hover {
    color: #000;
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .lock-theme-btn.active {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.3);
    color: #000;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
}
[data-theme="cyberpunk"] .lock-theme-btn.active {
    background: rgba(180, 0, 255, 0.3);
    border-color: rgba(255, 0, 200, 0.5);
    color: #ff80e0;
    box-shadow: 0 0 12px rgba(180, 0, 255, 0.35);
    backdrop-filter: blur(10px);
}

/* ---- SCREEN LANGUAGE SELECTOR ---- */
.screen-lang {
    position: absolute;
    bottom: 20px;
    right: 24px;
    z-index: 3;
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 3px;
}
#lock-lang {
    bottom: 38px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

.screen-lang-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-sans);
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.screen-lang-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
}

.screen-lang-btn.active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* ---- LOGIN SCREEN ---- */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: var(--z-login);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-screen.active {
    opacity: 1;
    visibility: visible;
}

.login-card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px 60px;
    animation: slideUp 0.5s var(--transition-slow);
}

.login-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    cursor: pointer;
}

.login-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5), 0 0 60px rgba(59, 130, 246, 0.2);
}

.avatar-circle {
    width: 100%;
    height: 100%;
}

.avatar-svg {
    width: 100%;
    height: 100%;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.login-username {
    font-size: 24px;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
    margin-top: 4px;
}

.login-btn {
    --btn-color-1: var(--login-btn-1, rgba(59, 130, 246, 0.5));
    --btn-color-2: var(--login-btn-2, rgba(99, 102, 241, 0.5));
    --btn-glow-1: var(--login-glow-1, rgba(59, 130, 246, 0.3));
    --btn-glow-2: var(--login-glow-2, rgba(99, 102, 241, 0.15));
    margin-top: 8px;
    padding: 12px 52px;
    background: linear-gradient(135deg, var(--btn-color-1), var(--btn-color-2));
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition-normal);
    outline: none;
    animation: btnPulse 2.5s ease-in-out infinite;
    box-shadow: 0 0 20px var(--btn-glow-1), 0 0 40px var(--btn-glow-2);
    letter-spacing: 0.5px;
}

@keyframes btnPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.login-btn:hover {
    filter: brightness(1.3);
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.06);
    animation: none;
    box-shadow: 0 0 35px var(--btn-glow-1), 0 0 70px var(--btn-glow-2);
}

.login-btn:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.6), rgba(236, 72, 153, 0.6));
}

.login-hint {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    letter-spacing: 0.3px;
    animation: hintFadeIn 1.5s ease 0.5s both;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 6px 16px;
    backdrop-filter: blur(8px);
}

.login-hint .login-hint-countdown {
    font-weight: 700;
    color: #60a5fa;
}

@keyframes hintFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- TRANSITION STATES ---- */
.lock-screen.hiding {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.login-screen.logging-in .login-card {
    animation: loginCardDissolve 0.5s ease forwards;
}

@keyframes loginCardDissolve {
    0% { opacity: 1; transform: scale(1); filter: blur(0); }
    50% { opacity: 0.5; transform: scale(1.1); filter: blur(2px); }
    100% { opacity: 0; transform: scale(1.3); filter: blur(8px); }
}

.login-screen.logging-in .login-wallpaper {
    transition: transform 1s ease, filter 1s ease;
    transform: scale(1.1);
    filter: blur(20px);
}

.login-screen.logging-in .login-overlay {
    transition: opacity 0.8s ease;
    opacity: 0.8;
}


/* ── Mobile Responsive ── */
@media (max-width: 768px) {
    .lock-time {
        font-size: 64px;
    }

    .lock-date {
        font-size: 15px;
    }

    .lock-message {
        bottom: 120px;
        max-width: 340px;
        font-size: 13px;
        line-height: 1.6;
    }

    .lock-hint {
        bottom: 85px;
        font-size: 14px;
    }

    .screen-lang {
        bottom: 50px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .screen-lang-btn {
        font-size: 10px;
        padding: 4px 8px;
    }

    .legal-links {
        bottom: 8px;
        gap: 4px;
    }

    .legal-links a {
        font-size: 9px;
    }

    .legal-sep {
        font-size: 9px;
    }

    .login-card {
        padding: 32px 24px;
        width: 100%;
        max-width: 320px;
    }

    .login-avatar {
        width: 90px;
        height: 90px;
    }

    .login-username {
        font-size: 20px;
    }

    .login-btn {
        padding: 10px 40px;
        font-size: 14px;
    }

    .login-hint {
        font-size: 11px;
    }
}

/* ── Light Theme Overrides ── */
[data-theme="light"] .lock-time {
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.8) !important;
}
[data-theme="light"] .lock-date {
    text-shadow: none !important;
}
[data-theme="light"] .lock-message {
    color: #475569 !important;
}
[data-theme="light"] .lock-message .char-visible {
    animation: charLightFade 0.45s linear forwards !important;
}
@keyframes charLightFade {
    0% { opacity: 0; transform: translateY(-20px); color: #6366f1; }
    50% { opacity: 0.7; transform: translateY(-5px); color: #4f46e5; }
    100% { opacity: 1; transform: translateY(0); color: #475569; text-shadow: none; }
}
[data-theme="light"] .lock-hint {
    text-shadow: none !important;
}
[data-theme="light"] .screen-lang {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] .screen-lang-btn {
    color: rgba(0, 0, 0, 0.4) !important;
}
[data-theme="light"] .screen-lang-btn:hover {
    color: rgba(0, 0, 0, 0.7) !important;
    background: rgba(0, 0, 0, 0.05) !important;
}
[data-theme="light"] .screen-lang-btn.active {
    color: #fff !important;
    background: rgba(59, 130, 246, 0.7) !important;
}
[data-theme="light"] .login-avatar {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15) !important;
}
[data-theme="light"] .login-avatar:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3), 0 0 60px rgba(59, 130, 246, 0.1) !important;
}
[data-theme="light"] .login-username {
    text-shadow: none !important;
}
[data-theme="light"] .login-btn {
    border-color: transparent !important;
    color: #fff !important;
}
[data-theme="light"] .login-hint {
    color: rgba(0, 0, 0, 0.45) !important;
}
