/* ========================================
   UNIFIED LOGIN PAGE STYLES
   Complete CSS for Insurance Admin Login
   
   This file contains ALL login page styles:
   - Enhanced animations and transitions
   - Modern glass morphism design
   - Responsive layouts for all devices
   - RTL support for Arabic interface
   - Accessibility features
   - Loading states and progress indicators
   - Toast notifications
   - Form validation styling
   
   Version: 2.0
   Last Updated: 2024
   ======================================== */

/* Complete Login Page Styles - Enhanced with Animations & UX */

/* Base Styles */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    font-family: 'Cairo', sans-serif !important;
}

/* Enhanced Background Gradient with Animation */
.background-radial-gradient {
    background: radial-gradient(ellipse at center, #667eea 0%, #764ba2 100%);
    background-size: 400% 400%;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1rem;
}

/* Enhanced Login Card with Better Animations */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    /* Enhanced border with better visibility and gradient effect */
    border: 3px solid rgba(102, 126, 234, 0.5);
    /* Add a subtle inner glow effect */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 
                inset 0 1px 0 rgba(255, 255, 255, 0.6),
                0 0 0 1px rgba(102, 126, 234, 0.2);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: slideInUp 0.8s ease-out;
    max-width: 500px;
    width: 100%;
    direction: rtl;
    position: relative;
}

.login-card:hover {
    transform: translateY(-8px) scale(1.02);
    /* Enhanced hover effect with stronger border and glow */
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.8),
                0 0 0 2px rgba(102, 126, 234, 0.4),
                0 0 20px rgba(102, 126, 234, 0.3);
}

/* Loading Overlay for Login Card */
.login-card.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1001;
}

/* Enhanced Header with Better Animation */
.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    animation: headerSlide 0.8s ease-out 0.2s both;
}

@keyframes headerSlide {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

/* Enhanced Welcome Content */
.welcome-content {
    text-align: right;
    flex: 1;
    animation: fadeInRight 0.8s ease-out 0.4s both;
}

@keyframes fadeInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.welcome-text {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
    to { text-shadow: 0 2px 8px rgba(255, 255, 255, 0.3); }
}

.welcome-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    position: relative;
    z-index: 2;
    animation: fadeIn 1s ease-out 0.6s both;
}

/* Enhanced Header Logo */
.header-logo {
    min-width: 100px !important;
    max-width: 100px !important;
    min-height: 78px !important;
    max-height: 78px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.header-logo:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.header-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3)) contrast(1.1) brightness(1.05);
    transition: all 0.3s ease;
}

.header-logo:hover img {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4)) contrast(1.2) brightness(1.1);
}

/* Enhanced Form Container */
.form-container {
    padding: 2.5rem;
    direction: rtl;
    animation: fadeInUp 0.8s ease-out 0.3s both;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Simplified Form Controls - Clean and Simple */
.form-control {
    border: 4px solid #a0a8b0;
    border-radius: 18px;
    padding: 1.2rem 1.5rem;
    font-size: 1.1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Simplified transition */
    background: #ffffff; /* Simple white background */
    width: 100%;
    box-sizing: border-box;
    text-align: right;
    direction: rtl;
    position: relative;
    font-family: 'Cairo', sans-serif;
}

.form-control:hover {
    border-color: #6c757d;
    /* Removed transform and complex shadows */
}

.form-control:focus {
    border-color: #495057;
    border-width: 4px;
    box-shadow: 0 0 0 0.2rem rgba(73, 80, 87, 0.25); /* Simple focus shadow */
    background: #ffffff;
    outline: none;
    /* Removed transform */
}

.form-control.valid {
    border-color: #198754;
    border-width: 4px;
    background: #ffffff;
}

.form-control.invalid {
    border-color: #b02a37;
    border-width: 4px;
    background: #ffffff;
}

/* Simplified Input Group - No Animations */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    /* Removed transition and transforms */
}

.input-group .form-control {
    padding-left: 3.5rem;
}

.input-group .form-control:hover {
    border-color: #6c757d;
    /* No transform, no complex shadows */
}

.input-group .form-control:focus {
    border-color: #495057;
    border-width: 4px;
    box-shadow: 0 0 0 0.2rem rgba(73, 80, 87, 0.25);
    background: #ffffff;
    outline: none;
}

/* Removed input-group hover and focus-within transforms */

/* Simplified Form Groups */
.form-group {
    margin-bottom: 2rem;
    position: relative;
    direction: rtl;
    animation: slideInLeft 0.6s ease-out both;
    /* Removed background, border, and complex effects */
}

.form-group:nth-child(1) { animation-delay: 0.4s; }
.form-group:nth-child(2) { animation-delay: 0.5s; }
.form-group:nth-child(3) { animation-delay: 0.6s; }

/* Removed form-group hover, focused states and ::before pseudo-elements */

.form-group.error {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Enhanced Form Labels - Positioned to Right */
.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
    text-align: right;
    direction: rtl;
    transition: all 0.3s ease;
    font-size: 1rem;
    padding: 0 0.5rem;
    position: relative;
}

.form-label i {
    font-size: 1.1rem;
    color: #667eea;
    margin-left: 0.5rem;
}

.form-group.focused .form-label {
    color: #667eea;
    transform: translateY(-2px);
}

.form-group.error .form-label {
    color: #dc3545;
}

.form-group.error .form-label i {
    color: #dc3545;
}

/* Enhanced Login Button with Loading States */
.login-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: buttonSlide 0.8s ease-out 0.7s both;
}

@keyframes buttonSlide {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-btn::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.5s;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(-1px);
}

/* Loading State for Button */
.login-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.login-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Enhanced Developer Section */
.developer-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e1e5e9;
    animation: fadeIn 1s ease-out 0.8s both;
}

.developer-credit {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.developer-section img {
    max-height: 40px;
    transition: all 0.3s ease;
    filter: grayscale(0.3);
}

.developer-section img:hover {
    transform: scale(1.1);
    filter: grayscale(0);
}

/* Enhanced Animations */
@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .login-card {
        margin: 1rem;
        border-radius: 16px;
    }

    .login-header {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .welcome-content {
        text-align: center;
    }

    .welcome-text {
        font-size: 1.5rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .header-logo {
        min-width: 80px !important;
        max-width: 80px !important;
        min-height: 60px !important;
        max-height: 60px !important;
    }
}

@media (max-width: 480px) {
    .login-card {
        margin: 0.5rem;
        border-radius: 12px;
    }

    .welcome-text {
        font-size: 1.3rem;
    }

    .form-container {
        padding: 1rem;
    }

    .header-logo {
        min-width: 60px !important;
        max-width: 60px !important;
        min-height: 45px !important;
        max-height: 45px !important;
    }

    .login-btn {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* RTL Enhancements */
[dir="rtl"] .form-label {
    justify-content: flex-start;
}

[dir="rtl"] .password-toggle {
    left: 15px;
    right: auto;
}

/* Additional UX Enhancements */
.login-card {
    will-change: transform;
}

.form-group {
    will-change: transform;
}

.logo-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}

.logo-section img {
    max-height: 50px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-section img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Success Animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.login-btn.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    animation: successPulse 0.6s ease-in-out;
}

/* Error Animation */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-btn.error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    animation: errorShake 0.6s ease-in-out;
}

/* Additional UX Enhancement Styles */

/* Progress Indicator */
.progress-indicator {
    margin-top: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e1e5e9;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 2s ease;
    border-radius: 2px;
}

.progress-text {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10000;
    direction: rtl;
    min-width: 300px;
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.toast-content i {
    font-size: 1.25rem;
}

.toast-success {
    border-right: 4px solid #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
}

.toast-success .toast-content {
    color: #155724;
}

.toast-success i {
    color: #28a745;
}

.toast-error {
    border-right: 4px solid #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
}

.toast-error .toast-content {
    color: #721c24;
}

.toast-error i {
    color: #dc3545;
}

/* Enhanced Touch Support */
.touch-device .login-card:hover {
    transform: none;
}

.touch-device .login-btn:hover {
    transform: none;
}

.touch-device .header-logo:hover {
    transform: none;
}

/* Enhanced Mobile Responsive */
@media (max-width: 576px) {
    .toast {
        right: 10px;
        left: 10px;
        min-width: auto;
        transform: translateY(-100%);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Simple Password Toggle Button - Completely Static */
.password-toggle {
    position: absolute;
    left: 20px;
    right: auto;
    top: 50%;
    margin-top: -18px; /* Half of button height (36px/2) for perfect centering */
    background: rgba(73, 80, 87, 0.1);
    border: 2px solid rgba(73, 80, 87, 0.2);
    border-radius: 8px;
    color: #495057;
    cursor: pointer;
    padding: 8px;
    z-index: 10;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Removed all transforms to prevent any movement */
}

.password-toggle:hover {
    color: #212529;
    background: rgba(73, 80, 87, 0.2);
    border-color: rgba(73, 80, 87, 0.4);
}

.password-toggle:active {
    color: #212529;
    background: rgba(73, 80, 87, 0.3);
    /* No transform changes on active state */
}

.password-toggle:focus {
    outline: none;
    /* No transform or movement on focus */
}

.password-toggle i {
    font-size: 0.9rem;
    line-height: 1;
}

/* Simple Validation Messages */
.validation-message {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    text-align: right;
    direction: rtl;
    font-weight: 500;
}

.validation-message.show {
    opacity: 1;
    transform: translateY(0);
}

.validation-message.error {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid rgba(220, 53, 69, 0.3);
}

.validation-message.success {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid rgba(40, 167, 69, 0.3);
}

@keyframes slideInLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
