/* Login Page Styles - Mobile-friendly and Theme-aware */

/* Base styles for all themes */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Hide the old floating links on mobile */
@media (max-width: 768px) {
    body > div[style*="float: right"] {
        display: none;
    }
}

/* Main container */
.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Login box */
.login-box {
    width: 100%;
    max-width: 320px;
    padding: 30px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Logo container */
.login-logo {
    text-align: left;
}

.login-logo img {
    max-width: 150px;
    height: auto;
}

/* Logo styles from main app */
.login-logo .logo {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}

.login-logo .logo::before {
    content: '';
    display: inline-block;
    width: 60px;
    height: 60px;
    background: url('../logo.jpg') no-repeat center;
    background-size: cover;
    margin-right: 10px;
    border-radius: 6px;
}

.login-logo .logo::after {
    content: 'Bug Tracker';
    font-size: 18pt;
    font-weight: 500;
    color: #374151;
}

/* Dark mode logo text */
body.dark-mode .login-logo .logo::after {
    color: #e4e4e7;
}

/* Classic mode logo styling */
body.classic-mode .login-logo .logo::before {
    width: 50px;
    height: 50px;
    border-radius: 0;
}

body.classic-mode .login-logo .logo::after {
    font-size: 16pt;
    font-weight: bold;
    color: #000080;
}

/* Form styles */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Fix autofill styles in light mode */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #111827 !important;
}

/* Button styles */
.login-button {
    /*width: 100%;*/
    padding: 12px 24px !important;
    font-size: 16px;
    font-weight: 500;
    color: white;
    background: #3b82f6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-left: 4px;
}

.login-button:hover {
    background: #2563eb;
}

.login-button:active {
    transform: translateY(1px);
}

/* Error message */
.error-message {
    display: block;
    margin: 15px 0;
    padding: 12px 16px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #fecaca;
}

.error-message:empty {
    display: none;
}

/* Links section */
.login-links {
    margin-top: 30px;
    text-align: center;
}

.login-links a {
    display: block;
    margin: 10px 0;
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.login-links a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Windows auth note */
.auth-note {
    margin-bottom: 20px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    border: 1px solid #e5e7eb;
}

/* Footer links */
.login-footer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 15px;
    font-size: 12px;
}

.login-footer a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: #3b82f6;
}

/* Dark mode styles */
body.dark-mode {
    background: #1a1a1a;
    color: #e4e4e7;
}

body.dark-mode .login-box {
    background: #262626;
    border-color: #404040;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

body.dark-mode .form-label {
    color: #e4e4e7;
}

body.dark-mode .form-input {
    background: #1a1a1a;
    border-color: #404040;
    color: #e4e4e7;
}

body.dark-mode .form-input[type="password"] {
    background: #1a1a1a;
    color: #e4e4e7;
}

/* Fix autofill styles in dark mode */
    body.dark-mode .form-input:-webkit-autofill,
    body.dark-mode .form-input:-webkit-autofill:hover,
    body.dark-mode .form-input:-webkit-autofill:focus,
    body.dark-mode .form-input:-webkit-autofill:active {
        -webkit-box-shadow: 0 0 0 30px #21252b inset !important;
        -webkit-text-fill-color: #e4e4e7 !important;
        caret-color: #e4e4e7 !important;
    }

/* For browsers that support autofill pseudo-element */
    body.dark-mode .form-input:autofill {
        background-color: #21252b !important;
        color: #e4e4e7 !important;
    }

body.dark-mode .form-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

body.dark-mode .login-button {
    background: #3b82f6;
}

body.dark-mode .login-button:hover {
    background: #60a5fa;
}

body.dark-mode .error-message {
    background: #7f1d1d;
    color: #fecaca;
    border-color: #991b1b;
}

body.dark-mode .auth-note {
    background: #374151;
    color: #d1d5db;
    border-color: #4b5563;
}

body.dark-mode .login-links a {
    color: #60a5fa;
}

body.dark-mode .login-links a:hover {
    color: #93bbfc;
}

body.dark-mode .login-footer a {
    color: #9ca3af;
}

body.dark-mode .login-footer a:hover {
    color: #60a5fa;
}

/* Classic mode styles */
body.classic-mode {
    background: #f0f0ff;
    color: #000000;
}

body.classic-mode .login-box {
    background: #ffffff;
    /*border: 2px solid #8b8bb8;*/
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    border-radius: 0;
}

body.classic-mode .form-label {
    color: #000000;
    font-weight: bold;
}

body.classic-mode .form-input {
    background: #ffffff;
    border: 1px solid #8b8bb8;
    color: #000000;
    border-radius: 0;
}

body.classic-mode .form-input:focus {
    border-color: #000080;
    box-shadow: none;
}

/* Fix autofill styles in classic mode */
body.classic-mode .form-input:-webkit-autofill,
body.classic-mode .form-input:-webkit-autofill:hover,
body.classic-mode .form-input:-webkit-autofill:focus,
body.classic-mode .form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #000000 !important;
}

    body.classic-mode .login-button {
        background: #7490dc;
        color: #fff;
        /*border: 2px outset #7490dc;*/
        border-radius: 0;
        font-weight: bold;
    }

body.classic-mode .login-button:hover {
    background: #9d9dc8;
}

body.classic-mode .login-button:active {
    border-style: inset;
}

body.classic-mode .error-message {
    background: #ffcccc;
    color: #cc0000;
    border: 1px solid #cc0000;
    border-radius: 0;
}

body.classic-mode .auth-note {
    background: #f0f0ff;
    color: #000080;
    border: 1px solid #8b8bb8;
    border-radius: 0;
}

body.classic-mode .login-links a {
    color: #000080;
}

body.classic-mode .login-links a:hover {
    color: #0000ff;
}

body.classic-mode .login-footer a {
    color: #666666;
}

body.classic-mode .login-footer a:hover {
    color: #000080;
}

/* Light mode explicit styles */
body.light-mode {
    background: #f9fafb;
    color: #111827;
}

/* Remove default link styling from logo */
.login-logo a {
    text-decoration: none;
    color: inherit;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .login-logo img {
        max-width: 120px;
    }
    
    .login-logo .logo::before {
        width: 40px;
        height: 40px;
    }
    
    .login-logo .logo::after {
        font-size: 14pt;
    }
    
    .form-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .login-footer {
        position: static;
        margin-top: 30px;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Hide old table layout */
body > div[align="center"] > table {
    display: none;
}

/* Theme toggle integration - hide on login page */
.theme-toggle,
#theme-toggle-btn {
    display: none !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .login-box {
        border-width: 2px;
    }
    
    .form-input {
        border-width: 2px;
    }
    
    .login-button {
        border: 2px solid transparent;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
    }
}

/* Google Sign-In button styling */
.g_id_signin {
    margin-top: 25px;
    display: flex;
    justify-content: left;
}

/* Dark mode adjustments for Google button */
body.dark-mode .g_id_signin iframe {
    filter: invert(0.9) hue-rotate(180deg);
}

/* Classic mode adjustments for Google button */
body.classic-mode .g_id_signin {
    margin-top: 15px;
}