
* {
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

:root {
    --container-max: 1200px;
    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --radius-1: 8px;
    --radius-2: 12px;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

footer .container {
    text-align: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: #667eea;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0 0 0;;
    color: white;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
}

/* Filter Section */
.filters {
    background: white;
    padding: 2rem 0;
    margin: 2rem 0;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.filter-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Schedule Grid */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* Month Calendar */
.month-calendar {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 1rem 1rem 1.25rem;
    margin: 1rem 0 2rem;
}
.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: .5rem;
}
.calendar-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 0 .25rem;
    color: #6c757d;
    font-weight: 600;
    margin: .25rem 0 .25rem;
}
.calendar-weekdays > div { text-align: center; font-size: .9rem; }
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.day-cell {
    min-height: 110px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: .5rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.day-cell .date-num { font-weight: 700; color: #333; }
.day-cell.muted { opacity: .55; }
.day-cell.today { outline: 2px solid #667eea; outline-offset: -2px; background: #eef2ff; }
.event-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem .4rem;
    border-radius: 999px;
    background: #eef6ff;
    color: #0b5ed7;
    font-size: .78rem;
    line-height: 1.2;
    max-width: 100%;
}
.event-chip .event-time { font-weight: 700; white-space: nowrap; }
.event-chip .event-name { font-weight: 600; color: #0b5ed7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-empty {
    text-align: center;
    color: #6c757d;
    margin-top: .75rem;
}

/* Calendar hover popover */
.calendar-popover {
    position: absolute;
    z-index: 1000;
    min-width: 260px;
    max-width: 340px;
    background: #fff;
    color: #333;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    padding: .75rem .85rem;
    border: 1px solid #eef2f7;
    pointer-events: none; /* Do not capture mouse so leaving the chip hides it */
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .12s ease, transform .12s ease;
}
.calendar-popover.show {
    opacity: 1;
    transform: translateY(0);
}
.calendar-popover .cp-title {
    font-weight: 700;
    margin-bottom: .25rem;
}
.calendar-popover .cp-line {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    font-size: .92rem;
    color: #555;
    margin: .15rem 0;
}
.calendar-popover .cp-label { font-weight: 600; color: #445; }
.calendar-popover .cp-desc {
    margin-top: .35rem;
    font-size: .9rem;
    color: #555;
}

.class-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.class-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.class-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.class-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.class-type {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.class-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

/* Concise meta lines for instructor/classes */
.meta-line {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #555;
    margin: .25rem 0;
}
.meta-line i { color: #667eea; width: 16px; }

/* Allow multi-line content on meta rows that include larger text (e.g., description) */
.meta-line.meta-multiline {
    align-items: flex-start;
}
.meta-line.meta-multiline .value {
    flex: 1;
    white-space: normal;
}

/* Small chips for quick facts */
.chip {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: #f1f3f5;
    color: #495057;
    font-size: .8rem;
    font-weight: 600;
}

/* Slots info line */
.slots-info {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: .5rem;
    color: #198754; /* Bootstrap success-ish */
    font-weight: 600;
}
.slots-info.unlimited { color: #0b5ed7; }

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.detail-item i {
    color: #667eea;
    width: 16px;
}

.instructor {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.instructor-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.3rem;
}

.instructor-bio {
    font-size: 0.9rem;
    color: #666;
}

.book-btn {
    width: 100%;
    padding: 1rem;
    min-height: 44px; /* Touch target */
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.book-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.hidden {
    display: none;
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* Responsive Design */
/* Large tablets and down */
@media (max-width: 992px) {
    .hero { padding: 3rem 0; }
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.05rem; }
}

/* Tablets and down */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .hero { padding: 2.5rem 0; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }

    .class-details { grid-template-columns: 1fr; }
    .class-card { padding: 1.1rem; }
    .schedule-grid { gap: 1.25rem; }

    nav ul {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Small phones */
@media (max-width: 576px) {
    .container { padding: 0 12px; }
    .schedule-grid { grid-template-columns: 1fr; }
    .class-card { padding: .9rem; border-radius: 12px; }
    .class-header { flex-direction: column; gap: .5rem; }
    .class-name { font-size: 1.15rem; }
    .filter-btn { padding: .6rem 1rem; }
}

/* Form styles */
.form {
    display: grid;
    gap: 1rem;
}

.form label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    color: #333;
    font-weight: 600;
}

.form input[type="text"],
.form input[type="number"],
.form input[type="datetime-local"],
.form select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    text-align: left;
}

.form input[type="text"]::placeholder,
.form input[type="number"]::placeholder,
.form input[type="datetime-local"]::placeholder {
    color: #999;
}

.form .actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

/* Admin table compact on mobile */
@media (max-width: 768px) {
    table { font-size: .9rem; }
    table th, table td { padding: .4rem .5rem !important; }
}
