/*
 * =========================================
 *  Studio Sigma Stylesheet
 * =========================================
 */

/* General Body and HTML Setup
--------------------------------------------- */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    color: #333;
    background-color: #f8f9fa; /* Light gray background for contrast */
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main Content Area
   - flex-grow: 1 makes this element fill available space, pushing the footer down.
   - padding-top: 110px pushes content down below the fixed header.
--------------------------------------------- */
main.page-main-content {
    flex-grow: 1;
    padding-top: 110px; /* Adjust this value if header height changes */
    padding-bottom: 40px; /* Add some space at the bottom */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}


/* Header Styles
--------------------------------------------- */
header {
    background-color: #fff;
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 50px;
    width: auto;
}

nav#main-nav ul#nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

nav#main-nav ul#nav-links li {
    margin-left: 25px;
}

nav#main-nav ul#nav-links li a {
    text-decoration: none;
    color: #1A5954;
    font-weight: 500;
    font-size: 1em;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
    overflow: hidden;
}

nav#main-nav ul#nav-links li a:hover,
nav#main-nav ul#nav-links li a.active {
    color: #00A99D;
}

nav#main-nav ul#nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: #00A99D;
    transition: width 0.3s ease-in-out;
}

nav#main-nav ul#nav-links li a:hover::after,
nav#main-nav ul#nav-links li a.active::after {
    width: 100%;
}

nav#main-nav ul#nav-links li a img {
    height: 28px;
    vertical-align: middle;
}

#menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #1A5954;
    cursor: pointer;
}


/* Hero Section (for other pages)
--------------------------------------------- */
.hero {
    position: relative;
    height: 80vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    text-align: left;
    overflow: hidden;
    background-color: #333; /* Fallback color */
}

.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-container {
    position: relative;
    z-index: 2;
}

.hero-text h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    color: #fff;
}

.hero-text p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    line-height: 1.6;
    color: #fff;
}

.hero-buttons .btn {
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    margin-right: 15px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    border: 2px solid transparent;
    font-size: 1em;
}
.hero-buttons .btn-primary {background-color: #00A99D; color: #fff;}
.hero-buttons .btn-primary:hover {background-color: #00877A; transform: translateY(-2px);}
.hero-buttons .btn-secondary {background-color: #fff; color: #00A99D; border: 2px solid #00A99D;}
.hero-buttons .btn-secondary:hover {background-color: #f0f0f0; color: #00877A; border-color: #00877A; transform: translateY(-2px);}


/* Features Section
--------------------------------------------- */
.features {padding: 60px 0; background-color: #F7FDFD;}
.features:nth-of-type(odd) { background-color: #fff; } /* Alternating background */
.features-container {display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px;}
.feature-item {background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.07); text-align: left; transition: transform 0.3s ease, box-shadow 0.3s ease;}
.feature-item:hover {transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.1);}
.feature-header {display: flex; align-items: center; margin-bottom: 15px;}
.feature-icon {height: 40px; width: auto; margin-right: 15px;}
.feature-item h2, .feature-item h3 {font-size: 1.5rem; color: #1A5954; margin-top: 0; margin-bottom: 10px;}
.feature-item p {font-size: 0.95rem; line-height: 1.7; color: #555;}
.feature-item img[alt="Chat on WhatsApp"] {max-width: 150px; margin-top: 10px;}


/* Footer Styles
--------------------------------------------- */
footer {
    background-color: #1A5954;
    color: #fff;
    text-align: center;
    padding: 30px 0;
    margin-top: auto; /* Pushes footer to bottom */
}
footer p {margin: 0; font-size: 0.9em;}


/* Login Form Specific Styling
--------------------------------------------- */
.login-page-container {
    padding-top: 30px;
    padding-bottom: 60px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.login-form-wrapper {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 450px;
}

.login-form-wrapper h1 {
    text-align: center;
    color: #1A5954;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.8em;
}

.login-form-wrapper .form-group {
    margin-bottom: 18px;
}

.login-form-wrapper .form-group label {
    font-weight: 500;
    color: #333;
    display: block;
    margin-bottom: 6px;
    text-align: left;
}

.login-form-wrapper .form-group input[type="email"],
.login-form-wrapper .form-group input[type="password"] {
    border: 1px solid #ccc;
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
    font-size: 1em;
}

.login-form-wrapper .form-group input:focus {
    border-color: #00A99D;
    box-shadow: 0 0 0 0.2rem rgba(0, 169, 157, 0.25);
}

.login-form-wrapper .btn-primary,
.login-form-wrapper .login-form-wrapper-button {
    background-color: #00A99D;
    color: white;
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.login-form-wrapper .btn-primary:hover,
.login-form-wrapper .login-form-wrapper-button:hover {
    background-color: #00877A;
}


/* Dashboard & Generic Page Content
--------------------------------------------- */
.dashboard-links {
    list-style: none;
    padding: 0;
    max-width: 600px;
    margin: 20px auto;
}
.dashboard-links li { margin-bottom: 15px; }
.dashboard-links li a {
    display: block;
    background-color: #e8f5e9;
    color: #1A5954;
    padding: 15px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
    border: 1px solid #c8e6c9;
}
.dashboard-links li a:hover {
    background-color: #dcedc8;
    transform: translateX(5px);
}
.welcome-message-dashboard {
    font-size: 1.1em;
    color: #555;
    margin-top: 0;
    margin-bottom: 25px;
    max-width: 700px;
}


/* Admin/Config Page General Styles
--------------------------------------------- */
.page-section, .form-section { 
    background-color: #ffffff; 
    padding: 25px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    margin-bottom: 30px; 
}
.page-section h2, .form-section h2 { 
    margin-top: 0; 
    border-bottom: 2px solid #f0f0f0; 
    padding-bottom: 10px; 
    margin-bottom: 20px; 
    color: #1A5954;
    font-size: 1.5rem;
}

.admin-form .form-group { margin-bottom: 1.25rem; }
.admin-form .form-group label, .form-group label { font-weight: 600; color: #333; display: block; margin-bottom: .5rem; }
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="date"],
.admin-form input[type="number"],
.admin-form input[type="time"],
.admin-form select,
.admin-form textarea { 
    border: 1px solid #ccc; 
    border-radius: 5px; 
    padding: 0.65rem 0.75rem; 
    font-size: 0.95em; 
    width: 100%; 
    box-sizing: border-box; 
    background-color: #fff;
    color: #333;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { 
    border-color: #00A99D; 
    box-shadow: 0 0 0 0.2rem rgba(0, 169, 157, 0.25); 
    outline: none;
}
.admin-form .form-actions { 
    margin-top: 1.5rem; 
    padding-top: 1rem; 
    border-top: 1px solid #e9ecef; 
    display: flex;
    justify-content: flex-start;
}
.btn, .admin-form .btn { 
    margin-right: 0.5rem; 
    padding: 10px 20px; 
    border-radius: 5px; 
    text-decoration: none; 
    display: inline-block; 
    font-size: 1em; 
    font-weight: 500; 
    border: none; 
    cursor: pointer; 
    transition: background-color 0.2s ease, transform 0.2s;
}
.btn-primary, .admin-form .btn-primary { background-color: #00A99D; color: white; }
.btn-primary:hover, .admin-form .btn-primary:hover { background-color: #00877A; transform: translateY(-1px); }
.btn-secondary, .admin-form .btn-secondary { background-color: #6c757d; color: white; }
.btn-secondary:hover, .admin-form .btn-secondary:hover { background-color: #5a6268; }
.btn-success, .admin-form .btn-success { 
    background-color: #28a745 !important; 
    color: white !important; 
    border: 1px solid #28a745 !important; 
    font-weight: 600 !important;
}
.btn-success:hover, .admin-form .btn-success:hover { 
    background-color: #218838 !important; 
    border-color: #218838 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}
.btn-info, .admin-form .btn-info { background-color: #17a2b8; color: white; }
.btn-info:hover, .admin-form .btn-info:hover { background-color: #138496; }
.btn-danger, .admin-form .btn-danger { background-color: #dc3545; color: white; }
.btn-danger:hover, .admin-form .btn-danger:hover { background-color: #c82333; }
.btn-warning, .admin-form .btn-warning { background-color: #ffc107; color: #212529; }
.btn-warning:hover, .admin-form .btn-warning:hover { background-color: #e0a800; }

.filter-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; align-items: end; margin-bottom: 25px; }
.filter-controls .form-group { margin-bottom: 0; }
.filter-controls .btn { padding: 0.65rem 1.2rem; height: calc(1.5em + 1.3rem + 2px); width: 100%; }

.table { width: 100%; margin-bottom: 1rem; color: #333; border-collapse: collapse; background-color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.07); border-radius: 5px; overflow: hidden; }
.table th, .table td { padding: 12px 15px; vertical-align: middle; border-top: 1px solid #e9ecef; text-align: left; }
.table thead th { vertical-align: bottom; border-bottom: 2px solid #dee2e6; background-color: #f8f9fa; font-weight: 600; color: #1A5954; font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.5px; }
.table tbody tr:hover { background-color: #f1f3f5; }

/* Styles for Config Pages */
.table-settings input[type="number"] { width: 80px; padding: 5px; text-align: center; }
.table-settings select { min-width: 150px; }
#set-for-all-row { background-color: #f1f3f5; font-weight: bold; }
#set-for-all-row td { padding-top: 15px; padding-bottom: 15px; vertical-align: top; }
#set-for-all-row td:first-child { vertical-align: middle; }

/* Multi-column list for checkboxes/radios */
.multi-column-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 5px 15px;
    max-width: 500px;
}
.multi-column-list label {
    font-size: 0.9em;
    display: flex;
    align-items: center;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
}
.multi-column-list input[type="checkbox"], .multi-column-list input[type="radio"] {
    margin-right: 8px;
}
.vertical-selection-list { display: flex; flex-direction: column; gap: 5px; }
.vertical-selection-list label { font-size: 0.9em; display: flex; align-items: center; font-weight: 400; cursor: pointer; }
.vertical-selection-list input[type="radio"] { margin-right: 5px; }

/* General Messages & Loaders */
.message { padding: 12px 18px; margin-bottom: 20px; border-radius: 5px; border: 1px solid transparent; font-size: 0.95em; }
.message.error { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.message.success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
.message.info { background-color: #cce5ff; color: #004085; border-color: #b8daff; }
.loading-spinner, .no-students-message { display: none; text-align: center; padding: 40px; font-size: 1.2em; color: #555; }


/* Responsive Styles
--------------------------------------------- */
@media (max-width: 992px) {
    header nav#main-nav ul#nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px; /* Match header height */
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        padding-top: 10px;
        padding-bottom: 10px;
    }
    header nav#main-nav.active ul#nav-links { display: flex; }
    header nav#main-nav ul#nav-links li { margin: 0; width: 100%; text-align: center; }
    header nav#main-nav ul#nav-links li a { padding: 15px; display: block; border-bottom: 1px solid #f0f0f0; width: 100%; box-sizing: border-box; }
    header nav#main-nav ul#nav-links li:last-child a { border-bottom: none; }
    #menu-toggle { display: block; }
}

@media (max-width: 768px) {
    .hero-text { text-align: center; }
    .hero-text h1 { font-size: 2.5rem; }
    .hero-text p { font-size: 1.1rem; }
    .hero-text p br { display: none; }
    .hero-buttons { display: flex; flex-direction: column; align-items: center; gap: 20px; }
    .hero-buttons .btn { margin-right: 0; width: 80%; max-width: 300px; text-align: center; }
    
    .admin-form, .table-settings { font-size: 14px; } /* Improve readability on mobile */
    .table thead { display: none; } /* Hide table header on mobile */
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { margin-bottom: 15px; border: 1px solid #ddd; border-radius: 5px; padding: 10px; }
    .table td { display: flex; justify-content: space-between; align-items: center; padding-left: 50%; text-align: right; position: relative; border: none; padding-top: 8px; padding-bottom: 8px; }
    .table td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        padding-right: 10px;
        font-weight: bold;
        text-align: left;
        color: #1A5954;
    }
    #set-for-all-row { display: table-row; } /* Keep the 'set for all' row as a row */
    #set-for-all-row td { display: table-cell; padding-left: 15px; } /* Reset display for its cells */
    #set-for-all-row td:before { display: none; } /* Hide data-label for this row */
    
    .filter-controls, .admin-form[style*="grid"] { grid-template-columns: 1fr; }
}

/* ========================================= */
/*  NEW: Enhanced Config Page Form Styles    */
/* ========================================= */

.choice-input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.choice-input input[type="radio"],
.choice-input input[type="checkbox"] {
    display: none; /* Hide the default radio/checkbox */
}

.choice-input label {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #f8f9fa;
    color: #555;
    margin: 0;
}

/* Hover state for any choice */
.choice-input label:hover {
    background-color: #e9ecef;
    border-color: #00A99D;
}

/* Selected state for any choice */
.choice-input input:checked + label {
    background-color: #00A99D;
    color: white;
    border-color: #00A99D;
    box-shadow: 0 2px 5px rgba(0, 169, 157, 0.3);
}

/* Specific styling for the table settings */
.table-settings .choice-input-group {
    justify-content: flex-start; /* Align items to the left in table cells */
}
.table-settings .vertical-selection-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.table-settings #set-for-all-row {
    background-color: #eef3f3; /* A slightly different, softer color for the 'all' row */
}
.table-settings #set-for-all-row td {
    padding-top: 20px;
    padding-bottom: 20px;
}
.table-settings .form-actions {
    justify-content: center;
    padding: 20px 0;
    border-top: none;
}
.table-settings .btn-primary {
    padding: 12px 30px;
    font-size: 1.1em;
}

/* Responsive adjustments for new elements */
@media (max-width: 768px) {
    .table td[data-label="Antwoordmodus"] .choice-input-group,
    .table td[data-label*="Tafels"] .choice-input-group {
        justify-content: flex-end; /* Align to the right on mobile card view */
        flex-direction: row; /* Ensure they stay horizontal */
    }
}

/* ========================================= */
/*  STYLES FOR AUTOMATION PROGRESS TRACKING  */
/* ========================================= */

.progress-indicator {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    margin: 0 auto;
    border: 1px solid #ccc;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.automation-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
}



/* ========================================= */
/*  CORRECTED REKENBOM CONFIG STYLES         */
/* ========================================= */

.rekenbom-levels .choice-input label {
    border-width: 2px;
    border-style: solid;
    font-weight: 500;
}

/* Default state for unselected buttons */
.rekenbom-levels .choice-input input:not(:checked) + label {
    background-color: #fff;
    color: #333;
    border-color: #ced4da;
}

/* Hover state for unselected buttons */
.rekenbom-levels .choice-input input:not(:checked) + label:hover {
    border-color: #00A99D;
}

/* --- Status Colors (These apply ALWAYS, checked or not) --- */

.rekenbom-levels .choice-input label.status-blue {
    background-color: #cce5ff !important;
    border-color: #b8daff !important;
    color: #004085 !important;
}

.rekenbom-levels .choice-input label.status-orange {
    background-color: #ffeeba !important;
    border-color: #ffdf7e !important;
    color: #856404 !important;
}

.rekenbom-levels .choice-input label.status-light-green {
    background-color: #d4edda !important; /* light-green */
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

.rekenbom-levels .choice-input label.status-mid-green {
    background-color: #addfad !important; /* mid-green */
    border-color: #98e9a1 !important;
    color: #155724 !important;
}

.rekenbom-levels .choice-input label.status-dark-green {
    background-color: #28a745 !important; /* dark-green */
    border-color: #1e7e34 !important;
    color: white !important;
}

/* --- Selected State (for the currently active level) --- */
/* This will only apply to buttons that DO NOT have a status color. */
.rekenbom-levels .choice-input input:checked + label {
    background-color: #6c757d; /* Dark grey for selected */
    color: white;
    border-color: #6c757d;
}