* {
    font-family: 'Vazir', sans-serif;
}

body, html {
    height: 100%;
    margin: 0;
    overflow-x: hidden;
}

/* Animated Loader */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 0.5s ease-in-out 2s forwards;
}

.theme-loader {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* Beautiful Blue Background */
.blurred-background {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.blurred-background::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('https://images.unsplash.com/photo-1560472354-b33ff0c44a43?ixlib=rb-4.0.3&auto=format&fit=crop&w=1926&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(8px) brightness(0.7);
    z-index: -1;
}

/* Floating Elements Animation */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.floating-circle:nth-child(1) {
    width: 120px;
    height: 120px;
    top: 15%;
    left: 15%;
    animation-delay: 0s;
}

.floating-circle:nth-child(2) {
    width: 180px;
    height: 180px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.floating-circle:nth-child(3) {
    width: 90px;
    height: 90px;
    top: 35%;
    left: 8%;
    animation-delay: 4s;
}

.floating-circle:nth-child(4) {
    width: 140px;
    height: 140px;
    top: 80%;
    left: 60%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(180deg); }
}

/* Glass Morphism Card */
.login-container {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    overflow: visible;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-section {
    position: relative;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 600px;
}

.image-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('https://images.unsplash.com/photo-1563206767-5b18f218e8de?ixlib=rb-4.0.3&auto=format&fit=crop&w=1926&q=80');
    background-size: cover;
    background-position: center;
    opacity: 0.8;
    border-radius: 0 0 0 25px;
}

.image-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 40px;
}

.image-overlay h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.image-overlay p {
    font-size: 1.2rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Form Section */
.form-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px 20px;
    display: flex;
    align-items: center;
    min-height: 600px;
}

.login-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-form h3 {
    color: #333;
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: 10px;
    text-align: center;
}

.login-form .subtitle {
    color: #666;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 40px;
}

.form-label {
    color: #444;
    font-weight: 500;
    margin-bottom: 8px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
    direction: rtl;
}

.input-group-text {
    background: rgba(79, 172, 254, 0.1);
    border: 2px solid rgba(79, 172, 254, 0.2);
    color: #4facfe;
    border-left: none;
}

.form-control {
    border: 2px solid rgba(79, 172, 254, 0.2);
    border-left: none;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-right: none;
}

.form-control:focus {
    border-color: #4facfe;
    box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
    background-color: rgba(79, 172, 254, 0.05);
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 172, 254, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.btn-primary:hover::before {
    left: 100%;
}

.alert {
    border-radius: 12px;
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
    animation: slideDown 0.5s ease-out;
}

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

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-success {
    background: rgba(25, 135, 84, 0.1);
    color: #0a3622;
    border-left: 4px solid #198754;
}

.link-alternative {
    color: #4facfe;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.link-alternative::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #4facfe;
    transition: width 0.3s ease;
}

.link-alternative:hover::after {
    width: 100%;
}

.link-alternative:hover {
    color: #00f2fe;
    transform: translateY(-1px);
}

/* Password Field Styling */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #4facfe;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #00f2fe;
}

.form-control[type="password"],
.form-control[type="text"] {
    padding-left: 45px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .image-section {
        display: none;
    }

    .form-section {
        padding: 40px 20px;
        min-height: 100vh;
    }

    .login-form h3 {
        font-size: 1.8rem;
    }

    .blurred-background {
        padding: 10px;
    }
}

/* Additional Animations */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Email Icon Animation */
.email-icon {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}
