/**
 * Authentication Styles for Kangra Hub
 */

/* Auth Modal Overlay */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Auth Modal */
.auth-modal {
    background: var(--bg-card, #fff);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

[data-theme="dark"] .auth-modal {
    background: #1e293b;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400, #9CA3AF);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-600, #4B5563);
}

.auth-modal-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-500, #00AEEF), var(--accent-500, #8B5CF6));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.auth-modal-icon i {
    font-size: 2rem;
    color: #fff;
}

.auth-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #1e293b);
}

.auth-modal-text {
    color: var(--gray-600, #4B5563);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.auth-modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-modal-buttons .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 12px;
    min-width: 120px;
}

.auth-modal-note {
    font-size: 0.875rem;
    color: var(--gray-500, #6B7280);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-modal-note i {
    color: var(--success-500, #10B981);
}

/* ===== PROFILE DROPDOWN STYLES ===== */

.auth-profile-dropdown {
    position: relative;
}

.auth-profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
    transition: all 0.2s ease;
}

.auth-profile-trigger:hover {
    background: var(--gray-50, #f9fafb);
    border-color: var(--primary-300, #7dd3fc);
}

.auth-profile-trigger .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-500, #00AEEF);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
}

.auth-profile-trigger .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-profile-trigger .user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-profile-trigger .fa-chevron-down {
    font-size: 10px;
    color: var(--gray-500, #6b7280);
    transition: transform 0.2s ease;
}

.auth-profile-dropdown.open .auth-profile-trigger .fa-chevron-down {
    transform: rotate(180deg);
}

/* Profile Menu */
.auth-profile-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    overflow: hidden;
    z-index: 1002;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-profile-dropdown.open .auth-profile-menu {
    display: block;
}

.auth-profile-menu a,
.auth-profile-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary, #1e293b);
    text-decoration: none;
    transition: background 0.2s ease;
    width: 100%;
    background: none;
    border: none;
    font-size: inherit;
    cursor: pointer;
    text-align: left;
}

.auth-profile-menu a:hover,
.auth-profile-menu button:hover {
    background: var(--gray-50, #f9fafb);
}

.auth-profile-menu a i {
    width: 18px;
    text-align: center;
}

.auth-profile-menu .auth-logout-btn {
    color: var(--error-600, #dc2626);
}

.auth-profile-menu .auth-logout-btn:hover {
    background: var(--error-50, #fef2f2);
}

.auth-profile-menu hr {
    margin: 0;
    border: none;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

/* Dark mode support */
[data-theme="dark"] .auth-profile-trigger {
    background: var(--bg-card, #1e293b);
    border-color: var(--border-color, #334155);
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .auth-profile-trigger:hover {
    background: #334155;
}

[data-theme="dark"] .auth-profile-menu {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .auth-profile-menu a,
[data-theme="dark"] .auth-profile-menu button {
    color: #f1f5f9;
}

[data-theme="dark"] .auth-profile-menu a:hover,
[data-theme="dark"] .auth-profile-menu button:hover {
    background: #334155;
}

/* ===== NOTIFICATION STYLES ===== */

.auth-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: #fff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 100001;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-notification.success {
    background: linear-gradient(135deg, #10B981, #059669);
}

.auth-notification.error {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

.auth-notification.info {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
}

.auth-notification i {
    font-size: 1.25rem;
}

/* ===== PROFILE SETTINGS SECTION ===== */

.profile-settings-section {
    background: var(--bg-card, #fff);
    border-radius: var(--radius-xl, 16px);
    padding: 2rem;
    border: 1px solid var(--border-color, #e5e7eb);
}

.profile-settings-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-settings-section h3 i {
    color: var(--primary-500, #00AEEF);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.profile-avatar-upload {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.profile-avatar-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-100, #e0f2fe);
    color: var(--primary-600, #0284c7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
    overflow: hidden;
    border: 3px solid var(--primary-200, #bae6fd);
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: var(--primary-500, #00AEEF);
    color: #fff;
    border: 3px solid var(--bg-card, #fff);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.profile-avatar-edit:hover {
    background: var(--primary-600, #0284c7);
    transform: scale(1.1);
}

.profile-avatar-edit input {
    display: none;
}

.profile-avatar-info {
    flex: 1;
}

.profile-avatar-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary, #1e293b);
}

.profile-avatar-info p {
    font-size: 0.875rem;
    color: var(--gray-500, #6b7280);
    margin: 0;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.profile-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-form-group.full-width {
    grid-column: span 2;
}

.profile-form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-form-label i {
    color: var(--gray-400, #9ca3af);
    font-size: 0.8rem;
}

.profile-form-label .editable-icon {
    color: var(--primary-500, #00AEEF);
}

.profile-form-label .locked-icon {
    color: var(--gray-400, #9ca3af);
}

.profile-form-input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #1e293b);
}

.profile-form-input:focus {
    outline: none;
    border-color: var(--primary-500, #00AEEF);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.1);
}

.profile-form-input.locked {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-500, #6b7280);
    cursor: not-allowed;
}

.profile-form-input.locked:focus {
    border-color: var(--border-color, #e5e7eb);
    box-shadow: none;
}

.profile-locked-note {
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.profile-form-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
    margin-top: 0.5rem;
}

.profile-save-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-500, #00AEEF);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg, 12px);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.profile-save-btn:hover {
    background: var(--primary-600, #0284c7);
}

.profile-save-btn:disabled {
    background: var(--gray-300, #d1d5db);
    cursor: not-allowed;
}

.profile-cancel-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--gray-600, #4b5563);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-cancel-btn:hover {
    background: var(--gray-50, #f9fafb);
}

.profile-feedback {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg, 12px);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-feedback.success {
    background: var(--success-50, #ecfdf5);
    color: var(--success-700, #047857);
    border: 1px solid var(--success-200, #a7f3d0);
}

.profile-feedback.error {
    background: var(--error-50, #fef2f2);
    color: var(--error-700, #b91c1c);
    border: 1px solid var(--error-200, #fecaca);
}

/* Dark mode */
[data-theme="dark"] .profile-settings-section {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .profile-form-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .profile-form-input.locked {
    background: #1e293b;
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .profile-form-group.full-width {
        grid-column: span 1;
    }

    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }

    .profile-form-actions {
        flex-direction: column;
    }

    .profile-save-btn,
    .profile-cancel-btn {
        width: 100%;
    }
}