/* ========================================
   HOMEPAGE DASHBOARD STYLES (Clean UI)
   File: assets/css/home.css
   ======================================== */

/* 1. UTILS & CONTAINER */
.home-container {
    max-width: var(--portal-container, 1200px);
    margin: 0 auto;
    padding: 0 24px;
}

.home-section-title {
    font-size: 1.3rem;
    color: var(--portal-secondary);
    font-weight: 700;
    margin-bottom: 20px;
}

.home-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.home-see-all {
    font-size: 0.9rem;
    color: var(--portal-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: gap 0.3s ease;
}
.home-see-all:hover { gap: 10px; }

/* 2. DASHBOARD HEADER (Greeting + Quick Actions) */
.home-dash-header {
    background-color: var(--portal-bg);
    padding: 32px 0 24px;
}

/* Greeting Row */
.home-greeting-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}

.home-greeting-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--portal-secondary);
    margin: 0 0 6px 0;
}

.home-greeting-sub {
    font-size: 0.95rem;
    color: var(--portal-text-muted);
    margin: 0;
}

.home-greeting-icon {
    width: 44px;
    height: 44px;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--portal-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.home-greeting-icon:hover {
    color: var(--portal-primary);
    border-color: var(--portal-primary);
    transform: translateY(-2px);
}

/* Quick Actions (Aksi Cepat) */
.home-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 700px;
}

.home-quick-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.home-quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: var(--portal-primary);
}

.home-quick-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.home-quick-icon.blue { background: #eff6ff; color: var(--portal-primary); }
.home-quick-icon.green { background: #f0fdf4; color: #16a34a; }

.home-quick-text {
    display: flex;
    flex-direction: column;
}
.home-quick-text span {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--portal-secondary);
    margin-bottom: 3px;
}
.home-quick-text small {
    font-size: 0.8rem;
    color: var(--portal-text-muted);
    font-weight: 400;
}

/* 3. MAIN DASHBOARD GRID (Layanan & Informasi) */
.home-dashboard {
    padding: 32px 0;
    background-color: var(--portal-bg);
}

.home-dash-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Kolom di Desktop */
    gap: 16px;
}

.home-dash-card {
    background: var(--portal-surface);
    padding: 24px 20px;
    border-radius: 16px;
    border: 1px solid var(--portal-border);
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.home-dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: var(--portal-primary);
}

.home-dash-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.home-dash-icon.blue { background: #eff6ff; color: var(--portal-primary); }
.home-dash-icon.green { background: #f0fdf4; color: #16a34a; }
.home-dash-icon.orange { background: #fff7ed; color: #ea580c; }
.home-dash-icon.purple { background: #faf5ff; color: #9333ea; }

.home-dash-info h3 { font-size: 1rem; font-weight: 700; color: var(--portal-secondary); margin-bottom: 4px; }
.home-dash-info p { font-size: 0.85rem; color: var(--portal-text-muted); line-height: 1.4; margin: 0; }

/* 4. PENGUMUMAN TERKINI (Compact List + Modal) */
.home-news {
    padding: 0 0 60px;
    background-color: var(--portal-bg);
}

/* Compact List Styles */
.home-news-compact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-news-compact-card {
    background: var(--portal-surface);
    border-radius: 12px;
    border: 1px solid var(--portal-border);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.home-news-compact-card:hover {
    border-color: var(--portal-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.home-news-compact-icon {
    width: 44px;
    height: 44px;
    background: #eff6ff;
    color: var(--portal-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.home-news-compact-body {
    flex: 1;
    min-width: 0;
}

.home-news-compact-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.home-news-compact-body h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--portal-secondary);
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.home-news-compact-body p {
    font-size: 0.85rem;
    color: var(--portal-text-muted);
    line-height: 1.5;
    margin: 0 0 10px 0;
}

.home-news-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #eff6ff;
    color: var(--portal-primary);
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.home-news-detail-btn:hover {
    background: var(--portal-primary);
    color: white;
}

/* Modal Styles */
.home-news-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.home-news-modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.home-news-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

.home-news-modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--portal-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    z-index: 10;
}

.home-news-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--portal-secondary);
    margin: 0 0 8px 0;
    line-height: 1.4;
    flex: 1;
}

.home-news-modal-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--portal-text-muted);
    font-weight: 600;
}

.home-news-modal-date i {
    color: var(--portal-primary);
}

.home-news-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.home-news-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.home-news-modal-body {
    padding: 24px;
}

.home-news-modal-body p {
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.7;
    margin: 0 0 12px 0;
}

.home-news-modal-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    background: #eff6ff;
    color: var(--portal-primary);
    margin-bottom: 12px;
}

/* ========================================
   5. RESPONSIVE MOBILE
   ======================================== */
@media (max-width: 768px) {
    .home-container { padding: 0 16px; }

    /* Header & Greeting */
    .home-dash-header { padding: 20px 0 12px; }
    .home-greeting-title { font-size: 1.3rem; }
    .home-greeting-sub { font-size: 0.8rem; }
    .home-greeting-icon { width: 40px; height: 40px; font-size: 1.1rem; }

    /* Quick Actions: Tetap 2 kolom, compact */
    .home-quick-actions { 
        grid-template-columns: 1fr 1fr; 
        gap: 10px; 
        max-width: 100%;
    }
    .home-quick-card { padding: 12px; gap: 10px; }
    .home-quick-icon { width: 38px; height: 38px; font-size: 1rem; }
    .home-quick-text span { font-size: 0.8rem; }
    .home-quick-text small { font-size: 0.65rem; }

    /* Main Grid: 2 Kolom di HP */
    .home-dashboard { padding: 20px 0; }
    .home-dash-grid { 
        grid-template-columns: 1fr 1fr; 
        gap: 10px; 
    }
    .home-dash-card {
        flex-direction: column; 
        align-items: center; 
        text-align: center;
        padding: 14px 10px; 
        gap: 8px;
    }
    .home-dash-icon { width: 38px; height: 38px; font-size: 1rem; }
    .home-dash-info h3 { font-size: 0.8rem; }
    .home-dash-info p { display: none; }

    /* News Compact List */
    .home-news { padding: 0 0 40px; }
    .home-news-compact-list { gap: 10px; }
    .home-news-compact-card { 
        flex-direction: column; 
        gap: 12px;
        padding: 14px 16px;
    }
    .home-news-compact-icon { 
        width: 40px; 
        height: 40px; 
        font-size: 1rem;
    }
    .home-news-compact-body h3 { font-size: 0.9rem; }
    .home-news-compact-body p { font-size: 0.8rem; }
    .home-section-title { font-size: 1.1rem; }
    
    /* Modal di HP */
    .home-news-modal-content {
        max-height: 90vh;
        margin: 10px;
    }
    .home-news-modal-header {
        padding: 20px 20px 12px 20px;
    }
    .home-news-modal-title {
        font-size: 1.05rem;
    }
    .home-news-modal-body {
        padding: 20px;
    }
}

@media (max-width: 380px) {
    .home-greeting-title { font-size: 1.2rem; }
    .home-quick-text span { font-size: 0.75rem; }
    .home-news-compact-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
}