/* GLOBAL STYLING: Dark Mode Theme */
:root {
    --primary-color: #4A90E2; /* Muted Blue */
    --secondary-color: #2F3640; /* Dark Charcoal Background */
    --background-color: #1a1a2e; /* Deep Navy Background */
    --text-color: #E0E0E0; /* Light Gray Text */
    --accent-color: #F8D775; /* Soft Gold Accent */
    --card-bg: rgba(47, 54, 64, 0.8); /* Semi-transparent Card */
    --border-color: rgba(74, 144, 226, 0.3);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    /* Optional: Subtle gradient or texture for depth */
    background-image: radial-gradient(circle at center, #2c3e50 0%, #1a1a2e 100%);
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Header & Hero Section (Homepage) */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 100px 0;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.hero-content h2 {
    font-size: 1.5rem;
    margin-bottom: 40px;
    font-weight: 300;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    margin-top: 20px;
    border-radius: 50px; /* Pill-shaped button */
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #1a1a2e; /* Dark text on light accent */
    box-shadow: 0 4px 10px rgba(248, 215, 117, 0.4);
}

.btn-primary:hover {
    background-color: #e0b44a;
    transform: translateY(-2px);
}

.btn-secondary { /* Used for admin logout/clear filter */
    background-color: #dc3545;
    color: white;
}

.btn-secondary:hover {
    background-color: #c82333;
}

/* Course Details */
.course-details {
    padding: 40px 0;
}

.course-details h2, .important-dates h2, .form-card h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 40px;
    font-weight: 300;
    text-transform: uppercase;
}

.course-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.course-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.4s;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
}

.course-card:hover {
    background-color: rgba(47, 54, 64, 1);
    transform: translateY(-8px) scale(1.02);
}

.course-card h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

/* Important Dates */
.important-dates {
    padding: 20px 0 60px 0;
}
.important-dates ul {
    list-style: none;
    padding: 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 40px;
}

.important-dates li {
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    font-size: 1.1rem;
    border-left: 3px solid var(--accent-color);
}

/* --- Form Container (Registration & Login) --- */
.form-card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    max-width: 450px;
    margin: 60px auto;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background: #3c424d;
    border: 1px solid #4A90E2;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(248, 215, 117, 0.5);
    outline: none;
    background: #4A5059;
}

.form-group button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s, transform 0.3s;
}

.form-group button:hover {
    background-color: #3f7ac2;
    transform: translateY(-1px);
}

/* Error/Success Messages */
.error, .success {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: bold;
}

.error {
    background-color: #58151c; /* Dark Red */
    color: #ffb3b8;
    border: 1px solid #dc3545;
}

.success {
    background-color: #2e4d3a; /* Dark Green */
    color: #c3e6cb;
    border: 1px solid #28a745;
}

/* --- LOGIN PAGE ICON STYLING --- */
.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    z-index: 1;
}

.input-icon input {
    padding-left: 40px; 
}

/* --- Admin Dashboard Styling --- */
.dashboard-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.filter-controls {
    margin: 30px 0;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.filter-controls label {
    font-weight: normal;
    color: var(--primary-color);
}

.filter-controls select {
    background: #3c424d;
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    padding: 8px;
    border-radius: 5px;
}

.student-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    border-radius: 10px;
    overflow: hidden;
}

.student-table th, .student-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #3c424d;
}

.student-table th {
    background-color: var(--primary-color);
    color: white;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 600;
}

.student-table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.1);
}

.student-table tr:hover {
    background-color: rgba(74, 144, 226, 0.1);
}

/* Footer */
footer {
    text-align: center;
    padding: 25px 0;
    margin-top: 50px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
}

/* Modal/Pop-up Styling */
.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: none; 
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid var(--accent-color);
}

.modal-content h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.modal-content p {
    margin-bottom: 20px;
    color: var(--text-color);
}

.close-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .hero { padding: 60px 0; }
    .hero-content h1 { font-size: 2rem; }
    .course-list { grid-template-columns: 1fr; }
    .important-dates ul { flex-direction: column; gap: 10px; }
    .form-card { margin: 30px 10px; padding: 30px; }
    
    /* Responsive Table (Card-like view on mobile) */
    .student-table thead { display: none; }
    .student-table tr { 
        margin-bottom: 10px; 
        display: block; 
        border: 1px solid var(--border-color); 
        border-radius: 8px;
    }
    .student-table td { 
        border-bottom: 1px solid #3c424d;
        display: block; 
        text-align: right;
        padding-left: 50%;
        position: relative;
    }
    .student-table td::before { 
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%; 
        padding-right: 10px; 
        font-weight: bold;
        text-align: left;
        color: var(--primary-color);
    }
}
/* --- Admin Dashboard Styling (Modified Sections) --- */

.filter-controls {
    margin: 30px 0;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between; /* Distribute items horizontally */
}

/* New Search Input Styling */
.filter-controls input[type="search"] {
    background: #3c424d;
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 5px;
    width: 200px; /* Set a fixed width */
    transition: width 0.3s;
}

.filter-controls input[type="search"]:focus {
    width: 250px;
    border-color: var(--accent-color);
    outline: none;
}

/* Pagination Controls Styling */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 10px;
}

.pagination a, .pagination span {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.pagination a {
    background-color: var(--primary-color);
    color: white;
}

.pagination a:hover {
    background-color: var(--secondary-color);
}

.pagination .current-page {
    background-color: var(--accent-color);
    color: var(--secondary-color);
}

.pagination .disabled {
    background-color: #3c424d;
    color: #888;
    cursor: not-allowed;
}
/* --- Global Notification Style (for AJAX feedback) --- */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1200;
    opacity: 0.95;
    transition: opacity 0.3s;
}

.notification.success {
    background-color: #2ecc71; /* Green */
}

.notification.error {
    background-color: #e74c3c; /* Red */
}

/* Style for message composition card (assuming you use a .form-card or similar) */
.form-card {
    background-color: var(--card-bg, #2c3e50); /* Darker background for card */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Style for table checkboxes */
.student-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}
/* --- Global Notification Style (for AJAX feedback) --- */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1200;
    opacity: 0.95;
    transition: opacity 0.3s;
}

.notification.success {
    background-color: #2ecc71; /* Green */
}

.notification.error {
    background-color: #e74c3c; /* Red */
}

/* Optional loading style if you want to show it */
.notification.primary {
    background-color: #3498db; /* Blue/Primary */
}

/* --- Modal Styles (for Confirmation Dialog) --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7); /* Dark semi-transparent background */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg, #2c3e50);
    margin: auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Ensure your table rows have a transition property for smooth removal */
.student-table tbody tr {
    transition: opacity 0.5s ease-out;
}
/* --- Global Notification Style (for AJAX feedback) --- */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1200;
    opacity: 0.95;
    transition: opacity 0.3s;
}

.notification.success {
    background-color: #2ecc71; /* Green */
}

.notification.error {
    background-color: #e74c3c; /* Red */
}

.notification.primary {
    background-color: #3498db; /* Blue for 'Sending/Deleting' status */
}

/* --- Modal Styles (for Confirmation Dialog in dashboard) --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7); /* Dark semi-transparent background */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg, #2c3e50);
    margin: auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Ensure your table rows have a transition property for smooth removal */
.student-table tbody tr {
    transition: opacity 0.5s ease-out;
}