/* ----- General Styling for Detail Pages ----- */
:root {
    --primary-color: #2a9d8f;
    --secondary-color: #e9c46a;
    --background-color: #f8f9fa;
    --text-color: #333;
    --card-bg-color: #ffffff;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ----- Header Styling ----- */
.detail-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

.back-button {
    position: absolute;
    top: 0;
    left: 0;
    text-decoration: none;
    background: #f1f1f1;
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #e0e0e0;
    transform: translateX(-5px);
}

.header-content {
    margin-top: 50px; /* Space for the back button */
}

.header-icon {
    font-size: 4em;
    line-height: 1;
    margin-bottom: 15px;
}

.detail-header h1 {
    font-size: 2.8em;
    margin: 0;
}

.subtitle {
    font-size: 1.1em;
    max-width: 700px;
    margin: 10px auto 0 auto;
    color: #666;
}

/* ----- Main Grid Layout ----- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

/* ----- Card Styling ----- */
.detail-card {
    background-color: var(--card-bg-color);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.detail-card h3 {
    margin-top: 0;
    font-size: 1.5em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.data-item:last-child {
    border-bottom: none;
}

.data-item span:first-child {
    color: #555;
}

.data-value {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--primary-color);
}

/* ----- Chart Card Specifics ----- */
.chart-card {
    display: flex;
    flex-direction: column;
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px; /* Ensure space for chart */
    flex-grow: 1;
}

/* ----- Footer Styling ----- */
.detail-footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    color: #888;
}

/* ----- Responsive Design ----- */
@media (max-width: 768px) {
    .detail-container {
        padding: 20px 15px;
    }

    .back-button {
        position: static;
        display: inline-block;
        margin-bottom: 20px;
    }

    .header-content {
        margin-top: 0;
    }

    .detail-header h1 {
        font-size: 2em;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .data-item {
        font-size: 1em;
    }

    .data-value {
        font-size: 1.1em;
    }
}
