:root {
    --navy: #0a2342;
    --navy-light: #183658;
    --sky: #87CEEB;
    --sky-dark: #0077b6;
    --sky-light: #e0f7fa;
    --accent: #ffb703; /* Gold/Yellow for CTAs */
    --text-dark: #333;
    --text-light: #f4f4f4;
    --success: #2a9d8f;
    --danger: #e63946;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
}

body { 
    font-family: 'Segoe UI', 'Roboto', sans-serif; 
    background-color: #f8f9fa; 
    margin: 0; 
    padding-bottom: 0;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 { color: var(--navy); font-weight: 700; line-height: 1.2; }
h1 { font-size: 2.8rem; margin-bottom: 20px; }
h2 { font-size: 2rem; margin-bottom: 15px; position: relative; display: inline-block; }
h2::after {
    content: ''; display: block; width: 50px; height: 4px; background: var(--accent);
    margin: 10px auto 0; border-radius: 2px;
}
.text-white { color: white; }
.text-center { text-align: center; }

/* --- BUTTONS --- */
.btn { 
    display: inline-block; padding: 14px 32px; border: none; border-radius: 50px; 
    cursor: pointer; font-weight: 600; font-size: 1.1rem; text-decoration: none; 
    transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.btn-primary { background: var(--accent); color: var(--navy); }
.btn-primary:hover { background: #ffca3a; }
.btn-outline { border: 2px solid white; color: white; background: transparent; }
.btn-outline:hover { background: white; color: var(--navy); }
.btn-lg { padding: 16px 40px; font-size: 1.2rem; }

/* --- BEAUTIFIED HEADER --- */
header {
    background: var(--navy);
    padding: 15px 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 9999;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}
.brand-logo i { color: var(--accent); font-size: 1.6rem; }
.brand-logo span { color: var(--sky); }

/* Desktop Nav */
.desktop-menu {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between buttons */
}

/* 1. Standard Links (Home, Student, Faculty, Admin) */
.nav-link {
    background: rgba(255, 255, 255, 0.05); /* Glassy Navy Background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px; /* Pill Shape */
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-block;
}

/* Hover Effect: Turns White & Lifts Up */
.nav-link:hover {
    background: white; 
    color: var(--navy);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 2. Register Button (The Special One) */
.nav-highlight {
    background: var(--accent) !important; 
    color: var(--navy) !important;
    border-radius: 30px; 
    padding: 10px 20px; 
    box-shadow: 0 0 15px rgba(255, 183, 3, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Keep it Gold when hovering over the Active button */
.nav-highlight:hover {
    background: #ffca3a !important;
    color: var(--navy) !important;
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 183, 3, 0.6);
}

/* 3. Logout Button (Red Warning Style) */
.nav-logout {
    border-color: rgba(237, 100, 100, 0.4);
    color: #ff9999;
}
.nav-logout:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* --- MOBILE TOGGLE (BEAUTIFIED) --- */
.mobile-toggle {
    display: none; /* Hidden on Desktop */
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: var(--accent); /* Gold Icon */
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Hover Effect: Turn Gold and Spin */
.mobile-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: rotate(90deg); /* Fun interaction */
    box-shadow: 0 0 15px rgba(255, 183, 3, 0.5); /* Gold Glow */
}

/* Change Icon Color on Hover */
.mobile-toggle:hover i {
    color: var(--navy); /* Icon turns Navy */
}

/* Mobile Menu */
.mobile-menu-container {
    display: none;
    width: 100%;
    background: #0b2a52;
    border-top: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-height: 0;
}

.mobile-menu-container.open {
    display: block;
    max-height: 500px;
    padding: 20px 0;
}

/* Mobile Link Styling */
.mobile-link {
    display: block;
    color: white;
    text-decoration: none;
    padding: 12px 20px; /* Increased padding for interaction */
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 1rem;
    transition: all 0.2s ease;
}

/* DYNAMIC HIGHLIGHT EFFECT (Mobile) */
.mobile-link:hover {
    color: var(--accent);  /* Text turns Gold */
    background: rgba(255,255,255,0.05);
    padding-left: 30px;   /* Slide right effect */
    font-weight: bold;
}
.mobile-link:last-child { border-bottom: none; }
.mobile-link i { width: 25px; text-align: center; margin-right: 10px; color: var(--sky); }

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .desktop-menu { display: none; }
    .mobile-toggle { display: block; }
    .nav-wrapper { justify-content: space-between; }
}
@media (max-width: 480px) {
    .brand-logo { font-size: 1.2rem; }
}

/* --- HERO SECTION --- */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background-image: radial-gradient(var(--sky-light) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.1;
}
.hero-content { position: relative; z-index: 2; max-width: 700px; }
.hero-tag {
    background: rgba(135, 206, 235, 0.15); border: 1px solid var(--sky);
    color: var(--sky); padding: 6px 16px; border-radius: 30px; font-size: 0.9rem; font-weight: 600;
    display: inline-block; margin-bottom: 20px;
}

/* --- CARDS & GRID --- */
.section-padding { padding: 80px 0; }
.bg-light { background-color: white; }
.bg-sky { background-color: var(--sky-light); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.feature-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 40px;
}
.card {
    background: white; padding: 40px 30px; border-radius: 12px; box-shadow: var(--shadow);
    transition: transform 0.3s; border-top: 4px solid var(--sky-dark);
}
.card:hover { transform: translateY(-10px); }
.card-icon {
    font-size: 2.5rem; color: var(--sky-dark); margin-bottom: 20px; display: block;
}

/* --- SCHEDULE TABS --- */
.tabs { display: flex; justify-content: center; gap: 15px; margin-bottom: 30px; flex-wrap: wrap; }
.tab-btn {
    background: white; border: 2px solid var(--navy-light); padding: 12px 30px;
    cursor: pointer; border-radius: 50px; font-weight: 700; color: var(--navy-light);
    transition: all 0.3s;
}
.tab-btn.active, .tab-btn:hover { background: var(--navy); color: white; border-color: var(--navy); }
.tab-content { display: none; animation: fadeIn 0.5s ease; }
.tab-content.active { display: block; }

.schedule-table {
    width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden;
    box-shadow: var(--shadow);
}
.schedule-table th, .schedule-table td { padding: 15px 20px; text-align: left; border-bottom: 1px solid #eee; }
.schedule-table th { background: var(--navy-light); color: white; font-weight: 600; }
.schedule-table tr:hover { background: #f1f8ff; }
.time-col { color: var(--sky-dark); font-weight: bold; width: 160px; }
.topic-col { font-weight: 600; color: var(--navy); }

/* --- PRICING --- */
.pricing-card {
    background: white; border-radius: 20px; padding: 50px; text-align: center;
    box-shadow: 0 20px 50px rgba(10, 35, 66, 0.15); max-width: 600px; margin: 0 auto;
    border: 2px solid var(--sky);
}
.price-box { margin: 30px 0; }
.old-price { font-size: 1.5rem; text-decoration: line-through; color: #999; }
.new-price { font-size: 4rem; font-weight: 800; color: var(--navy); line-height: 1; margin: 10px 0; }

/* --- FOOTER --- */
footer { background: var(--navy); color: #aaa; padding: 50px 0 20px; }
footer a { color: var(--sky); text-decoration: none; }

/* --- ANIMATION --- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- RESPONSIVE --- */
@media(max-width: 768px) {
    h1 { font-size: 2rem; }
    .btn-lg { width: 100%; padding: 15px; }
}

/* --- FORM SPECIFIC --- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.col-full { grid-column: span 2; }
@media(max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .col-full { grid-column: span 1; }
}

.form-group label {
    display: block; margin-bottom: 8px; font-weight: 600; 
    color: var(--navy); font-size: 0.95rem;
}
.form-control {
    width: 100%; padding: 12px 15px; border: 1px solid #ddd; 
    border-radius: 8px; font-size: 1rem; transition: all 0.3s;
    background-color: #fcfcfc;
    padding-right: 45px; /* Add space so eye doesn't cover text */
    width: 100%; /* Makes input match parent div width */
    box-sizing: border-box; /* Ensures padding doesn't expand width */
}
.form-control:focus {
    border-color: var(--sky-dark); 
    box-shadow: 0 0 0 4px rgba(0, 119, 182, 0.1);
    background-color: white;
}

/* Alert Messages */
.alert-box {
    padding: 15px 20px; border-radius: 8px; margin-bottom: 25px; 
    font-weight: 600; display: flex; align-items: center; gap: 10px;
}
.alert-success { background: #d4edda; color: #155724; border-left: 5px solid #28a745; }
.alert-danger { background: #f8d7da; color: #721c24; border-left: 5px solid #dc3545; }

/* --- ADMIN LAYOUT (MOBILE FIRST) --- */

/* 1. The Sidebar */
.admin-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 260px; height: 100vh;
    background: var(--navy);
    color: white;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    display: flex; flex-direction: column;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

/* Mobile: Hidden */
@media (max-width: 991px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.active { transform: translateX(0); }
}

/* Desktop: Visible */
@media (min-width: 992px) {
    .admin-sidebar { transform: translateX(0); }
}

/* Sidebar Branding */
.sidebar-brand { padding: 0 25px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 20px; }
.sidebar-brand h2 { margin: 0; font-size: 1.4rem; color: white; }
.sidebar-brand span { color: var(--accent); }

.sidebar-menu { flex: 1; overflow-y: auto; padding-top: 20px; }
.sidebar-link {
    display: flex; align-items: center; padding: 12px 25px;
    color: #bdc3c7; text-decoration: none; font-size: 0.95rem;
    transition: 0.2s; border-left: 4px solid transparent;
}
.sidebar-link i { width: 25px; margin-right: 10px; color: var(--sky); text-align: center;}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.05); color: white; border-left-color: var(--accent);
}
.sidebar-link.logout-btn { margin-top: 20px; color: var(--danger); }
.sidebar-link.logout-btn:hover { background: var(--danger); color: white; }

/* 2. Overlay (Mobile Only) */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 900;
    display: none; backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* 3. Main Wrapper */
.admin-main-wrapper {
    margin-left: 0; min-height: 100vh; background: #f3f4f6; display: flex; flex-direction: column;
}
@media (min-width: 992px) { .admin-main-wrapper { margin-left: 260px; } }

/* 4. Topbar */
.admin-topbar {
    background: white; padding: 15px 25px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky; top: 0; z-index: 800;
}

.menu-toggle {
    background: transparent; border: none; font-size: 1.5rem;
    color: var(--navy); cursor: pointer; display: block;
}

/* 5. Content Body */
.admin-content-body { padding: 25px; }

/* 6. Stats Grid */
.stats-grid {
    display: grid; gap: 20px; margin-bottom: 30px;
    grid-template-columns: 1fr; /* Mobile: Stacked */
}
@media (min-width: 576px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }

.stat-card {
    background: white; padding: 25px; border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-left: 4px solid var(--sky);
    display: flex; align-items: center; justify-content: space-between;
}
.stat-card.revenue { border-left-color: var(--success); }
.stat-card.pending { border-left-color: var(--danger); }
.stat-info h3 { margin: 0; font-size: 2rem; color: var(--navy); }
.stat-info p { margin: 5px 0 0; color: #888; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

/* 7. Cards */
.card { background: white; padding: 25px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* 8. Tables */
.table-responsive {
    background: white; border-radius: 10px; overflow-x: auto; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.admin-table { width: 100%; min-width: 600px; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 15px; text-align: left; border-bottom: 1px solid #eee; }
.admin-table th { background: var(--navy-light); color: white; white-space: nowrap; font-weight: 600; }
.admin-table tr:hover { background-color: #f9f9f9; }

.status-badge { padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-pending { background: #fee2e2; color: #991b1b; }

/* --- ICON BUTTON ACTIONS STYLE --- */
.action-bar {
    display: flex;
    flex-wrap: wrap; /* Allows buttons to wrap if space is tight */
    gap: 8px;
    justify-content: flex-end; /* Aligns buttons to right on desktop */
    align-items: center;
}

.icon-btn {
    width: 36px;
    height: 36px; /* Explicit height ensures visibility */
    border-radius: 50%; /* Circular buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white; /* Ensures FontAwesome icons or Text is white */
    font-size: 14px; /* Font size for FontAwesome icons */
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 0; /* Removed padding to ensure center alignment */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Added shadow for depth */
    flex-shrink: 0; /* Prevent shrinking in flex container */
    background-color: var(--sky-dark); /* Fallback color */
}

/* Ensure Images (if used) are sized correctly */
.icon-btn img {
    width: 18px; /* Smaller than container for spacing */
    height: 18px;
    display: block;
}

/* Hover Effects */
.icon-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 2;
    background-color: var(--success); /* Ensure background color on hover */
}

/* Custom Tooltip (CSS only) */
.icon-btn::after {
    content: attr(title);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.icon-btn:hover::after {
    opacity: 1;
    bottom: 120%;
}

/* Button Colors */
.btn-icon-success { background-color: var(--success); }
.btn-icon-info { background-color: var(--sky-dark); }
.btn-icon-warning { background-color: #e67e22; } /* Orange */
.btn-icon-danger { background-color: var(--danger); }
.btn-icon-muted { background-color: #6c757d; }

/* Mobile Specific Adjustments */
@media screen and (max-width: 768px) {
    .icon-btn {
        width: 42px; /* Larger touch targets for mobile */
        height: 42px;
        font-size: 16px; /* Larger icon size */
    }
    .icon-btn::after {
        /* Disable tooltip on mobile to avoid obscuring content */
        display: none;
    }
    
    /* Force Action Bar to be Horizontal and Centered */
    .action-bar {
        width: 100%;
        justify-content: center; /* Center buttons for better mobile UX */
        flex-direction: row !important; /* CRITICAL: Ensure horizontal layout */
        gap: 15px; /* Slightly more gap for mobile tap targets */
    }
}

/* --- RESPONSIVE TABLE (MOBILE CARD VIEW - FIX FOR LAYOUT & BUTTONS) --- */
@media screen and (max-width: 768px) {
    
    /* 1. Convert Table Elements to Blocks */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    /* 2. Hide Desktop Headers */
    thead tr {
        display: none;
    }

    /* 3. Style Rows as Cards (Simpler & Stable) */
    tr {
        display: block; /* CRITICAL: Use block, not flex, for outer container */
        border: 1px solid #ddd;
        border-radius: 10px;
        background: white;
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        position: relative;
    }

    /* 4. Style Cells as Blocks (Divs) */
    td {
        border: none;
        display: block; /* Treat cells like divs inside the row */
        width: 100%;    /* CRITICAL: Ensure cell takes full width */
        padding: 0;
        margin-bottom: 15px;
        box-sizing: border-box; /* Include padding/border in width calc */
        border-bottom: 1px dashed #eee;
    }

    /* 5. Handle Last Cell to remove dashed line */
    td:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    /* 6. Style Labels (Data Attributes) */
    td::before {
        content: attr(data-label);
        display: inline-block;
        font-weight: bold;
        color: var(--navy);
        width: 90px;     /* Fixed width for labels */
        flex-shrink: 0;     /* Prevent shrinking */
        padding-right: 15px;
        text-transform: uppercase;
        font-size: 0.85rem;
        line-height: 1.4;
        vertical-align: middle; /* Align icon/text nicely */
        float: left; /* Ensure it doesn't overlap content */
    }

    /* 7. Style Content inside Cells */
    td small {
        display: block;         /* Forces onto own line */
        margin-top: 8px;        /* Space above small text */
        color: #666;
        font-size: 0.85rem;
        line-height: 1.2;
    }

    td span {
        display: block;
        margin-bottom: 2px;
        line-height: 1.2;
    }
    
    /* 8. Align Icons */
    td i {
        vertical-align: middle;
        margin-right: 5px;
        color: white;
        float: left; /* Float left so they sit next to label */
    }

    /* 9. Specific Column Fixes */
    /* Hide ID column */
    td:nth-of-type(1) { display: none; }
    
    /* Hide Label for Actions column */
    td:nth-of-type(6)::before { display: none; }
    
    /* 10. Fix Actions Column (Buttons) */
    td:nth-of-type(6) {
        width: 100%;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #ccc;
        /* Display: block is handled by CSS above, let content flow */
    }
    
    /* 11. Fix Action Bar (.action-bar wrapper) */
    .action-bar {
        width: 100%;     /* Ensure bar takes full width */
        display: flex;     /* Use flex */
        flex-direction: row !important; /* Force Horizontal */
        flex-wrap: wrap;
        justify-content: center; /* Center buttons */
        align-items: center;
        gap: 10px;     /* Space buttons */
        margin: 0 auto; /* Center if parent is block */
    }
    
    /* 12. Fix Button Shapes (Perfect Circles) */
    .icon-btn {
        width: 42px;      /* Larger for easier tapping */
        height: 42px;
        border-radius: 50%; /* Perfect Circle */
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: white;
        font-size: 16px;   /* Ensure icon size fits */
        line-height: 0;     /* CRITICAL: Reset line-height to 0 so flexbox handles height */
        padding: 0;       /* CRITICAL: Remove padding so flexbox centers perfectly */
        margin: 0;        /* Remove margin, rely on gap */
        border: none;
        cursor: pointer;
        position: relative;
    }
}