/**
 * Modern Login Page Styles
 * Features: Animated gradients, Glassmorphism, Smooth animations
 */

/* ========== Animated Background ========== */
.login-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Dark theme background */
body.dark-theme .login-page-wrapper {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 50%, #1e293b 75%, #0f172a 100%);
    background-size: 400% 400%;
}

/* ========== Floating Particles Animation ========== */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: float 20s infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) translateX(100px) scale(0.5);
        opacity: 0;
    }
}

/* Create multiple particles with different delays */
.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: 2s;
    animation-duration: 20s;
}

.particle:nth-child(3) {
    left: 30%;
    animation-delay: 4s;
    animation-duration: 22s;
}

.particle:nth-child(4) {
    left: 40%;
    animation-delay: 6s;
    animation-duration: 18s;
}

.particle:nth-child(5) {
    left: 50%;
    animation-delay: 8s;
    animation-duration: 24s;
}

.particle:nth-child(6) {
    left: 60%;
    animation-delay: 10s;
    animation-duration: 21s;
}

.particle:nth-child(7) {
    left: 70%;
    animation-delay: 12s;
    animation-duration: 19s;
}

.particle:nth-child(8) {
    left: 80%;
    animation-delay: 14s;
    animation-duration: 23s;
}

.particle:nth-child(9) {
    left: 90%;
    animation-delay: 16s;
    animation-duration: 26s;
}

.particle:nth-child(10) {
    left: 15%;
    animation-delay: 18s;
    animation-duration: 20s;
}

/* ========== Glassmorphism Login Container ========== */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
    padding: 20px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 50px 40px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
    overflow: hidden;
    animation: boxPulse 2s ease-in-out infinite;
}

@keyframes boxPulse {

    0%,
    100% {
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    }

    50% {
        box-shadow: 0 12px 48px 0 rgba(31, 38, 135, 0.5);
    }
}

/* Dark theme glass effect */
body.dark-theme .login-box {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Decorative gradient overlay */
.login-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ========== Login Header ========== */
.login-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.login-header i {
    font-size: 4rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: iconFloat 3s ease-in-out infinite;
    display: inline-block;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.login-header h1 {
    color: white;
    font-size: 2rem;
    margin: 20px 0 10px 0;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeIn 1s ease-out 0.3s both;
}

.login-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    animation: fadeIn 1s ease-out 0.5s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ========== Theme Switcher Button ========== */
.theme-switcher-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

body[dir="rtl"] .theme-switcher-container {
    right: auto;
    left: 20px;
}

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

body.dark-theme .theme-toggle-btn {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ========== Form Styles ========== */
.login-box form {
    position: relative;
    z-index: 1;
}

.login-box .form-group {
    margin-bottom: 25px;
    animation: slideInLeft 0.6s ease-out backwards;
}

.login-box .form-group:nth-child(1) {
    animation-delay: 0.2s;
}

.login-box .form-group:nth-child(2) {
    animation-delay: 0.3s;
}

.login-box .form-group:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-box .form-label {
    color: white;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.login-box .form-label i {
    color: rgba(255, 255, 255, 0.9);
}

.login-box .form-control {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.login-box .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.login-box .form-control:focus {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Remember me checkbox */
.login-box input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.login-box label[for="remember"] {
    color: white;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ========== Submit Button ========== */
.login-box .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 16px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    width: 100%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: slideInLeft 0.6s ease-out 0.5s backwards;
}

.login-box .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.login-box .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

/* ========== Language Switcher ========== */
.language-section {
    margin-top: 30px;
    text-align: center;
    animation: fadeIn 1s ease-out 0.7s both;
}

.language-section>div:first-child {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lang-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lang-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ========== Demo Credentials ========== */
.demo-credentials {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeIn 1s ease-out 0.9s both;
}

.demo-credentials strong {
    color: white;
    display: block;
    margin-bottom: 10px;
    font-size: 1rem;
}

.demo-credentials p {
    margin: 8px 0;
    font-size: 0.9rem;
}

.demo-credentials code {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* ========== Alert Styles ========== */
.login-box .alert {
    background: rgba(239, 68, 68, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.login-box .alert i {
    color: #fca5a5;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .login-container {
        max-width: 90%;
        padding: 10px;
    }

    .login-box {
        padding: 40px 30px;
    }

    .login-header i {
        font-size: 3rem;
    }

    .login-header h1 {
        font-size: 1.6rem;
    }

    .theme-switcher-container {
        top: 10px;
        right: 10px;
    }

    body[dir="rtl"] .theme-switcher-container {
        right: auto;
        left: 10px;
    }

    .theme-toggle-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .login-header i {
        font-size: 2.5rem;
    }

    .login-header h1 {
        font-size: 1.4rem;
    }

    .lang-buttons {
        flex-direction: column;
        width: 100%;
    }

    .lang-btn {
        width: 100%;
    }
}

/* ========== Theme Dropdown ========== */
.theme-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

body[dir="rtl"] .theme-dropdown {
    right: auto;
    left: 0;
}

body.dark-theme .theme-dropdown {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
}

body[dir="rtl"] .theme-option {
    text-align: right;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-option.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    font-weight: 600;
}

.theme-option i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.theme-color-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-left: auto;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

body[dir="rtl"] .theme-color-preview {
    margin-left: 0;
    margin-right: auto;
}

/* Theme color previews */
.theme-option[data-theme="light"] .theme-color-preview {
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

.theme-option[data-theme="dark"] .theme-color-preview {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.theme-option[data-theme="blue"] .theme-color-preview {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.theme-option[data-theme="green"] .theme-color-preview {
    background: linear-gradient(135deg, #10b981, #059669);
}

.theme-option[data-theme="purple"] .theme-color-preview {
    background: linear-gradient(135deg, #a855f7, #9333ea);
}

.theme-option[data-theme="orange"] .theme-color-preview {
    background: linear-gradient(135deg, #f97316, #ea580c);
}