/* ====================================
   AUTHENTICATION STYLES
   ==================================== */

/* Auth Buttons in Navigation */
.auth-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
}

.btn-auth {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-login {
    background: transparent;
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.btn-login:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Dark theme override */
[data-theme="dark"] .btn-login {
    color: #60a5fa;
    border-color: #60a5fa;
}

[data-theme="dark"] .btn-login:hover {
    background: #60a5fa;
    color: #1e293b;
}

.btn-register {
    background: linear-gradient(135deg, #f97316, #ec4899);
    color: white;
    border: none;
}

.btn-register:hover {
    background: linear-gradient(135deg, #ea580c, #db2777);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.5);
}

/* Dark theme - brighter gradient */
[data-theme="dark"] .btn-register {
    background: linear-gradient(135deg, #fb923c, #f472b6);
}

[data-theme="dark"] .btn-register:hover {
    background: linear-gradient(135deg, #f97316, #ec4899);
}

/* User Menu */
.auth-user-menu {
    position: relative;
}

.user-avatar-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.user-avatar-container:hover {
    background: rgba(0, 119, 182, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 200px;
    z-index: 1000;
}

.auth-user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-item:hover {
    background: var(--primary-color);
    color: white;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.auth-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.auth-modal.active .auth-modal-container {
    transform: translate(-50%, -50%) scale(1);
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    z-index: 10;
}

.auth-modal-close:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg);
}

.auth-modal-content {
    padding: 2rem;
}

/* Auth Form */
.auth-form-container {
    width: 100%;
}

.auth-form-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-form {
    width: 100%;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-left: 3rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-color);
    background: var(--background-color);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 119, 182, 0.1);
}

.form-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.form-group:has(label) .form-icon {
    top: calc(50% + 0.75rem);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.form-group:has(label) .toggle-password {
    top: calc(50% + 0.75rem);
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.75rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.forgot-password,
.terms-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-password:hover,
.terms-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 119, 182, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.form-footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.notification {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--primary-color);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left-color: #26de81;
}

.notification-error {
    border-left-color: #ff4757;
}

.notification-warning {
    border-left-color: #fed330;
}

.notification-info {
    border-left-color: #45aaf2;
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-success .notification-icon {
    color: #26de81;
}

.notification-error .notification-icon {
    color: #ff4757;
}

.notification-warning .notification-icon {
    color: #fed330;
}

.notification-info .notification-icon {
    color: #45aaf2;
}

.notification-content {
    flex: 1;
}

.notification-message {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.5;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.notification-action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-action-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.notification-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

/* Dark Mode Adjustments */
body.dark-mode .auth-modal-container,
body.dark-mode .notification {
    background: #1a1a2e;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark-mode .form-group input {
    background: #16213e;
    border-color: #2d3561;
    color: #e0e0e0;
}

body.dark-mode .strength-bar {
    background: #2d3561;
}

body.dark-mode .dropdown-item:hover {
    background: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        margin-left: 0;
        gap: 0.5rem;
    }

    .btn-auth {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .btn-auth i {
        display: none;
    }

    .auth-modal-container {
        width: 95%;
        max-width: none;
    }

    .auth-modal-content {
        padding: 1.5rem;
    }

    .auth-form-title {
        font-size: 1.5rem;
    }

    .notification-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .user-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .profile-tabs {
        flex-direction: column;
        gap: 0;
    }

    .tab-btn {
        text-align: left;
        border-bottom: 1px solid var(--border-color);
    }

    .tab-btn.active::after {
        width: 4px;
        height: 100%;
        left: 0;
        top: 0;
        bottom: auto;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
