/* ===== REFINED LAYOUT v1 ===== */
/* ปรับ spacing, dividers, hierarchy สำหรับมืออาชีพ */

/* SECTION CONTAINER - เพิ่ม spacing และ dividers */
main > section {
    margin-bottom: 48px !important;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    position: relative;
}

main > section:last-child {
    border-bottom: none;
    margin-bottom: 24px;
}

/* SECTION TITLES - ให้โดดเด่นขึ้น */
.section-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin-bottom: 20px !important;
    margin-top: 0 !important;
    letter-spacing: 0.5px;
    color: var(--text) !important;
    text-transform: none;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* SECTION SUBTITLE/INFO - แสดงชัดเจนขึ้น */
main > section > p:nth-of-type(1) {
    font-size: 12px !important;
    color: var(--text-dim) !important;
    margin-bottom: 18px !important;
    margin-top: -8px;
    font-style: italic;
    letter-spacing: 0.3px;
}

/* CARD GRID - เพิ่ม gap และ visual separation */
.metric-grid {
    gap: 16px !important;
    margin-top: 16px !important;
}

.metric-grid > .card {
    padding: 18px !important;
    margin-bottom: 0 !important;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: linear-gradient(135deg, rgba(26, 33, 56, 0.5) 0%, rgba(21, 25, 44, 0.5) 100%);
    transition: all 0.25s ease;
}

.metric-grid > .card:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(26, 33, 56, 0.8) 0%, rgba(21, 25, 44, 0.8) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
}

/* CARD TITLES - ให้ชัดเจนขึ้น */
.metric-grid > .card h3 {
    font-size: 14px !important;
    font-weight: 700 !important;
    margin-bottom: 10px !important;
    line-height: 1.4;
    color: var(--text) !important;
}

/* CARD DESCRIPTIONS */
.metric-grid > .card p {
    font-size: 13px !important;
    line-height: 1.6;
    color: var(--text-light) !important;
    margin: 6px 0 !important;
}

/* HORIZONTAL GRID (Thailand News, Genre Trends, Social) */
.horizontal-grid {
    gap: 14px !important;
    margin-top: 16px !important;
}

.horizontal-grid > .card,
.horizontal-grid > .grid-item {
    padding: 16px !important;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: linear-gradient(135deg, rgba(26, 33, 56, 0.5) 0%, rgba(21, 25, 44, 0.5) 100%);
    transition: all 0.25s ease;
}

.horizontal-grid > .card:hover,
.horizontal-grid > .grid-item:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(26, 33, 56, 0.8) 0%, rgba(21, 25, 44, 0.8) 100%);
    transform: translateY(-2px);
}

/* GRID ITEMS (Genre Trends) */
.grid-item {
    padding: 18px !important;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(74, 222, 128, 0.2) !important;
}

.grid-item .item-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.grid-item .item-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

/* DATE BANNER - ให้ป้ายชัดเจน */
.card.flex-between {
    background: linear-gradient(135deg, rgba(26, 33, 56, 0.8) 0%, rgba(21, 25, 44, 0.8) 100%) !important;
    border: 1px solid var(--border-default) !important;
    padding: 16px !important;
    margin-bottom: 28px !important;
    border-radius: 10px;
}

/* AGENT TAG - ให้สีเด่นขึ้น */
.agent-tag {
    padding: 3px 10px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: inline-block;
    margin-right: 8px !important;
    vertical-align: middle;
}

/* PLATFORM BADGE - ให้เห็นชัดเจนขึ้น */
.platform-badge {
    display: inline-block;
    padding: 4px 10px !important;
    border-radius: 5px;
    font-size: 10px !important;
    font-weight: 700 !important;
    border: 1px solid;
    letter-spacing: 0.4px;
    margin-right: 6px !important;
}

/* DETAIL BUTTON */
.btn-detail {
    padding: 7px 14px !important;
    font-size: 11px !important;
    border-radius: 6px;
    font-weight: 700;
    margin-top: 12px !important;
    transition: all 0.2s ease;
}

.btn-detail:hover {
    transform: translateX(3px) !important;
}

/* ACTION ITEMS SECTION */
#action-plan > .card,
main > section > .card[style*="Action"] {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(26, 33, 56, 0.8) 100%) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    padding: 20px !important;
}

/* LIST ITEMS - ให้ spacing ดีขึ้น */
.card ul {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}

.card li {
    padding: 8px 0 !important;
    padding-left: 24px;
    position: relative;
    line-height: 1.6;
    font-size: 13px;
    color: var(--text-light);
}

.card li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* FADE IN ANIMATION */
.fade-in {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

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

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
    .section-title {
        font-size: 16px !important;
    }

    .metric-grid,
    .horizontal-grid {
        grid-template-columns: 1fr !important;
    }

    main > section {
        margin-bottom: 32px;
        padding-bottom: 20px;
    }
}

/* DIVIDER LINES - เพิ่มระหว่าง sections */
main > section:not(:first-child)::before {
    content: "";
    display: block;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    margin-bottom: -32px;
    margin-top: -32px;
    margin-bottom: 32px;
}
