/* ==========================================================================
   Modern Index Stylesheet - VRU Dormitory
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* Typography & Base Scoping */
.modern-index-scope {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #334155;
    line-height: 1.6;
}

.modern-index-scope h1,
.modern-index-scope h2,
.modern-index-scope h3,
.modern-index-scope h4,
.modern-index-scope h5,
.modern-index-scope h6 {
    font-family: 'Prompt', sans-serif;
    font-weight: 600;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */
.modern-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid #eef2f6;
    position: relative;
}

.modern-section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #2e7d32, #43a047);
    border-radius: 3px;
}

.modern-section-header .header-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modern-section-header .header-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.12);
}

.modern-section-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.2px;
}

.modern-section-header .header-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 2px 0 0 0;
}

/* ==========================================================================
   News Card List
   ========================================================================== */
.modern-news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.modern-news-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    display: flex;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modern-news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(46, 125, 50, 0.12);
    border-color: #81c784;
}

/* News Thumbnail Box */
.modern-news-thumb {
    position: relative;
    width: 250px;
    min-width: 250px;
    height: 180px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}

.modern-news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.modern-news-card:hover .modern-news-thumb img {
    transform: scale(1.06);
}

/* Modern Date Badge */
.modern-date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
    color: #ffffff;
    border-radius: 10px;
    padding: 6px 10px;
    text-align: center;
    min-width: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 2;
    backdrop-filter: blur(4px);
}

.modern-date-badge .date-day {
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.modern-date-badge .date-month {
    display: block;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    margin-top: 3px;
    opacity: 0.95;
}

/* News Content Box */
.modern-news-content {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

.modern-news-title {
    margin: 0 0 8px 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
}

.modern-news-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modern-news-title a:hover {
    color: #2e7d32;
}

/* Meta Information Badges */
.modern-news-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.modern-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    padding: 3px 8px;
    border-radius: 6px;
}

.modern-meta-item i {
    color: #94a3b8;
    font-size: 11px;
}

.modern-meta-attachment {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: #047857 !important;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.modern-meta-attachment i {
    color: #10b981 !important;
}

.modern-meta-attachment:hover {
    background: #d1fae5 !important;
    color: #065f46 !important;
}

/* News Description Text */
.modern-news-excerpt {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.55;
    margin: 0 0 14px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Area */
.modern-news-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: auto;
}

.modern-btn-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: #ffffff !important;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 30px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.25);
    text-decoration: none !important;
}

.modern-btn-readmore:hover {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.35);
    transform: translateX(3px);
    color: #ffffff !important;
}

/* View All News Button */
.modern-btn-all-news {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    color: #475569 !important;
    border-radius: 14px;
    padding: 13px 20px;
    font-size: 14.5px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none !important;
    margin-top: 10px;
    margin-bottom: 25px;
}

.modern-btn-all-news:hover {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.25);
}

/* ==========================================================================
   Sidebar: Modern Room Statistics Widget
   ========================================================================== */
.modern-stats-widget {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 30px;
    transition: box-shadow 0.3s ease;
}

.modern-stats-widget:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.modern-stats-header {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    color: #ffffff;
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}

.modern-stats-header::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.modern-stats-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modern-stats-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modern-stats-title-wrap i {
    font-size: 22px;
    color: #a5d6a7;
}

.modern-stats-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
}

.modern-stats-term-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
}

.modern-stats-body {
    padding: 18px;
}

/* Statistics Table */
.modern-stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 16px;
}

.modern-stats-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    padding: 10px 8px;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
}

.modern-stats-table th:first-child {
    text-align: left;
    padding-left: 12px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.modern-stats-table th:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.modern-stats-table td {
    padding: 11px 8px;
    font-size: 13px;
    color: #334155;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.modern-stats-table td:first-child {
    text-align: left;
    padding-left: 12px;
    font-weight: 500;
}

.modern-stats-table tbody tr:hover {
    background: #f8fafc;
}

.modern-stats-table tbody tr:last-child td {
    border-bottom: none;
}

/* Stat Pill Badges */
.stat-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12.5px;
    min-width: 44px;
    text-align: center;
}

.stat-pill-total {
    background: #f1f5f9;
    color: #334155;
}

.stat-pill-pending {
    background: #fef3c7;
    color: #b45309;
}

.stat-pill-paid {
    background: #dcfce7;
    color: #15803d;
}

.stat-pill-vacant {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(29, 78, 216, 0.15);
}

/* Quick Summary Box in Widget */
.modern-vacant-highlight {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modern-vacant-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #166534;
    font-size: 13px;
    font-weight: 600;
}

.modern-vacant-info i {
    font-size: 16px;
    color: #22c55e;
}

.modern-vacant-count {
    font-size: 18px;
    font-weight: 700;
    color: #15803d;
}

/* ==========================================================================
   Activity Gallery Section ("ภาพกิจกรรม")
   ========================================================================== */
.modern-gallery-section {
    margin-top: 20px;
    margin-bottom: 40px;
}

.modern-gallery-grid {
    margin-left: -10px;
    margin-right: -10px;
    list-style: none;
    padding: 0;
}

.modern-gallery-grid .list_item {
    padding: 10px;
    margin-bottom: 10px;
}

.modern-gallery-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    height: 200px;
}

.modern-gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
    border-color: #81c784;
}

.modern-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modern-gallery-card:hover .modern-gallery-img {
    transform: scale(1.08);
}

/* Gallery Hover Overlay */
.modern-gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20, 60, 25, 0.82) 0%, rgba(20, 60, 25, 0.4) 50%, rgba(0, 0, 0, 0.15) 100%);
    opacity: 0;
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.modern-gallery-card:hover .modern-gallery-overlay {
    opacity: 1;
}

/* Gallery Action Buttons */
.modern-gallery-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    color: #2e7d32 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    text-decoration: none !important;
    transform: scale(0.85);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modern-gallery-card:hover .modern-gallery-action-btn {
    transform: scale(1);
}

.modern-gallery-action-btn:hover {
    background: #2e7d32;
    color: #ffffff !important;
    transform: scale(1.15) !important;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 991px) {
    .modern-news-thumb {
        width: 210px;
        min-width: 210px;
        height: 165px;
    }
    
    .modern-news-title {
        font-size: 16px;
    }
}

@media (max-width: 767px) {
    .modern-news-card {
        flex-direction: column;
    }
    
    .modern-news-thumb {
        width: 100%;
        min-width: 100%;
        height: 200px;
    }
    
    .modern-news-content {
        padding: 16px;
    }
    
    .modern-stats-widget {
        margin-top: 20px;
    }
    
    .modern-gallery-card {
        height: 180px;
    }
}
