/* Authentication Styles - Basic UI */
:root {
    --auth-primary: #926ecc;
    --auth-primary-dark: #706d9c;
    --auth-secondary: #e8dff5;
    --auth-error: #dc3545;
    --auth-success: #28a745;
    --auth-border: #e0e0e0;
    --auth-text: #333;
    --auth-text-light: #666;
    --auth-shadow: rgba(0, 0, 0, 0.1);
}

/* Modal Base */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.auth-modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px var(--auth-shadow);
}

.auth-modal.active .auth-modal-content {
    transform: scale(1);
}

/* Modal Close Button */
.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--auth-text-light);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: var(--auth-secondary);
    color: var(--auth-text);
}

/* Modal Headers */
.auth-modal-content h2 {
    margin: 0 0 0.5rem 0;
    color: var(--auth-text);
    font-size: 1.75rem;
    font-weight: 600;
}

.auth-subtitle {
    color: var(--auth-text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Form Styles */
.auth-form {
    margin: 0;
}

.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--auth-text);
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--auth-border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form-group input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(146, 110, 204, 0.1);
}

.auth-hint {
    display: block;
    margin-top: 0.25rem;
    color: var(--auth-text-light);
    font-size: 0.85rem;
}

/* Form Row */
.auth-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

/* Checkbox */
.auth-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--auth-text);
}

.auth-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Links */
.auth-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

/* Error/Success Messages */
.auth-error,
.auth-success {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: none;
}

.auth-error:not(:empty),
.auth-success:not(:empty) {
    display: block;
}

.auth-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(146, 110, 204, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-submit-btn .btn-text,
.auth-submit-btn .btn-loading {
    display: block;
}

.auth-submit-btn .btn-loading {
    display: none;
}

.auth-submit-btn.loading .btn-text {
    display: none;
}

.auth-submit-btn.loading .btn-loading {
    display: block;
}

/* Switch Links */
.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--auth-text-light);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-switch a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

/* Email Verification Modal */
.auth-verification-message {
    text-align: center;
    padding: 2rem 0;
}

.email-icon {
    color: var(--auth-primary);
    margin-bottom: 1.5rem;
}

.auth-verification-message p {
    color: var(--auth-text);
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* User Menu Styles */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--auth-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-toggle:hover {
    border-color: var(--auth-primary);
    box-shadow: 0 2px 8px var(--auth-shadow);
}

.user-icon {
    color: var(--auth-primary);
}

.user-email {
    color: var(--auth-text);
    font-size: 0.9rem;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chevron-icon {
    color: var(--auth-text-light);
    transition: transform 0.2s ease;
}

.user-dropdown.active + .user-menu-toggle .chevron-icon {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid var(--auth-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px var(--auth-shadow);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--auth-border);
}

.dropdown-email {
    font-size: 0.9rem;
    color: var(--auth-text);
    margin: 0 0 0.25rem 0;
    font-weight: 500;
}

.dropdown-role {
    font-size: 0.8rem;
    color: var(--auth-text-light);
    margin: 0;
    text-transform: capitalize;
}

.dropdown-divider {
    height: 1px;
    background: var(--auth-border);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--auth-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--auth-secondary);
}

.dropdown-item svg {
    color: var(--auth-text-light);
}

.logout-btn {
    color: var(--auth-error);
}

.logout-btn svg {
    color: var(--auth-error);
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .auth-modal-content {
        width: 95%;
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .user-email {
        display: none;
    }

    .user-menu-toggle {
        padding: 0.5rem;
    }

    .user-dropdown {
        right: -0.5rem;
    }
}

/* Animation for modal appearance */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-modal.active .auth-modal-content {
    animation: modalFadeIn 0.3s ease forwards;
}
