/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a365d; /* Dark blue from the image */
    --secondary: #3939e6; /* Red accent from the image */
    --accent: #4739e6; /* Red accent from buttons */
    --success: #2a9d8f; /* Green from the image */
    --warning: #e9c46a; /* Gold/yellow from the image */
    --light: #f8f9fa; /* Light background */
    --dark: #1a365d; /* Dark blue for text */
    --gray: #6c757d; /* Neutral gray */
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    min-height: 100vh;
    position: relative;
}

/* School Logo Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('logo.png'); /* Replace with your logo path */
    background-repeat: no-repeat;
    background-position: center;
    background-size: 400px; /* Adjust size as needed */
    opacity: 0.15; /* 0.2 opacity transparency */
    z-index: -1;
    pointer-events: none; /* Allows clicks to pass through */
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative; /* Ensure content stays above background */
    z-index: 1;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1a365d 0%, #2d4a80 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="%23ffffff10" d="M0,0 L100,0 L100,100 Z"/></svg>');
    background-size: cover;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
    position: relative; /* Ensure content stays above background */
    z-index: 1;
}

/* Form Styles */
.form-container {
    background: rgba(255, 255, 255, 0.283);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative; /* Ensure form stays above background */
    z-index: 1;
}

.form-title {
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--secondary);
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 600;
}

.form-group label .required {
    color: var(--accent);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(87, 165, 237, 0.2);
}

.form-control.error {
    border-color: var(--accent);
}

.error-message {
    color: var(--accent);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* File Upload */
.file-upload {
    position: relative;
    overflow: hidden;
}

.file-upload input[type="file"] {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--light);
    border: 2px dashed var(--gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-label:hover {
    background: #e9ecef;
}

.file-upload-label i {
    margin-right: 0.5rem;
    color: var(--secondary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background: #f2ff35;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-full {
    width: 100%;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #21867a;
}

.btn-danger {
    background: var(--accent);
}

.btn-danger:hover {
    background: #3a2fd3;
}

/* Dashboard Styles */
.dashboard-header {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.47);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: rgba(255, 255, 255, 0.377);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.chart-title {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Applications Table */
.table-container {
    background: rgba(255, 255, 255, 0.342);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--primary);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #fffb28;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative; /* Ensure login container stays above background */
    z-index: 1;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #801d27;
    border: 1px solid #f5c6cb;
}

/* Footer */
.footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    position: relative; /* Ensure footer stays above background */
    z-index: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .stats-grid,
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
    }
    
    .form-container {
        padding: 1rem;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}