/* Budget Page Styles */

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logo-link {
    text-decoration: none;
}

.header .logo {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.2s;
}

.nav a:hover {
    color: var(--text);
}

.nav a.active {
    background: var(--accent);
    color: var(--text);
}

/* Budget Hero */
.budget-hero {
    text-align: center;
    padding: 1rem 0 2rem;
}

.total-display {
    margin-top: 1.5rem;
}

.total-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
}

.total-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Agency List */
.agency-section {
    margin-bottom: 2rem;
}

.agency-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agency-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.agency-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.agency-info {
    min-width: 0;
}

.agency-name {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agency-abbr {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.agency-stats {
    text-align: right;
}

.agency-share {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.agency-pct {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Progress bar */
.agency-bar {
    grid-column: 1 / -1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.agency-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Loading */
.loading-indicator {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-right: 2rem;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-stat {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.modal-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
}

.modal-stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

.modal-subtitle {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.sub-agency-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sub-agency-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 8px;
}

.sub-agency-name {
    font-size: 0.8rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 1rem;
}

.sub-agency-share {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .total-amount {
        font-size: 2.25rem;
    }
    
    .agency-name {
        font-size: 0.8rem;
    }
    
    .agency-share {
        font-size: 0.9rem;
    }
}
