/* style.css */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

h1 {
    color: #1a2b3c;
    border-bottom: 2px solid #eef2f5;
    padding-bottom: 15px;
    margin-top: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: #fcfdff;
    border: 1px solid #eef2f5;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-card h2 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #5a7184;
}

.stat-card p {
    margin: 0;
    font-size: 36px;
    font-weight: bold;
    color: #00b1ff;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 40px;
}

.video-list table {
    width: 100%;
    border-collapse: collapse;
}

.video-list th, .video-list td {
    padding: 12px 15px;
    border-bottom: 1px solid #eef2f5;
    text-align: left;
}

.video-list th {
    background-color: #f8fafc;
    font-weight: 600;
}

.video-list a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.video-list a:hover {
    text-decoration: underline;
}

.error-box {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
    padding: 15px;
    border-radius: 4px;
}


/* NEW: Styles for the filter form */
.filter-form {
    background-color: #f8fafc;
    border: 1px solid #eef2f5;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-form label {
    font-weight: 600;
    color: #333;
}

.filter-form select, .filter-form button {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.filter-form button {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    cursor: pointer;
    font-weight: 500;
}

.filter-form button:hover {
    background-color: #0056b3;
}

/* NEW: Style for informational messages */
.info-box {
    background-color: #e7f3fe;
    color: #0c5464;
    border: 1px solid #bde5f8;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}


/* MODIFIED: Update filter form for multiple inputs */
.filter-form {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    align-items: flex-end; /* Align bottoms of labels and inputs */
    gap: 20px;
}

.filter-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-form label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.filter-form select,
.filter-form input[type="date"],
.filter-form button {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #ccc;
    height: 38px; /* Standard height for form elements */
}

.filter-form button {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0; /* Align with inputs */
}
.filter-form .checkbox-group {
    flex-direction: row; /* Make checkbox and label horizontal */
    align-items: center; /* Vertically center them */
    align-self: flex-end; /* Align the group with the bottom of other inputs */
    padding-bottom: 8px; /* Fine-tune vertical alignment with button */
}

.filter-form .checkbox-group input {
    margin-right: 8px;
    height: auto; /* Let checkbox have its natural height */
}


/* NEW: Style for the warning box */
.warning-box {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}


.debug-box {
    background-color: #111;
    color: #00ff00; /* Classic hacker green */
    border: 1px solid #444;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    margin-bottom: 20px;
    white-space: pre-wrap; /* Allows the text to wrap */
    word-wrap: break-word; /* Breaks long strings */
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
}

.debug-box h2 {
    color: #fff;
    margin-top: 0;
}

/* NEW: Styles for the Detail Page */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Video takes 2/3, stats take 1/3 */
    gap: 30px;
    align-items: flex-start;
    margin-top: 20px;
}

.detail-video iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9; /* Maintain 16:9 aspect ratio */
    border-radius: 8px;
}

.detail-stats h3 {
    margin-top: 0;
    border-bottom: 1px solid #eef2f5;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Make stat cards smaller for the sidebar */
.detail-stats .stat-card p {
    font-size: 28px;
}

/* Responsive layout for smaller screens */
@media (max-width: 900px) {
    .detail-grid {
        grid-template-columns: 1fr; /* Stack video and stats on top of each other */
    }
}