:root {
    --bg-color: #0e0e10;
    --text-color: #f8f9fa;
    --accent: #BE3144;
    --accent2: #872341;
    --accent3: #7fab1f;
    --accent4: #27ae60;
    --accent5: #f89d13;
    --border-radius: 1rem;
    --glass-bg: rgba(26, 26, 29, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

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

html, body {
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Vazirmatn-Regular', sans-serif;
    direction: rtl;
    overflow: hidden;
    visibility: hidden; /* Prevents FOUT */
}

/* Animated background balls */
.ball {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    z-index: 0;
    animation: float 15s infinite linear;
}

.ball-1 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.ball-2 {
    width: 400px;
    height: 400px;
    background: var(--accent3);
    bottom: 15%;
    right: 10%;
    animation-delay: 5s;
}

.ball-3 {
    width: 250px;
    height: 250px;
    background: var(--accent5);
    top: 60%;
    left: 30%;
    animation-delay: 10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(50px, 50px);
    }
    50% {
        transform: translate(100px, 0);
    }
    75% {
        transform: translate(50px, -50px);
    }
    100% {
        transform: translate(0, 0);
    }
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

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

.logo-text {
    font-family: 'Hasti-HeavyS', sans-serif;
    font-size: 3rem;
    color: var(--text-color);
    text-decoration: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientPulse 4s ease infinite;
}

/* Glass morphism form */
.glass-form {
    max-width: 400px;
    width: 100%;
    padding: 2.5rem;
    background: var(--glass-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    text-align: center;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.login-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--accent5);
    font-family: 'Hasti-HeavyS', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
    text-align: right;
}

.glass-input {
    width: 100%;
    padding: 1rem;
    background: rgba(42, 42, 46, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.glass-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(190, 49, 68, 0.3);
}

.form-label {
    position: absolute;
    top: 1rem;
    right: 1rem;
    transition: all 0.3s ease;
    pointer-events: none;
    color: #aaa;
}

.glass-input:focus + .form-label,
.glass-input:not(:placeholder-shown) + .form-label {
    top: -0.5rem;
    right: 0.8rem;
    font-size: 0.8rem;
    background: rgba(26, 26, 29, 0.8);
    padding: 0 0.3rem;
    color: var(--accent5);
}

.remember-me {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 1.5rem 0;
}

.remember-checkbox {
    margin-left: 0.5rem;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--accent);
    cursor: pointer;
}

.remember-label {
    cursor: pointer;
    /* font-family: 'Mahoor', sans-serif; */
}

.glass-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    color: var(--text-color);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background-size: 200% 200%;
    animation: gradientPulse 4s ease infinite;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(190, 49, 68, 0.4);
    position: relative;
    overflow: hidden;
}

.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(190, 49, 68, 0.6);
}

.glass-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 25%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 75%
    );
    background-size: 400% 400%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glass-button:hover::before {
    opacity: 1;
    animation: shine 1.5s infinite;
}

.copyright {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #aaa;
}

.copyright-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright-link:hover {
    color: var(--accent5);
}

/* Security menu links */
#menu {
    margin-top: 1.5rem;
}

#menu a {
    color: #aaa;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

#menu a:hover {
    color: var(--accent5);
}

@keyframes gradientPulse {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shine {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }
    
    .glass-form {
        padding: 1.5rem;
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    .login-title {
        font-size: 2rem;
    }
    
    .ball {
        filter: blur(40px);
    }
    
    .ball-1, .ball-2, .ball-3 {
        width: 400px;
        height: 400px;
    }
}

/* Session Management Styles */
.active-security-sessions {
    /* margin: 2rem 0; */
    /* padding: 1.5rem; */
    background: var(--glass-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
}

/* .security-sessions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
} */

/* .security-sessions-table th, .security-sessions-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid var(--glass-border);
} */

/* .security-sessions-table th {
    color: var(--accent5);
    font-weight: bold;
} */

.terminate-button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.terminate-button:hover {
    background: var(--accent2);
    transform: translateY(-2px);
}
