/* Enhanced login page styles for dark neural network theme - Safari Compatible */
.login-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    /* Remove backdrop-filter from outer container for Safari */
    background: rgba(15, 20, 25, 0.6);
    position: relative;
}

.login-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 70%, rgba(100, 255, 218, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(64, 196, 255, 0.1) 0%, transparent 50%);
    animation: loginPulse 10s ease-in-out infinite;
    z-index: -1;
}

@keyframes loginPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.02); }
}

.login-container {
    /* Fallback for non-supporting browsers */
    background: rgba(30, 35, 45, 0.9);
    
    /* Modern browsers with backdrop-filter support */
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    /* Safari-specific fix */
    @supports (-webkit-backdrop-filter: blur(20px)) {
        background: rgba(20, 25, 35, 0.85);
        -webkit-backdrop-filter: blur(20px);
    }
    
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(100, 255, 218, 0.1);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* Safari-specific styles */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .login-container {
            background: rgba(15, 20, 30, 0.95) !important;
            -webkit-backdrop-filter: blur(15px) !important;
        }
    }
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(45deg, #64ffda, #40c4ff);
    opacity: 0.8;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 0.75rem;
    font-weight: 600;
    background: linear-gradient(45deg, #ffffff, #64ffda);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* Fallback for older browsers */
    color: #ffffff;
}

.login-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 0.5rem;
    
    /* Fallback background */
    background: rgba(25, 30, 40, 0.8);
    
    /* Modern browsers */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-sizing: border-box;
}

/* Safari-specific input styles */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .form-group input[type="text"],
        .form-group input[type="password"] {
            background: rgba(20, 25, 35, 0.9) !important;
            -webkit-backdrop-filter: blur(8px) !important;
        }
    }
}

.form-group input[type="text"]::placeholder,
.form-group input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus {
    outline: none;
    border-color: #64ffda;
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.remember-me input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: #64ffda;
}

.remember-me label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.8);
}

.login-button {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    background: linear-gradient(45deg, #64ffda, #40c4ff);
    color: #0f1419 !important;
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(100, 255, 218, 0.3);
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    background: linear-gradient(45deg, #40c4ff, #64ffda);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(100, 255, 218, 0.5);
    color: #0f1419 !important;
}

.error-message {
    background: rgba(239, 68, 68, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(239, 68, 68, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.85rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
}

.hidden {
    display: none;
}

/* Header styling for login page */
.header {
    background: rgba(15, 20, 25, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header .logo h1 a {
    color: #64ffda;
    text-decoration: none;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
}

.main-nav ul {
    display: flex;
}

.main-nav ul li {
    margin-left: 2rem;
}

.main-nav ul li a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.main-nav ul li a:hover {
    color: #64ffda;
    text-shadow: 0 0 8px rgba(100, 255, 218, 0.4);
}

.footer {
    background: transparent;
    padding: 1.5rem 0;
    text-align: center;
}

.copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* ENHANCED MOBILE RESPONSIVE STYLES */
@media (max-width: 767.98px) {
    /* Global mobile container adjustments */
    .container {
        padding: 0 0.75rem;
    }
    
    /* Login section mobile adjustments */
    .login-section {
        min-height: calc(100vh - 120px);
        padding: 1rem 0;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    /* Login container mobile optimization */
    .login-container {
        padding: 1.5rem;
        max-width: 95%;
        margin: 0 auto;
        border-radius: 0.5rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(100, 255, 218, 0.1);
    }
    
    /* Header mobile adjustments */
    .login-header {
        margin-bottom: 1.5rem;
    }
    
    .login-header h2 {
        font-size: 1.125rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    
    .login-header p {
        font-size: 0.875rem;
        line-height: 1.5;
        margin-bottom: 0.375rem;
    }
    
    /* Form group mobile spacing */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }
    
    /* Input field mobile optimization */
    .form-group input[type="text"],
    .form-group input[type="password"] {
        padding: 1rem 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 0.375rem;
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Remember me mobile spacing */
    .remember-me {
        margin-bottom: 1.25rem;
    }
    
    .remember-me input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-right: 0.625rem;
    }
    
    .remember-me label {
        font-size: 0.875rem;
    }
    
    /* Login button mobile optimization */
    .login-button {
        padding: 1rem;
        font-size: 1rem;
        border-radius: 0.375rem;
        min-height: 48px; /* Touch target size */
    }
    
    /* Error message mobile */
    .error-message {
        padding: 0.75rem;
        font-size: 0.875rem;
        margin-bottom: 1.25rem;
    }
    
    /* Header mobile navigation - improved for small screens */
    .header {
        position: fixed;
        background: rgba(15, 20, 25, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    .header .header-content {
        flex-direction: column;
        padding: 0.75rem 0;
        text-align: center;
    }
    
    .header .logo {
        margin-bottom: 0.75rem;
    }
    
    .header .logo h1 {
        font-size: 1.25rem;
        margin: 0;
    }
    
    .main-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .main-nav ul li {
        margin: 0;
    }
    
    .main-nav ul li a {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
        border-radius: 0.25rem;
        transition: all 0.3s ease;
        white-space: nowrap;
    }
    
    .main-nav ul li a:hover {
        background: rgba(100, 255, 218, 0.1);
    }
    
    /* Footer mobile */
    .footer {
        padding: 1rem 0;
    }
    
    .copyright {
        font-size: 0.75rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 479.98px) {
    .login-section {
        padding: 0.5rem 0;
        padding-top: 1.5rem;
    }
    
    .login-container {
        padding: 1.25rem;
        max-width: 98%;
        margin: 0 auto;
    }
    
    .login-header h2 {
        font-size: 1rem;
    }
    
    .login-header p {
        font-size: 0.8125rem;
    }
    
    .form-group input[type="text"],
    .form-group input[type="password"] {
        padding: 0.875rem 0.75rem;
    }
    
    .login-button {
        padding: 0.875rem;
        font-size: 0.9375rem;
    }
}

/* Landscape mobile orientation */
@media (max-width: 767.98px) and (orientation: landscape) {
    .login-section {
        min-height: calc(100vh - 80px);
        padding: 0.5rem 0;
    }
    
    .login-container {
        padding: 1.25rem;
    }
    
    .login-header {
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .header .header-content {
        flex-direction: row;
        padding: 0.75rem 0;
    }
    
    .header .logo {
        margin-bottom: 0;
        margin-right: 2rem;
    }
    
    .main-nav ul {
        flex-direction: row;
        gap: 1rem;
    }
}

/* High DPI/Retina display adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login-container {
        border-width: 0.5px;
    }
    
    .login-container::before {
        height: 2px;
    }
}
