/* === Types Page Styles === */

.types-hero {
    text-align: center;
    padding-bottom: 40px;
}

.types-hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

.types-sub-title {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-main);
    font-weight: 800;
}

/* --- Matrix Section --- */
.types-matrix-section {
    padding-top: 0;
    padding-bottom: 40px;
}

.types-matrix-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.types-matrix-wrapper {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    padding: 25px;
}

.types-matrix-wrapper .matrix-grid {
    aspect-ratio: 1 / 1;
}

.types-matrix-wrapper .matrix-cell {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.75rem;
    padding: 4px;
}

.types-matrix-wrapper .matrix-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    z-index: 10;
    border-radius: 6px;
}

/* --- Zone Legend --- */
.types-zone-legend {
    padding-top: 0;
    padding-bottom: 40px;
}

.zone-legend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.zone-legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.zone-legend-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.zone-legend-link:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 200, 83, 0.35);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.zone-legend-link:focus-visible {
    outline: 3px solid rgba(0, 200, 83, 0.35);
    outline-offset: 2px;
}

.zone-legend-item p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.zone-legend-item strong {
    font-size: 0.95rem;
}

.zone-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Loading --- */
.types-loading {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.types-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E0E0E0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

/* --- Zone Section Headers --- */
.zone-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 16px;
    margin-top: 16px;
    scroll-margin-top: 110px;
}

.zone-section-header:first-child {
    margin-top: 0;
}

.zone-section-header.zone-1 { background: linear-gradient(135deg, rgba(76,175,80,0.12), rgba(76,175,80,0.04)); }
.zone-section-header.zone-2 { background: linear-gradient(135deg, rgba(174,213,129,0.15), rgba(174,213,129,0.04)); }
.zone-section-header.zone-3 { background: linear-gradient(135deg, rgba(255,241,118,0.15), rgba(255,241,118,0.04)); }
.zone-section-header.zone-4 { background: linear-gradient(135deg, rgba(255,171,145,0.15), rgba(255,171,145,0.04)); }

.zone-section-header .zone-dot {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.zone-section-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

.zone-section-header p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Type Detail Cards --- */
.types-detail-section {
    padding-top: 20px;
}

#types-detail-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.type-detail-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--glass-shadow);
    scroll-margin-top: 100px;
    transition: box-shadow 0.3s ease;
}

.type-detail-card:target,
.type-detail-card.highlighted {
    box-shadow: 0 0 0 3px var(--primary-color), var(--glass-shadow);
}

.type-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.type-detail-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}

.type-detail-number.zone-1 { background: var(--zone-top); }
.type-detail-number.zone-2 { background: var(--zone-teach); color: var(--text-main); }
.type-detail-number.zone-3 { background: var(--zone-intervene); color: var(--text-main); }
.type-detail-number.zone-4 { background: var(--zone-risk); color: var(--text-main); }

.type-detail-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.type-detail-zone-badge {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.type-detail-zone-badge.zone-1 { background: #E8F5E9; color: #2E7D32; }
.type-detail-zone-badge.zone-2 { background: #F1F8E9; color: #558B2F; }
.type-detail-zone-badge.zone-3 { background: #FFFDE7; color: #F57F17; }
.type-detail-zone-badge.zone-4 { background: #FBE9E7; color: #D84315; }

.type-detail-position {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 20px;
}

.type-detail-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.type-detail-desc {
    background: #F9FBE7;
    border-radius: 12px;
    padding: 20px 24px;
}

.type-detail-desc h4 {
    margin: 0 0 8px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.type-detail-desc p {
    margin: 0;
    line-height: 1.7;
    color: var(--text-main);
}

.type-detail-advice {
    background: #FFFDE7;
    border-radius: 12px;
    padding: 20px 24px;
}

.type-detail-advice h4 {
    margin: 0 0 8px;
    color: #F9A825;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.type-detail-advice p {
    margin: 0;
    line-height: 1.7;
    color: var(--text-main);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .types-matrix-wrapper {
        max-width: 100%;
        padding: 20px 15px;
    }

    .types-matrix-wrapper .matrix-cell {
        font-size: 0.6rem;
    }

    .type-detail-card {
        padding: 24px 20px;
    }

    .type-detail-name {
        font-size: 1.3rem;
    }

    .zone-legend-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .zone-legend-grid {
        grid-template-columns: 1fr;
    }

    .types-matrix-wrapper .matrix-cell {
        font-size: 0.55rem;
    }

    .zone-section-header {
        padding: 16px 18px;
    }

    .zone-section-header h3 {
        font-size: 1.05rem;
    }
}
