/* Authentication System Styles */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

/* Auth Modal */
.auth-modal {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Modal Body */
.modal-body {
    padding: 1.5rem 2rem 2rem;
}

/* Auth Form */
.auth-form {
    margin-bottom: 1.5rem;
}

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

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

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Form Options */
.form-options {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    cursor: pointer;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent-color);
}

.checkbox-label span {
    flex: 1;
}

.checkbox-label a {
    color: var(--accent-color);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.forgot-password {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    float: right;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Auth Submit Button */
.auth-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.auth-submit:hover:not(:disabled) {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

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

/* Auth Divider */
.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
}

/* Social Auth */
.social-auth {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-primary);
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-social:hover {
    border-color: var(--accent-color);
    background: rgba(139, 92, 246, 0.05);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

.btn-social svg {
    flex-shrink: 0;
}

/* Auth Switch */
.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Password Strength */
.password-strength {
    margin-top: 0.5rem;
}

.password-strength-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.strength-feedback {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* User Profile Button */
.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
}

.user-profile-btn:hover {
    background: rgba(139, 92, 246, 0.1);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.user-name-small {
    font-weight: 500;
    color: var(--text-primary);
}

/* User Menu Dropdown */
.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    min-width: 280px;
    z-index: 1001;
    animation: dropdownSlideIn 0.2s ease-out;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-info {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.user-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.menu-items {
    padding: 0.5rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.menu-item:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-color);
}

.menu-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 480px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .auth-modal {
        max-width: 100%;
        margin: 0;
    }
    
    .modal-header,
    .modal-body {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .social-auth {
        gap: 0.5rem;
    }
    
    .btn-social {
        font-size: 0.85rem;
        padding: 0.625rem 0.75rem;
    }
    
    .user-menu-dropdown {
        min-width: 260px;
        right: -10px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .auth-modal {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .modal-header {
        border-bottom-color: #374151;
    }
    
    .modal-header h2 {
        color: #f9fafb;
    }
    
    .form-group input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .form-group input::placeholder {
        color: #9ca3af;
    }
    
    .auth-divider::before {
        background: #374151;
    }
    
    .auth-divider span {
        background: #1f2937;
    }
    
    .btn-social {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .user-menu-dropdown {
        background: #1f2937;
        border-color: #374151;
    }
    
    .menu-divider {
        background: #374151;
    }
}