/* ============================================
   DASHBOARD STYLES
   Financial dashboard overlay and popups
   ============================================ */

/* Dashboard Toggle Button */
.dashboard-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 15px;
}

.dashboard-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.6);
}

.dashboard-toggle-btn .dashboard-icon {
    font-size: 20px;
}

/* Dashboard Overlay */
.dashboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dashboard-container {
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 30px;
    position: relative;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.dashboard-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dashboard-close-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: rotate(90deg);
}

.dashboard-title {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Dashboard Content Layout */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.dashboard-top-row {
    display: flex;
    gap: 25px;
}

/* Dashboard Cards */
.dashboard-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
}

/* Overview Card */
.overview-card {
    flex: 1;
    display: flex;
    gap: 20px;
}

.overview-avatar {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

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

.overview-avatar .avatar-fallback {
    font-size: 48px;
}

.overview-details {
    flex: 1;
}

.overview-details h3 {
    color: #fff;
    font-size: 22px;
    margin-bottom: 10px;
}

.overview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    color: #b8c5d6;
    font-size: 14px;
}

.overview-row .label {
    color: #8892a0;
}

.overview-row .value {
    font-weight: 600;
    color: #fff;
}

.overview-row .value.money {
    color: #2ecc71;
}

.overview-row.highlight .value {
    color: #f39c12;
    font-weight: 700;
}

.overview-row.debt .value {
    color: #e74c3c;
}

.overview-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

/* Goals Card */
.goals-card {
    flex: 0.8;
    min-width: 280px;
}

.goals-card h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 15px;
}

.goals-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.goal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.goal-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.goal-icon {
    font-size: 20px;
}

.goal-text {
    color: #e0e6ed;
    font-size: 14px;
}

.goal-item.completed .goal-text {
    text-decoration: line-through;
    color: #2ecc71;
}

/* Dashboard Action Cards */
.dashboard-bottom-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.dashboard-action-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-action-card:hover {
    background: rgba(52, 152, 219, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.dashboard-action-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashboard-action-card.disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.action-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.action-label {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

/* ============================================
   POPUP STYLES (Shared)
   ============================================ */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.popup-container {
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: linear-gradient(145deg, #1e2a3a, #1a2332);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    padding: 35px;
    position: relative;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

.popup-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-close-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: rotate(90deg);
}

.popup-container h2 {
    color: #fff;
    font-size: 26px;
    margin-bottom: 8px;
    text-align: center;
}

.popup-subtitle {
    color: #8892a0;
    text-align: center;
    margin-bottom: 25px;
}

/* ============================================
   SALARY & TAXES (Pay Stubs)
   ============================================ */

.paystubs-container {
    max-height: 400px;
    overflow-y: auto;
}

.paystub {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.paystub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.paystub-date {
    color: #8892a0;
    font-size: 14px;
}

.paystub-net {
    color: #2ecc71;
    font-size: 20px;
    font-weight: 700;
}

.paystub-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    color: #b8c5d6;
    font-size: 14px;
}

.paystub-row.deduction .value {
    color: #e74c3c;
}

.no-paystubs {
    color: #8892a0;
    text-align: center;
    padding: 40px;
}

.paystub-info {
    color: #b8c5d6;
    text-align: center;
    margin-bottom: 15px;
}

.paystub-note {
    color: #f39c12;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

/* ============================================
   INVESTMENTS POPUP
   ============================================ */

.investment-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.investment-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.investment-card:hover:not(.disabled) {
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.investment-card.disabled {
    opacity: 0.5;
}

.invest-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.investment-card h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 10px;
}

.invest-description {
    color: #8892a0;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.investment-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}

/* ============================================
   DEBT POPUP
   ============================================ */

.debt-summary {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.debt-stat {
    text-align: center;
}

.stat-label {
    display: block;
    color: #8892a0;
    font-size: 12px;
    margin-bottom: 5px;
}

.stat-value {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

.debt-list {
    max-height: 350px;
    overflow-y: auto;
}

.debt-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.debt-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.debt-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.debt-balance {
    color: #e74c3c;
    font-size: 18px;
    font-weight: 700;
}

.debt-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #8892a0;
    font-size: 13px;
}

.debt-payment-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.debt-payment-control label {
    color: #b8c5d6;
    font-size: 14px;
}

.debt-payment-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.debt-payment-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.debt-payment-value {
    color: #2ecc71;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.no-debt {
    color: #2ecc71;
    text-align: center;
    padding: 40px;
    font-size: 16px;
}

/* ============================================
   SAVINGS POPUP
   ============================================ */

.savings-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.savings-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.savings-card h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 8px;
}

.savings-rate {
    color: #2ecc71;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.savings-card p {
    color: #8892a0;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 15px;
}

.savings-input {
    margin-bottom: 15px;
}

.savings-input label {
    display: block;
    color: #b8c5d6;
    font-size: 12px;
    margin-bottom: 5px;
}

.savings-input input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
}

.savings-input input:focus {
    outline: none;
    border-color: #3498db;
}

.savings-card .btn-primary {
    width: 100%;
    padding: 10px;
    font-size: 13px;
}

.current-savings {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
}

.current-savings h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 15px;
}

.no-savings {
    color: #8892a0;
    text-align: center;
    padding: 20px;
}

.savings-account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
}

.savings-account-name {
    color: #fff;
    font-weight: 500;
}

.savings-account-balance {
    color: #2ecc71;
    font-weight: 600;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 900px) {
    .dashboard-top-row {
        flex-direction: column;
    }

    .dashboard-bottom-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .investment-options,
    .savings-options {
        grid-template-columns: 1fr;
    }

    .overview-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .overview-avatar {
        margin-bottom: 15px;
    }
}

/* Return to Simulation button style */
.btn-start-sim.return-mode {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.btn-start-sim.return-mode:hover {
    background: linear-gradient(135deg, #219a52, #27ae60);
}

@media (max-width: 600px) {
    .dashboard-bottom-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-container,
    .popup-container {
        padding: 20px;
        margin: 10px;
    }

    .debt-summary {
        flex-direction: column;
        gap: 15px;
    }
}

/* ============================================
   AVATAR DROPDOWN MENU
   ============================================ */

.avatar-profile {
    position: relative;
}

.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

.avatar-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

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

.avatar-circle .avatar-fallback {
    font-size: 20px;
}

.avatar-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 220px;
    background: linear-gradient(145deg, #1e2a3a, #1a2332);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.avatar-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-header .user-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #b8c5d6;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #fff;
}

.dropdown-item.coins {
    justify-content: space-between;
    background: rgba(255, 193, 7, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item.coins:hover {
    background: rgba(255, 193, 7, 0.2);
}

.dropdown-item .coin-icon {
    font-size: 18px;
}

.dropdown-item .coin-balance {
    color: #f1c40f;
    font-weight: 700;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

.dropdown-item.logout {
    color: #e74c3c;
}

.dropdown-item.logout:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #ff6b6b;
}

/* ============================================
   MAP VIEW TOGGLE (Settings)
   ============================================ */

.map-view-toggle {
    display: flex;
    gap: 10px;
}

.map-view-btn {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #b8c5d6;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.map-view-btn:hover {
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.5);
}

.map-view-btn.active {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    color: #fff;
}

.map-view-btn .view-icon {
    font-size: 24px;
    font-weight: 700;
}

.map-view-btn span:last-child {
    font-size: 12px;
}
