@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #1e3a8a;
    /* Royal Blue */
    --primary-hover: #1e40af;
    /* Deep Blue */
    --accent-color: #0369a1;
    /* Sky 700 - Official Blue */
    --accent-hover: #075985;
    /* Sky 800 */
    --bg-color: #f1f5f9;
    /* Slate 100 - Light Grey */
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --input-border: #cbd5e1;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-image: linear-gradient(rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0.4)), url('dashboard_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-main);
}

body.neutral-bg {
    background-color: var(--bg-color);
    background-image: linear-gradient(to bottom, #f1f5f9, #e2e8f0);
}

body.auth-page {
    background-image: linear-gradient(rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.6)), url('school_bg_login.png');
}

.container {
    background: var(--card-bg);
    padding: 3.5rem 4rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    text-align: center;
    max-width: 550px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-color);
}

.register-container {
    max-width: 700px;
    /* Wider for registration */
}

header {
    margin-bottom: 2.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.5rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.caption {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.site-logo {
    max-width: 140px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

@media (min-width: 640px) {
    .button-group {
        flex-direction: row;
    }
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--bg-color);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
    display: block;
    margin-top: 1rem;
}

/* Form Styles */
.auth-form {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
}

input,
select {
    padding: 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: #fff;
    width: 100%;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.form-footer {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Optional header accent */
.container::before {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 0 auto 1.5rem auto;
    border-radius: 2px;
}

/* Error Styles */
.error-text {
    color: #ef4444;
    /* Red 500 */
    font-size: 0.9rem;
    margin-top: 0.25rem;
    display: block;
}

.input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
    /* Red 50 */
}

.btn-info {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-info:hover {
    background: var(--bg-color);
    transform: translateY(-1px);
}

.official-headline {
    color: var(--primary-color) !important;
    font-weight: 700;
    letter-spacing: -0.025em;
    position: relative;
    padding-bottom: 0.5rem;
}

.official-headline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

.form-error-message {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #b91c1c;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-align: center;
    display: none;
    /* Hidden by default */
}



.chairman-container {
    max-width: 900px;
    /* Bigger page */
    padding: 4rem 5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.chairman-container h1 {
    font-size: 2.5rem;
    /* Official Goldish-White or simple White text depending on background, but here it is inside a white container so we need dark text */
    /* Let's use the Primary Official Color for text */
    color: #0f172a;
    background: none;
    -webkit-text-fill-color: initial;
    margin-bottom: 1rem;
}

.chairman-container .btn {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

/* Filter Styles */
.filter-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.filter-grid {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.btn-search {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 1.35rem;
    /* Matches search_teachers.html alignment */
    width: 100%;
}

.btn-search:hover {
    background: #4338ca;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Global Footer Styles */
.site-footer {
    text-align: center;
    padding: 1.25rem 1rem;
    margin: 1.5rem auto 0 auto;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: #94a3b8;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    width: 100%;
    max-width: 1200px;
    clear: both;
}

.site-footer strong {
    color: #64748b;
    font-weight: 600;
}

/* Global Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container,
    .register-container,
    .profile-container,
    .registration-container {
        padding: 2rem 1.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 1rem 0 !important;
        border-radius: 12px !important;
    }

    h1 {
        font-size: 1.75rem !important;
    }

    .chairman-portal-section {
        flex-direction: column !important;
        padding: 1.5rem !important;
        gap: 1rem !important;
    }

    header {
        padding: 2rem 1rem !important;
    }

    .hero-btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .action-card {
        padding: 1.5rem !important;
    }

    .table-card {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin: 1rem -1rem !important;
        border-radius: 0 !important;
    }

    table {
        min-width: 600px;
        /* Ensure table doesn't squish too much */
    }

    .filter-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem !important;
    }

    .site-logo {
        max-width: 100px !important;
    }

    .back-home-btn {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        top: 1rem !important;
        left: 1rem !important;
    }
}