/* =========================================
   Feature 23: Resources Modal Styles
   (Matched to Standalone Test File)
   ========================================= */

:root {
    --modal-width: 1000px;
    --res-glass-border: rgba(255, 255, 255, 0.08);
    --res-accent-blue: #38bdf8;
    --res-accent-green: #4ade80;
    --res-accent-red: #ef4444;
}

/* --- OVERLAY (Blur Zoom Effect) --- */
#resources-modal.modal-overlay {
    display: none; 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0); 
    backdrop-filter: blur(0);
    z-index: 3000; /* Highest priority */
    justify-content: center;
    align-items: center;
    transition: background 0.4s ease, backdrop-filter 0.4s ease;
    perspective: 1500px;
}

#resources-modal.active { 
    display: flex;
    background: rgba(15, 23, 42, 0.75); 
    backdrop-filter: blur(5px);
}

/* --- CONTENT --- */
#resources-modal .modal-content {
    width: var(--modal-width);
    max-width: 95vw;
    height: 85vh; 
    background: #1e293b;
    border: 1px solid var(--res-glass-border);
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
    border-top: 2px solid var(--brand-yellow);
    display: flex; 
    flex-direction: column;
    overflow: hidden;
    
    /* Animation Start State */
    opacity: 0;
    transform: scale(1.1);
    filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#resources-modal.active .modal-content {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* --- HEADER --- */
#resources-modal .modal-header {
    padding: 20px 25px 0 25px;
    border-bottom: 1px solid var(--res-glass-border);
    flex-shrink: 0;
    background: transparent;
    /* Reverted to Block layout to match Test File and fix alignment */
    display: block; 
}

.header-top {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px;
    width: 100%; 
}

.modal-title { margin: 0; font-size: 22px; color: #fff; display: flex; gap: 10px; align-items: center; }
.modal-title i { color: var(--brand-yellow); }

.close-modal { color: #94a3b8; font-size: 24px; cursor: pointer; transition: 0.2s; }
.close-modal:hover { color: #fff; transform: scale(1.1); }

/* --- TABS --- */
.tabs-nav {
    display: flex; 
    gap: 30px; 
    /* Removed padding to ensure Left Alignment with Title */
    padding: 0; 
    overflow-x: auto;
}

.tab-btn {
    background: transparent; border: none; color: #94a3b8;
    font-size: 14px; font-weight: 600; padding-bottom: 12px;
    cursor: pointer; position: relative; text-transform: uppercase;
    letter-spacing: 0.5px; white-space: nowrap; transition: 0.2s;
}
.tab-btn:hover { color: #fff; }
.tab-btn.active { color: var(--brand-yellow); }

/* Active Indicator */
.tab-btn.active::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px;
    background: var(--brand-yellow);
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.4);
}

/* --- BODY --- */
#resources-modal .modal-body {
    flex: 1; padding: 25px; overflow-y: auto; background: rgba(0,0,0,0.1);
}

.tab-pane { display: none; animation: fadeIn 0.4s ease; }
.tab-pane.active { display: block; }

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

/* --- SECTIONS & TYPOGRAPHY --- */
h3 { 
    color: #fff; font-size: 18px; margin-top: 0; margin-bottom: 10px; 
    border-left: 3px solid var(--res-accent-blue); padding-left: 10px; 
}
h4 { 
    color: #94a3b8; font-size: 13px; font-weight: 400; margin-top: 0; margin-bottom: 20px; 
    font-style: italic; line-height: 1.5;
}

.resource-section { margin-bottom: 30px; }

/* Lists */
.resource-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.resource-list li {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--res-glass-border);
    border-radius: 6px;
    padding: 12px 15px;
    display: flex; flex-direction: column; gap: 4px;
}
.resource-list li strong { color: #fff; font-size: 14px; display: block; }
.resource-list li span { color: #94a3b8; font-size: 12px; }
.lift-val { color: var(--brand-yellow); font-weight: 700; }

/* Grid for Cards */
.resource-table-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px;
}

/* Pattern Cards (Tab 2) */
.pattern-card {
    background: rgba(0,0,0,0.2); 
    border: 1px solid var(--res-glass-border); 
    border-radius: 12px; 
    padding: 15px;
    display: flex; flex-direction: column;
}
.pattern-card h4 { color: #f1f5f9; font-weight: 700; margin-bottom: 5px; font-style: normal; font-size: 14px; }

.pattern-card.low { border-top: 3px solid #64748b; }
.pattern-card.med { border-top: 3px solid var(--res-accent-blue); }
.pattern-card.high { border-top: 3px solid var(--brand-yellow); }

.resource-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.resource-table th { 
    text-align: left; padding: 8px 10px; color: #94a3b8; font-size: 11px; text-transform: uppercase; 
    border-bottom: 1px solid var(--res-glass-border); background: rgba(0,0,0,0.2);
}
.resource-table td { padding: 6px 10px; border-bottom: 1px solid var(--res-glass-border); color: #fff; }
.resource-table tr:last-child td { border-bottom: none; }
.resource-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Monthly Chart (Tab 3) */
.month-chart {
    display: flex; flex-direction: column; gap: 12px; padding: 10px;
    background: rgba(0,0,0,0.2); border-radius: 12px; border: 1px solid var(--res-glass-border);
}
.month-row { display: flex; align-items: center; gap: 15px; height: 28px; }
.month-label { width: 40px; font-size: 13px; font-weight: 700; color: #94a3b8; text-align: right; }
.bar-area { flex: 1; background: rgba(255,255,255,0.05); height: 8px; border-radius: 4px; overflow: hidden; display: flex; align-items: center; }
.bar-fill { height: 100%; border-radius: 4px; }
.month-val { width: 50px; text-align: right; font-family: 'Segoe UI', monospace; font-size: 13px; color: #fff; font-weight: 600; }

.bar-high { background: var(--brand-yellow); box-shadow: 0 0 10px rgba(255, 204, 0, 0.4); }
.bar-med { background: var(--res-accent-blue); }
.bar-low { background: #64748b; }

/* Glossary (Tab 4) */
.resource-dl { display: grid; gap: 10px; }
.glossary-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--res-glass-border);
    border-radius: 8px;
    padding: 12px 15px;
}
.resource-dl dt {
    color: var(--brand-yellow); font-weight: 700; font-size: 14px;
    margin-bottom: 4px; display: block;
}
.resource-dl dd {
    margin: 0; color: #cbd5e1; font-size: 13px; line-height: 1.5; opacity: 0.9;
}