/* ===============================================
   Page-Specific Styles for Dashboard
   Version: 1.2
   Methodology: BEM
   =============================================== */

/* --- Block: dashboard-section --- */
.dashboard-section {
    margin-bottom: 50px;
}

.dashboard-section:last-of-type {
    margin-bottom: 0;
}

.dashboard-section__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
}


/* --- Block: dashboard --- */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* --- Block: dashboard-card --- */
.dashboard-card {
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.dashboard-card__icon-container {
    background-color: var(--color-background-accent);
    border-radius: 50%;
    padding: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard-card__icon {
    width: 30px;
    height: 30px;
    color: var(--color-primary);
}

.dashboard-card__content {
    flex-grow: 1;
}

.dashboard-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.dashboard-card__value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.1;
    margin-bottom: 15px;
}

.dashboard-card__value-unit {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin-left: 5px;
}

/* ORACLE REFACTOR: Replaced with a more robust, responsive flexbox implementation. */
.dashboard-card__score-boost {
    font-size: 1.5rem; /* Base font size for the container */
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.1;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center; /* Horizontally center the items */
    gap: 0.5em; /* Add some space between elements */
    flex-wrap: nowrap; /* Prevent wrapping to new lines */
    white-space: nowrap; /* Ensure no wrapping */
}

.dashboard-card__score-boost--before {
    color: var(--color-text-light);
    text-decoration: none !important; /* Remove line-through, !important for override */
    font-size: 1.2rem; /* Slightly smaller font size */
}

.dashboard-card__score-boost--arrow {
    color: var(--color-success);
}

.dashboard-card__score-boost--after {
    color: var(--color-success);
}

.dashboard-card__plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
    margin-bottom: 20px;
}

.dashboard-card__plan-projection {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
}

.dashboard-card__plan-projection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-light);
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.dashboard-card__plan-projection-item:first-child {
    padding-top: 0;
}


.dashboard-card__plan-projection-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dashboard-card__plan-projection-item strong {
    color: var(--color-text);
    font-weight: 600;
    text-align: right;
}


/* Modifiers */
.dashboard-card--credit .dashboard-card__icon {
    color: var(--color-success);
}

.dashboard-card--plan .dashboard-card__icon {
    color: var(--color-secondary);
}

.dashboard-card--performance .dashboard-card__icon {
    color: #ff9800; /* Orange for performance */
}

.dashboard-card__projection-summary strong {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: 20px;
    line-height: 1.4;
    text-align: center; /* Center align the content */
}

.projection-summary-or {
    display: block; /* 'or' on its own line */
    font-style: italic;
}

@media (max-width: 500px) {
    .dashboard-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .dashboard-card__content .btn {
        width: 100%;
    }
    .dashboard-section__title {
        font-size: 1.5rem;
    }
    .dashboard-card__score-boost {
        font-size: 1.2rem; /* Reduce base font size for the container on small mobile */
    }
    .dashboard-card__score-boost--before {
        font-size: 1rem;
    }
    .dashboard-card__score-boost--after {
        font-size: 1.2rem;
    }
    .dashboard-card__plan-name {
        font-size: 1.3rem;
    }
    .dashboard-card__plan-projection-item {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
    .dashboard-card__plan-projection-item strong {
        text-align: center;
    }
}

/* --- Credit Refresh --- */
.credit-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: -10px; /* Pull it closer to the credit value */
    margin-bottom: 15px;
    height: 20px; /* Reserve space to prevent layout shift */
}

.credit-last-updated {
    font-size: 0.75rem;
    color: var(--color-text-light);
}

.refresh-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.refresh-btn:hover {
    color: var(--color-primary);
}

.refresh-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}