/* File: style.css */
/* --- THEME DEFINITIONS & VARIABLES --- */
:root {
    /* --- Light Theme (Default) --- */
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --body-bg: #f4f7f6;
    --card-bg: #ffffff;
    --card-border: #dee2e6;
    --text-color: #212529;
    --text-muted: #6c757d;
    --sidebar-bg: #212529;
    --sidebar-text: #adb5bd;
    --sidebar-header-bg: #000;
    --sidebar-hover-bg: #343a40;
    --table-header-bg: #f8f9fa;
    --table-hover-bg: #f1f1f1;
    --shadow: 0 4px 8px rgba(0,0,0,0.05);
}

[data-theme="dark"] {
    --primary-color: #0d6efd;
    --secondary-color: #adb5bd;
    --dark-color: #dee2e6;
    --light-color: #212529;
    --body-bg: #121212;
    --card-bg: #1e1e1e;
    --card-border: #444;
    --text-color: #f8f9fa;
    --text-muted: #adb5bd;
    --sidebar-bg: #000;
    --sidebar-text: #adb5bd;
    --sidebar-header-bg: #1e1e1e;
    --sidebar-hover-bg: #333;
    --table-header-bg: #2c2c2c;
    --table-hover-bg: #333;
    --shadow: 0 4px 8px rgba(0,0,0,0.2);
}

[data-theme="grey"] {
    --primary-color: #007bff;
    --secondary-color: #5a6268;
    --dark-color: #e9ecef;
    --light-color: #495057;
    --body-bg: #343a40;
    --card-bg: #495057;
    --card-border: #6c757d;
    --text-color: #f8f9fa;
    --text-muted: #ced4da;
    --sidebar-bg: #212529;
    --sidebar-text: #ced4da;
    --sidebar-header-bg: #000;
    --sidebar-hover-bg: #495057;
    --table-header-bg: #5a6268;
    --table-hover-bg: #6c757d;
    --shadow: 0 4px 8px rgba(0,0,0,0.25);
}


/* --- General Styles Using Variables --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- THEME SWITCHER STYLES --- */
.theme-switcher {
    display: flex;
    align-items: center;
    margin-right: auto; /* Pushes it to the left */
}
.theme-btn {
    background: none;
    border: 2px solid transparent;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 5px 10px;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}
.theme-btn:hover {
    color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.1);
}
.theme-btn.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* --- Public Page (index.php) --- */
.public-page { display: flex; flex-direction: column; min-height: 100vh; }
.public-header { background-color: #343a40; color: #f8f9fa; padding: 20px 0; box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
.public-header .container { display: flex; justify-content: space-between; align-items: center; }
.public-header h1 { margin: 0; font-size: 1.5rem; }
.public-header .btn.btn-primary { background: linear-gradient(45deg, #007bff, #0056b3); padding: 12px 25px; font-weight: 600; border-radius: 50px; box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2); transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 10px; border: none; color: #fff; }
.public-header .btn.btn-primary:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 25px rgba(0, 123, 255, 0.35); }
.public-main { flex-grow: 1; padding-top: 30px; padding-bottom: 30px; }
.public-content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; align-items: flex-start; }
.info-column { display: flex; flex-direction: column; gap: 30px; }

/* --- Slideshow --- */
/* **FIX**: Set a fixed height for the slideshow container */
.slideshow-container {
    position: relative;
    padding: 25px;
    height: 450px; 
    display: flex;
    flex-direction: column;
}
.slide {
    display: none;
    flex-grow: 1;
    position: relative;
}
/* **FIX**: Ensure canvas fills the slide area correctly */
.slide canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}
.fade { animation-name: fade; animation-duration: 1.5s; }
@keyframes fade { from { opacity: .4 } to { opacity: 1 } }
.slideshow-dots { text-align: center; padding-top: 20px; }
.dot { cursor: pointer; height: 15px; width: 15px; margin: 0 2px; background-color: #bbb; border-radius: 50%; display: inline-block; transition: background-color 0.6s ease; }
.dot.active, .dot:hover { background-color: var(--primary-color); }
/* --- End Slideshow --- */

@media (max-width: 992px) { .public-content-grid { grid-template-columns: 1fr; } }
.login-page { background: linear-gradient(135deg, #007bff 0%, #0056b3 100%); display: flex; justify-content: center; align-items: center; height: 100vh; }
.login-container { display: flex; max-width: 900px; width: 100%; background: #fff; border-radius: 10px; box-shadow: 0 15px 30px rgba(0,0,0,0.2); overflow: hidden; }
.login-branding { background: #343a40; color: #fff; padding: 40px; width: 45%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.login-branding .branding-content i { font-size: 4rem; margin-bottom: 20px; }
.login-branding h2 { margin: 0; font-size: 1.5rem; }
.login-branding p { margin: 5px 0 20px; color: #adb5bd; }
.login-branding .back-link { color: #fff; text-decoration: none; font-size: 0.9rem; border: 1px solid #fff; padding: 8px 15px; border-radius: 20px; transition: all 0.3s ease; display: inline-flex; align-items: center; }
.login-branding .back-link:hover { background-color: #fff; color: #343a40; }
.login-form-container { padding: 40px; width: 55%; }
.login-form h2 { color: #343a40; }
.login-form p { color: #6c757d; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 5px; color: #555; }
.form-group input { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; transition: border-color 0.3s; background: #fff; color: #212529; }
.form-group input:focus { outline: none; border-color: #007bff; }
.wrapper { display: flex; align-items: stretch; }
#content { width: 100%; padding: 0; min-height: 100vh; transition: all 0.3s; display: flex; flex-direction: column; }
.main-content { padding: 30px; flex-grow: 1;}
.main-footer, .public-footer { text-align: center; padding: 20px; font-size: 0.9rem; }
.main-footer { background-color: var(--card-bg); border-top: 1px solid var(--card-border); color: var(--text-muted); }
.public-footer { background-color: #343a40; color: #adb5bd; }
.developer-credit { margin-top: 5px; font-style: italic; }
.sidebar { min-width: 250px; max-width: 250px; background: var(--sidebar-bg); color: var(--sidebar-text); transition: all 0.3s; }
.sidebar-header { padding: 20px; background: var(--sidebar-header-bg); text-align: center; }
.sidebar-header h3 { color: #fff; margin: 0; }
.sidebar ul.components { padding: 20px 0; border-bottom: 1px solid #47748b; }
.sidebar ul li a { padding: 15px 20px; font-size: 1.1em; display: block; color: var(--sidebar-text); text-decoration: none; transition: all 0.3s; }
.sidebar ul li a:hover { color: #fff; background: var(--sidebar-hover-bg); }
.sidebar ul li.active > a, a[aria-expanded="true"] { color: #fff; background: var(--primary-color); }
.sidebar ul li a i { margin-right: 10px; }
.navbar { padding: 15px 30px; background: var(--card-bg); border-bottom: 1px solid var(--card-border); display: flex; justify-content: flex-end; align-items: center; }
.user-profile { display: flex; align-items: center; }
.user-profile span { font-weight: 500; }
.user-profile .logout-link { margin-left: 20px; color: var(--text-muted); text-decoration: none; font-size: 1.2rem; }
.user-profile .logout-link:hover { color: var(--primary-color); }
.profile-pic-nav { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; margin-right: 15px; border: 2px solid var(--card-border); }
.profile-pic-table { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.profile-pic-preview { width: 100px; height: 100px; border-radius: 8px; object-fit: cover; border: 1px solid var(--card-border); }
.page-header { margin-bottom: 30px; border-bottom: 1px solid var(--card-border); padding-bottom: 15px; }
.page-header h1 { margin: 0; }
.page-header p { margin: 5px 0 0; color: var(--text-muted); }
.card, .stat-card, .chart-card { background: var(--card-bg); padding: 25px; border-radius: 8px; box-shadow: var(--shadow); border: 1px solid var(--card-border); margin-bottom: 30px; }
.card-title { margin-top: 0; margin-bottom: 20px; font-size: 1.2rem; border-bottom: 1px solid var(--card-border); padding-bottom: 10px; }
.stat-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.stat-card { display: flex; align-items: center; padding: 20px; }
.stat-card-icon { width: 60px; height: 60px; border-radius: 10px; display: flex; justify-content: center; align-items: center; color: #fff; font-size: 1.8rem; margin-right: 20px; }
.stat-card-info p { margin: 0; color: var(--text-muted); }
.stat-card-info h3 { margin: 5px 0 0; font-size: 2rem; }
.dashboard-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.chart-card.full-width { grid-column: 1 / -1; }
.chart-container { position: relative; width: 100%; height: 350px; }
@media (max-width: 768px) { .dashboard-charts-grid { grid-template-columns: 1fr; } }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--card-border); }
thead th { background-color: var(--table-header-bg); font-weight: 600; }
tbody tr:hover { background-color: var(--table-hover-bg); }
.form-container { padding: 30px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; text-align: right; margin-top: 20px; border-top: 1px solid var(--card-border); padding-top: 20px; }
select.form-control, input.form-control { width: 100%; padding: 10px; border: 1px solid var(--card-border); border-radius: 5px; box-sizing: border-box; background-color: var(--card-bg); color: var(--text-color); }
fieldset { border: 1px solid var(--card-border); border-radius: 5px; padding: 20px; margin-bottom: 20px; }
legend { padding: 0 10px; font-weight: 600; color: var(--primary-color); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.checkbox-group { display: flex; align-items: center; }
.checkbox-group input { margin-right: 10px; }
.btn { display: inline-block; padding: 10px 20px; font-size: 1rem; border-radius: 5px; text-decoration: none; border: none; cursor: pointer; transition: all 0.3s ease; text-align: center; }
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-primary:hover { background-color: #0056b3; }
.btn-secondary { background-color: var(--secondary-color); color: #fff; }
.btn-secondary:hover { background-color: #5a6268; }
.btn-danger { background-color: #dc3545; color: #fff; }
.btn-danger:hover { background-color: #c82333; }
.btn-success { background-color: #28a745; color: #fff; }
.btn-success:hover { background-color: #218838; }
.btn-warning { background-color: #ffc107; color: #212529; }
.btn-warning:hover { background-color: #e0a800; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.alert-info { color: #0c5460; background-color: #d1ecf1; border-color: #bee5eb; }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: var(--card-bg); margin: 15% auto; padding: 20px; border: 1px solid var(--card-border); width: 80%; max-width: 500px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.modal-header { padding-bottom: 10px; border-bottom: 1px solid var(--card-border); }
.modal-header h2 { margin: 0; }
.modal-body { padding: 20px 0; }
.modal-footer { padding-top: 10px; border-top: 1px solid var(--card-border); text-align: right; }
.modal-footer .btn { margin-left: 10px; }
.report-content .report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.report-content .report-header h2 { margin: 0; }
.search-form { display: flex; }
.search-form input { min-width: 250px; margin-right: 10px; }

