/* Profile & Authentication UI - Home Page */

/* Uses global theme variables from themes.css */

/* Floating Auth UI */
.floating-auth {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    user-select: auto;
    -webkit-user-select: auto;
}

.floating-auth a,
.floating-auth button,
.floating-auth .dropdown-toggle {
    pointer-events: all;
    cursor: pointer;
}

/* Profile Icon */
.floating-auth .auth-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-button-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-button-border);
    color: var(--glass-button-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.floating-auth .auth-icon:hover {
    background: var(--glass-button-hover);
}

/* Auth Links Container */
.floating-auth .auth-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #e0e0e0; /* Fixed color for dark background */
    text-shadow: none;
}

.floating-auth .auth-links a {
    color: #e0e0e0; /* Fixed color for dark background */
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.floating-auth .auth-links a:hover {
    color: #999; /* Fixed hover color for dark background */
}

.floating-auth .auth-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #e0e0e0; /* Fixed color for dark background */
    transition: width 0.3s;
}

.floating-auth .auth-links a:hover::after {
    width: 100%;
}

.floating-auth .auth-separator {
    color: #999; /* Fixed color for dark background */
    margin: 0 4px;
}

/* Logged in state */
.floating-auth .profile-dropdown {
    position: relative;
}

.floating-auth .profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px 8px 8px;
    border-radius: 30px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.floating-auth .profile-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.floating-auth .profile-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    color: #344767;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-auth .dropdown-menu {
    background: rgba(30, 30, 40, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    margin-top: 8px;
}

.floating-auth .dropdown-item {
    color: #ffffff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Profile Modal */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-modal.show {
    display: flex;
    opacity: 1;
}

.profile-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: var(--overlay-blur);
    cursor: pointer;
}

.profile-modal-content {
    position: relative;
    background: var(--bg-secondary);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.profile-modal.show .profile-modal-content {
    transform: scale(1);
}

.profile-modal-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.profile-logout-link-form {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    padding: 0;
}

.profile-logout-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    font-family: inherit;
    transition: color 0.2s ease;
}

.profile-logout-link:hover {
    color: var(--primary-hover);
}

.profile-modal-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-modal-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.profile-modal-name {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    text-shadow: none;
}

.profile-modal-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.profile-modal-quote {
    font-size: 13px;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
    padding: 0 10px;
    margin-top: 8px;
}

/* Account Information Section */
.profile-modal-info {
    margin-bottom: 24px;
    padding-top: 24px;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-info-row:last-child {
    border-bottom: none;
}

.profile-info-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.profile-info-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Profile modal theme toggle - align right */
.profile-info-row .theme-toggle-modal {
    margin-left: auto;
}

/* Action Buttons */
.profile-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: space-between;
}

.profile-action-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 24px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-action-btn:hover {
    background: var(--primary-hover);
    color: white;
}

.profile-action-btn.secondary {
    background: var(--secondary-button-bg);
    color: var(--text-primary);
}

.profile-action-btn.secondary:hover {
    background: var(--secondary-button-hover);
    color: var(--text-primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .floating-auth {
        top: 20px;
        right: 20px;
        gap: 10px;
    }
    
    .floating-auth .auth-icon {
        width: 36px;
        height: 36px;
    }
    
    .floating-auth .auth-links {
        font-size: 14px;
    }
    
    .floating-auth .profile-icon {
        width: 28px;
        height: 28px;
    }
    
    .profile-modal-content {
        padding: 32px 24px;
        max-width: 360px;
    }
    
    .profile-modal-actions {
        flex-direction: column;
    }
}

/* Auth Modal (Login/Register) Specific Styles */
.auth-modal-content {
    max-width: 440px;
    padding: 0;
    overflow: hidden;
}

.auth-modal-header {
    padding: 32px 40px 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.auth-modal-header .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.auth-modal-header .modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.auth-modal-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.auth-modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

.auth-modal-body {
    padding: 32px 40px;
}

.auth-error-message {
    background: var(--error-bg, #fee);
    border: 1px solid var(--error-color, #e74c3c);
    color: var(--error-color, #e74c3c);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-error-message.hidden {
    display: none;
}

.auth-warning-message {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

[data-theme="dark"] .auth-warning-message {
    background: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
    color: #ffda6a;
}

.auth-modal-body .form-group {
    margin-bottom: 20px;
}

.auth-modal-body .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-modal-body .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.auth-modal-body .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 71, 103, 0.1);
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper .form-input {
    padding-right: 45px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: var(--text-primary);
}

.password-toggle-btn .eye-closed {
    display: none;
}

.password-toggle-btn.showing .eye-open {
    display: none;
}

.password-toggle-btn.showing .eye-closed {
    display: block;
}

.auth-modal-body .field-error {
    display: block;
    color: var(--error-color, #e74c3c);
    font-size: 12px;
    margin-top: 4px;
}

.auth-modal-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-btn-primary {
    width: 100%;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.auth-btn-primary:hover {
    background: var(--primary-hover);
}

.auth-modal-footer {
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-modal-footer .auth-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-modal-footer .auth-link:hover {
    color: var(--primary-hover);
}

/* Progress Indicator */
.form-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.form-progress.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-text {
    margin-top: 16px;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Mobile responsive for auth modal */
@media (max-width: 768px) {
    .auth-modal-content {
        max-width: 360px;
    }
    
    .auth-modal-header {
        padding: 24px 24px 20px;
    }
    
    .auth-modal-body {
        padding: 24px;
    }
    
    .auth-modal-title {
        font-size: 24px;
    }
    
    .auth-modal-subtitle {
        font-size: 13px;
    }
}
