/* User Authentication Styles */

/* Auth Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    display: none;
}

/* Protected Page - Blur Content */
body.page-protected main {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: none;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.auth-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    position: relative;
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.auth-modal-close:hover {
    color: #1e1e1e;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s;
}

.auth-tab:hover {
    color: #005EB8;
    background: #f8f9fa;
}

.auth-tab.active {
    color: #005EB8;
    border-bottom-color: #005EB8;
}

/* Tab Content */
.auth-tab-content {
    display: none;
}

.auth-tab-content.active {
    display: block;
}

.auth-tab-content h2 {
    margin: 0 0 0.5rem;
    color: #1e1e1e;
    font-size: 1.5rem;
}

.auth-message {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
}

.auth-form-group label {
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: #1e1e1e;
    font-size: 0.9rem;
}

.auth-form-group input[type="text"],
.auth-form-group input[type="email"],
.auth-form-group input[type="password"] {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.auth-form-group input:focus {
    outline: none;
    border-color: #005EB8;
    box-shadow: 0 0 0 3px rgba(0, 94, 184, 0.1);
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
}

.auth-form label {
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: #1e1e1e;
    font-size: 0.9rem;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: #005EB8;
    box-shadow: 0 0 0 3px rgba(0, 94, 184, 0.1);
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 3rem;
    flex: 1;
}

.toggle-password {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.toggle-password:hover {
    opacity: 0.7;
}

.eye-icon {
    font-size: 1.2rem;
    user-select: none;
}

.form-checkbox {
    flex-direction: row !important;
    align-items: center;
    display: flex;
    width: 100%;
}

.form-checkbox label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Submit Button */
.auth-submit-btn {
    background: #005EB8;
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 0.5rem;
}

.auth-submit-btn:hover:not(:disabled) {
    background: #004F9F;
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-links a {
    color: #005EB8;
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Error Message */
.auth-error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    font-size: 0.9rem;
}

/* Success Message */
.auth-success {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    font-size: 0.9rem;
}

/* Password Display */
.password-display {
    text-align: center;
}

.password-display .success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 1.5rem;
}

.password-display h3 {
    color: #155724;
    margin: 0 0 1rem;
}

.password-box {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.password-box input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #28a745;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    background: white;
}

.copy-password-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.copy-password-btn:hover {
    background: #218838;
}

.warning-text {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin: 1rem 0;
}

/* Auth Menu Item Positioning */
.auth-menu-item {
    margin-left: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
}

/* Navbar Auth Button */
.nav-login-btn {
    background: white;
    color: #005EB8;
    border: 2px solid white;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-login-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* User Menu Dropdown */
.user-menu-dropdown {
    position: relative;
    margin-left: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
}

.user-menu-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dropdown-arrow {
    font-size: 0.7rem;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    min-width: 200px;
    display: none;
    z-index: 1000;
    margin-top: 0.5rem;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown li {
    list-style: none;
    margin: 0;
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #1e1e1e;
    text-decoration: none;
    transition: background-color 0.2s;
}

.user-dropdown a:hover {
    background: #f8f9fa;
}

.user-dropdown li:first-child a {
    border-radius: 4px 4px 0 0;
}

.user-dropdown li:last-child a {
    border-radius: 0 0 4px 4px;
}

/* Success Notification */
.auth-success-notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .auth-modal-content {
        padding: 1.5rem;
    }
    
    .auth-tab {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
    
    .password-box {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .auth-modal-content {
        padding: 1rem;
    }
    
    .auth-tab-content h2 {
        font-size: 1.3rem;
    }
    
    .user-dropdown {
        right: -10px;
    }
}
