/* ----- CSS RESET & VARIABLES ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #1a3a5c;
    --primary-light: #2a5a8c;
    --secondary: #e8b931;
    --accent: #d4880f;
    --light-bg: #f4f7fc;
    --card-bg: #ffffff;
    --text-dark: #1e2a41;
    --text-light: #5a6a7e;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --transition: 0.3s ease;
}

body {
    background: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
    padding: 20px;
}

/* ----- GRID LAYOUT: Header | Main (2fr / 1fr) | Footer ----- */
.grid-container {
    display: grid;
    grid-template-areas:
        "header header"
        "hero hero"
        "main sidebar"
        "footer footer";
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 25px;
    max-width: 1300px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ----- HEADER ----- */
.header {
    grid-area: header;
    background: var(--primary);
    color: white;
    padding: 25px 30px;
    border-radius: var(--radius);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--secondary);
}

.header-left h1 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.header-left h1 span {
    color: var(--secondary);
}

.header-right {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.header-right a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header-right a:hover {
    background: var(--secondary);
    color: var(--primary);
    transform: translateY(-2px);
}

.header-right a i {
    font-size: 1rem;
}

.header-login-btn {
    background: var(--secondary) !important;
    color: var(--text-dark) !important;
}

.header-login-btn:hover {
    background: white !important;
    color: var(--primary) !important;
}

.header-user-menu {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    color: var(--secondary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
}

.header-logout-btn {
    background: rgba(192, 57, 43, 0.25) !important;
}

.header-logout-btn:hover {
    background: #c0392b !important;
    color: white !important;
}

.requires-auth {
    display: none;
}

/* ----- LOGIN MODAL ----- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 58, 92, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: white;
    border-radius: var(--radius);
    padding: 32px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: translateY(20px);
    transition: 0.3s ease;
}

.modal.show .modal-box {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary);
}

.modal-box h2 {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 6px;
    border: none;
    padding: 0;
}

.modal-box h2 i {
    color: var(--secondary);
    margin-right: 8px;
}

.modal-subtext {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 22px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.login-form label i {
    color: var(--primary-light);
    margin-right: 6px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 30px;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.login-form input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(42, 90, 140, 0.2);
}

.login-error {
    color: #c0392b;
    font-size: 0.88rem;
    min-height: 1.2em;
    margin-bottom: 8px;
}

.login-submit {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 30px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.login-submit:hover {
    background: var(--primary-light);
}

/* ----- HERO CAROUSEL ----- */
.hero {
    grid-area: hero;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.hero-carousel {
    position: relative;
    height: 380px;
    overflow: hidden;
}

.hero-track {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slide {
    flex: 0 0 100%;
    position: relative;
    background-image: var(--slide-bg);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(26, 58, 92, 0.88) 0%, rgba(26, 58, 92, 0.55) 55%, rgba(26, 58, 92, 0.25) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 40px 50px;
    max-width: 620px;
    color: white;
    animation: heroFadeIn 0.7s ease;
}

.hero-slide:not(.active) .hero-content {
    animation: none;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-tag {
    display: inline-block;
    background: var(--secondary);
    color: var(--text-dark);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.hero-content h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 12px;
    border: none;
    padding: 0;
    color: white;
}

.hero-content p {
    font-size: 1rem;
    opacity: 0.92;
    margin-bottom: 22px;
    line-height: 1.6;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--secondary);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    padding: 12px 26px;
    border-radius: 30px;
    transition: var(--transition);
}

.hero-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.35);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.hero-nav:hover {
    background: var(--secondary);
    color: var(--text-dark);
    border-color: var(--secondary);
}

.hero-prev { left: 18px; }
.hero-next { right: 18px; }

.hero-dots {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.hero-dot.active,
.hero-dot:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: scale(1.2);
}

/* ----- MAIN CONTENT (2fr) ----- */
.main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--primary);
    border-left: 5px solid var(--secondary);
    padding-left: 15px;
}

.card h2 i {
    color: var(--secondary);
    margin-right: 10px;
}

.card p.subtext {
    margin-bottom: 10px;
    color: var(--text-light);
}

/* ----- LEADERS ----- */
.leaders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.leader-item {
    text-align: center;
    background: var(--light-bg);
    padding: 15px 10px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.leader-item:hover {
    transform: scale(1.02);
    background: #e9eef5;
}

.leader-photo {
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
    position: relative;
}

.leader-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e9eef5;
    border: 3px solid var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-light);
}

.leader-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
}

.leader-item h4 {
    font-weight: 600;
    font-size: 1rem;
}

.leader-item p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ----- STUDENT SERVICES ----- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.service-item {
    background: var(--light-bg);
    padding: 20px;
    border-radius: var(--radius);
    border-left: 4px solid var(--secondary);
    transition: var(--transition);
}

.service-item:hover {
    background: #e9eef5;
    transform: translateY(-2px);
}

.service-item i {
    font-size: 1.6rem;
    color: var(--primary-light);
    margin-bottom: 10px;
}

.service-item h4 {
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--primary);
}

.service-item p {
    font-size: 0.88rem;
    color: var(--text-light);
}

/* ----- EVENTS ----- */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.event-card {
    background: var(--light-bg);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.event-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.event-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.event-card .event-body {
    padding: 15px;
}

.event-card h4 {
    color: var(--primary);
    margin-bottom: 6px;
}

.event-card p {
    font-size: 0.88rem;
    color: var(--text-light);
}

.event-card .event-date {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.8rem;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
}

/* ----- TABLE ----- */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th {
    background: var(--primary);
    color: white;
    padding: 12px 15px;
    text-align: left;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}

tr:hover {
    background: #f1f5fa;
}

.table-actions {
    display: flex;
    gap: 6px;
}

.table-actions button {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.table-actions .edit-btn {
    color: var(--primary-light);
    background: rgba(42, 90, 140, 0.1);
}

.table-actions .edit-btn:hover {
    background: var(--primary-light);
    color: white;
}

.table-actions .delete-btn {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.1);
}

.table-actions .delete-btn:hover {
    background: #c0392b;
    color: white;
}

/* ----- FORMS ----- */
.crud-form,
.contact-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px 0 10px;
}

.crud-form input,
.crud-form select,
.contact-form input,
.contact-form textarea {
    flex: 1 1 180px;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 30px;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.contact-form textarea {
    flex: 1 1 100%;
    border-radius: var(--radius);
    min-height: 90px;
    resize: vertical;
}

.crud-form input:focus,
.crud-form select:focus,
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(42, 90, 140, 0.2);
}

.crud-form button,
.contact-form button {
    padding: 12px 28px;
    border: none;
    border-radius: 30px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.crud-form button:hover,
.contact-form button:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.crud-form button.btn-edit {
    background: var(--secondary);
    color: var(--text-dark);
}

.crud-form button.btn-edit:hover {
    background: var(--accent);
}

.file-upload {
    flex: 1 1 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px dashed var(--primary-light);
    border-radius: 30px;
    background: var(--light-bg);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload:hover {
    background: #e9eef5;
    border-color: var(--secondary);
}

.file-upload input[type="file"] {
    display: none;
}

.image-preview {
    margin: 0 0 10px;
}

.image-preview img {
    max-width: 160px;
    max-height: 100px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 2px solid var(--primary-light);
    display: block;
}

.image-preview .preview-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 6px;
}

.item-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--primary-light);
    flex-shrink: 0;
}

.no-thumb {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ----- ITEM LIST (CRUD) ----- */
.item-list {
    list-style: none;
    margin-top: 15px;
}

.item-list li {
    background: var(--light-bg);
    margin-bottom: 10px;
    padding: 14px 18px;
    border-radius: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    transition: var(--transition);
    border-left: 4px solid var(--secondary);
}

.item-list li:hover {
    background: #e9eef5;
}

.item-list li .item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-list li .item-info strong {
    font-size: 1.05rem;
}

.item-list li .item-info small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.item-actions button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px 12px;
    border-radius: 20px;
    transition: var(--transition);
    font-weight: 500;
}

.item-actions .edit-btn {
    color: var(--primary-light);
    background: rgba(42, 90, 140, 0.1);
}

.item-actions .edit-btn:hover {
    background: var(--primary-light);
    color: white;
}

.item-actions .delete-btn {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.1);
}

.item-actions .delete-btn:hover {
    background: #c0392b;
    color: white;
}

/* ----- SIDEBAR (1fr) ----- */
.sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar .card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 10px;
    font-size: 1.2rem;
}

.sidebar .card h3 i {
    color: var(--secondary);
    margin-right: 8px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar ul li i {
    color: var(--primary-light);
    width: 20px;
}

.sidebar ul li a {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar ul li a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.stat-box {
    background: var(--primary);
    color: white;
    padding: 15px 18px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stat-box span {
    font-size: 1.8rem;
    font-weight: 700;
}

/* ----- FOOTER ----- */
.footer {
    grid-area: footer;
    background: var(--primary);
    color: #ddd;
    padding: 20px 30px;
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.footer a {
    color: var(--secondary);
    text-decoration: none;
}

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

.footer .social i {
    font-size: 1.4rem;
    margin-left: 12px;
    color: #ddd;
    transition: var(--transition);
}

.footer .social i:hover {
    color: var(--secondary);
    transform: scale(1.1);
}

/* ----- RESPONSIVE ----- */
@media (max-width: 900px) {
    .grid-container {
        grid-template-areas:
            "header"
            "hero"
            "main"
            "sidebar"
            "footer";
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 500px) {
    .header-left h1 {
        font-size: 1.2rem;
    }

    .hero-carousel {
        height: 320px;
    }

    .hero-content {
        padding: 28px 24px;
    }

    .hero-content h2 {
        font-size: 1.45rem;
    }

    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }

    .hero-nav {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .hero-prev { left: 10px; }
    .hero-next { right: 10px; }

    .crud-form input,
    .crud-form select,
    .contact-form input,
    .file-upload {
        flex: 1 1 100%;
    }

    .leaders-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .item-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ----- TOAST ----- */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: white;
    padding: 14px 28px;
    border-radius: 40px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999;
    transform: translateY(100px);
    opacity: 0;
    transition: 0.4s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast i {
    font-size: 1.3rem;
    color: var(--secondary);
}
