/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-right: 1rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #34495e;
}

/* Main Content Styles */
main {
    padding: 2rem 0;
}

.dashboard-section {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.dashboard-section h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.years-classes-grid, .subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

/* Card Styles */
.stat-card, .year-class-card, .subject-card {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.year-class-card:hover, .subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-card h3, .year-class-card h3, .subject-card h3 {
    color: #3498db;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Form Styles */
.form-container {
    max-width: 600px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Button Styles */
.btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn.small {
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
}

.btn.danger {
    background: #e74c3c;
}

.btn.danger:hover {
    background: #c0392b;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: 600;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Alert Styles */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Chart Container */
.chart-container {
    margin-top: 2rem;
    height: 400px;
}

/* Login Page Styles */
.login-container {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* Footer Styles */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    text-align: center;
    margin-top: 2rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin-bottom: 0.5rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        width: 100%;
    }
}