/* style.css - Complete Consolidated Version */

/* 1. Variables & Global Styles */
:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #333;
    --text-muted: #666;
    --border-color: #dfe6e9;
    /* Rating Colors */
    --color-a: #27ae60;
    --color-b: #2ecc71;
    --color-c: #f1c40f;
    --color-d: #e67e22;
    --color-f: #e74c3c;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
}

/* 2. Header & Navigation */
header {
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 1.5rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

span.tClass {
    font-size: 0.8em;
}

.linkheader {
    background-color: #34495e;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    color: #fff;
}

.headerlink {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s;
}

.headerlink:hover {
    color: #fff;
}

/* 3. Search Form Styles */
#filter-form {
    max-width: 800px;
    margin: 30px auto;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

label {
    display: block;
    margin-bottom: 5px;
}

label.il {
    display: inline;
}

input, select {
    margin-block-start: 0.25em;
    margin-block-end: 0.5em;
}

/* 4. Results Grid & Video Cards */
#resultsDiv {
    max-width: 1100px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 0 20px;
}

.video-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.video-title {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--accent-color);
    text-decoration: none;
    margin-bottom: 8px;
    display: block;
}

.video-meta {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* 5. Components: Tags, Badges & Expanders */
.topics-list {
    margin: 10px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.topic-tag {
    background: #edf2f7;
    font-size: 0.72em;
    padding: 3px 10px;
    border-radius: 20px;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

.rating-row {
    font-size: 0.9em;
    margin: 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.badge {
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: bold;
    color: white;
    font-size: 0.8em;
}

.rating-A { background-color: var(--color-a); }
.rating-B { background-color: var(--color-b); }
.rating-C { background-color: var(--color-c); }
.rating-D { background-color: var(--color-d); }
.rating-F { background-color: var(--color-f); }
.rating-NA { background-color: #bdc3c7; }

.expander-btn {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-size: 0.85em;
    margin-top: 15px;
    width: 100%;
}

.cases-content {
    background: #fdfdfd;
    padding: 10px;
    margin-top: 5px;
    border-radius: 6px;
    font-size: 0.85em;
    border: 1px dashed var(--border-color);
}

/* 6. Stats View (Original Table Styling) */
.statsDiv {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.ratingsTable table, .countsTable table {
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ratingsTable th, .countsTable td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.ratingsTable th {
    background: #f8f9fa;
    text-align: left;
}

.ratingsTable td {
    text-align: right;
    padding: 12px 15px;
}

/* 7. Footer */
footer {
    background-color: var(--primary-color);
    color: #bdc3c7;
    text-align: center;
    padding: 2rem;
    margin-top: 50px;
    font-size: 0.85em;
}

.content-container {
    max-width: 800px; /* Limits width for readability */
    margin: 40px auto; /* Centers the block and adds top/bottom spacing */
    padding: 0 20px;   /* Prevents text from touching the screen edges on mobile */
}

.content-container ul {
    margin-top: 15px;
    padding-left: 25px; /* Ensures bullets are indented properly */
}