/* ===== Dashboard Header & Profile Dropdown Shared Styles ===== */
/* Include this file on all dashboard sub-pages for consistent header UI */

/* Top Bar Right Section */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-md, 1rem);
}

/* Net Worth Badge */
.net-worth-badge {
    background: linear-gradient(135deg, var(--success-500, #10B981) 0%, var(--success-600, #059669) 100%);
    color: white;
    padding: var(--space-sm, 0.5rem) var(--space-lg, 1.5rem);
    border-radius: var(--radius-full, 9999px);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.net-worth-badge .label {
    font-size: 0.75rem;
    opacity: 0.9;
}

.net-worth-badge .value {
    font-size: 1.125rem;
    font-weight: 700;
}

/* Icon Buttons */
.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 122, 33, 0.25);
    color: #FF7A21;
}

.logout-icon-btn {
    display: none;
}

/* User Menu & Avatar */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-md, 1rem);
    cursor: pointer;
    position: relative;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-500, #FF7A21);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
    transition: border-color 0.2s;
}

.user-avatar:hover {
    border-color: #FF7A21;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Profile Dropdown */
.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: white;
    border-radius: var(--radius-xl, 1rem);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 2px 10px rgba(0,0,0,0.08);
    z-index: 9999;
    overflow: hidden;
    animation: dropdownSlide 0.2s ease;
}

.profile-dropdown.show {
    display: block;
}

@keyframes dropdownSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-dropdown-header {
    background: linear-gradient(135deg, var(--primary-600, #0B1F3B) 0%, #1a365d 100%);
    padding: var(--space-lg, 1.5rem);
    text-align: center;
    color: white;
}

.profile-dropdown-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-500, #FF7A21);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto var(--space-sm, 0.5rem);
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.3);
}

.profile-dropdown-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-dropdown-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.profile-dropdown-email {
    font-size: 0.8rem;
    opacity: 0.85;
}

.profile-dropdown-body {
    padding: var(--space-md, 1rem);
}

.profile-detail-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 0.5rem);
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    font-size: 0.85rem;
    color: var(--gray-700, #374151);
    border-radius: var(--radius-md, 0.5rem);
}

.profile-detail-row i {
    width: 18px;
    color: var(--primary-500, #3B82F6);
    font-size: 0.85rem;
}

.profile-detail-row .detail-label {
    color: var(--gray-500, #6B7280);
    min-width: 70px;
}

.profile-detail-row .detail-value {
    font-weight: 600;
    color: var(--gray-800, #1F2937);
}

.profile-dropdown-divider {
    height: 1px;
    background: var(--gray-200, #E5E7EB);
    margin: var(--space-sm, 0.5rem) var(--space-md, 1rem);
}

.profile-dropdown-actions {
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem) var(--space-md, 1rem);
}

.profile-action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 0.5rem);
    width: 100%;
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    border: none;
    background: none;
    color: var(--gray-700, #374151);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-md, 0.5rem);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
}

.profile-action-btn:hover {
    background: var(--gray-100, #F3F4F6);
    color: var(--gray-900, #111827);
}

.profile-action-btn.danger:hover {
    background: var(--danger-50, #FEF2F2);
    color: var(--danger-600, #DC2626);
}

.profile-action-btn i {
    width: 18px;
    font-size: 0.85rem;
}

/* Change Password Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: var(--radius-xl, 1rem);
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: dropdownSlide 0.25s ease;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-600, #0B1F3B) 0%, #1a365d 100%);
    padding: var(--space-lg, 1.5rem);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.modal-body {
    padding: var(--space-xl, 2rem);
}

.modal-body .form-group {
    margin-bottom: var(--space-md, 1rem);
}

.modal-body label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700, #374151);
    margin-bottom: var(--space-xs, 0.25rem);
}

.modal-body input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300, #D1D5DB);
    border-radius: var(--radius-md, 0.5rem);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.modal-body input:focus {
    outline: none;
    border-color: var(--primary-500, #3B82F6);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.modal-footer {
    padding: 0 var(--space-xl, 2rem) var(--space-xl, 2rem);
    display: flex;
    gap: var(--space-sm, 0.5rem);
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md, 0.5rem);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--gray-300, #D1D5DB);
    background: white;
    color: var(--gray-700, #374151);
    font-family: inherit;
    transition: all 0.2s;
}

.modal-btn:hover {
    background: var(--gray-100, #F3F4F6);
}

.modal-btn.primary {
    background: var(--primary-600, #0B1F3B);
    color: white;
    border-color: var(--primary-600, #0B1F3B);
}

.modal-btn.primary:hover {
    background: var(--primary-700, #1a365d);
}

.modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.password-msg {
    font-size: 0.8rem;
    margin-top: var(--space-sm, 0.5rem);
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    border-radius: var(--radius-md, 0.5rem);
    display: none;
}

.password-msg.success {
    display: block;
    background: var(--success-50, #ECFDF5);
    color: var(--success-700, #047857);
    border: 1px solid var(--success-200, #A7F3D0);
}

.password-msg.error {
    display: block;
    background: var(--danger-50, #FEF2F2);
    color: var(--danger-600, #DC2626);
    border: 1px solid var(--danger-200, #FECACA);
}

/* Nav Logout item */
.nav-logout { }

/* ===== Responsive — Tablet (≤1024px) ===== */
@media (max-width: 1024px) {
    .net-worth-badge {
        padding: var(--space-xs, 0.25rem) var(--space-md, 1rem);
    }
    .net-worth-badge .label {
        font-size: 0.65rem;
    }
    .net-worth-badge .value {
        font-size: 0.95rem;
    }
}

/* ===== Responsive — Mobile (≤768px) ===== */
@media (max-width: 768px) {
    .net-worth-badge {
        display: none;
    }
    .icon-btn {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
    .logout-icon-btn {
        display: inline-flex;
    }
    .nav-logout {
        display: none;
    }
    .user-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
    .profile-dropdown {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 360px;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: var(--radius-xl, 1rem);
    }
}

/* ===== Responsive — Small Phones (≤480px) ===== */
@media (max-width: 480px) {
    .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}
