/* Login page styles */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --header-color: #00a0ff;
    --card-bg: #1e1e1e;
    --border-color: #333;
    --button-color: #0a84ff;
    --button-hover: #0066cc;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.light-mode {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --header-color: #0066cc;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --button-color: #0a84ff;
    --button-hover: #0066cc;
    --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    background-image: url('/static/images/earth_night_4k.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.login-container {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border-color);
    z-index: 1;
    backdrop-filter: blur(5px);
    background-color: rgba(30, 30, 30, 0.8);
}

.logo-container {
    margin-bottom: 1.5rem;
}

.logo-icon {
    font-size: 3rem;
    color: var(--header-color);
    margin-bottom: 0.5rem;
    animation: pulse 3s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

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

h1 {
    margin: 0 0 1.5rem 0;
    color: var(--header-color);
    font-weight: 500;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

input[type="password"] {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    box-sizing: border-box;
}

button {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--button-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
}

button:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.error {
    color: #ff4757;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
    background-color: rgba(255, 71, 87, 0.1);
    padding: 8px;
    border-radius: 4px;
}

.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.theme-toggle-switch {
    position: relative;
    display: inline-block;
}

.theme-switch-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    width: 50px;
    height: 24px;
    background-color: #333;
    border-radius: 100px;
    position: relative;
    transition: background-color 0.2s;
    padding: 0 5px;
}

.theme-switch-toggle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 45px;
    transition: 0.2s;
    background: #fff;
    box-shadow: 0 0 2px 0 rgba(10, 10, 10, 0.29);
}

.theme-switch-input:checked + .theme-switch-label .theme-switch-toggle {
    left: calc(100% - 22px);
}

.theme-switch-input:checked + .theme-switch-label {
    background-color: #1a1a1a;
}

/* Light mode (unchecked) */
body.light-mode .theme-switch-input:not(:checked) + .theme-switch-label {
    background-color: #4cd137;
}

.theme-icon {
    color: white;
    z-index: 1;
    font-size: 0.7rem;
}

/* Star animation */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes twinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: var(--opacity); }
}