/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #555;
}

/* Navigation */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-brand {
    font-size: 20px;
    font-weight: bold;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-right span {
    opacity: 0.9;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

/* Form styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.form-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.form-inline input {
    flex: 1;
    min-width: 150px;
}

.form-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.form-section h3 {
    margin: 15px 0 10px 0;
    color: #555;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: #fc8181;
    color: white;
}

.btn-danger:hover {
    background: #f56565;
}

.btn-secondary {
    background: #a0aec0;
    color: white;
}

.btn-secondary:hover {
    background: #718096;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

/* Tables */
.table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.table thead {
    background: #2c3e50;
    color: white;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
}

.table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.table tbody tr:hover {
    background: #edf2f7;
}

/* Status badges */
.status-pending {
    color: #ed8936;
    font-weight: bold;
}

.status-approved {
    color: #48bb78;
    font-weight: bold;
}

.status-rejected {
    color: #fc8181;
    font-weight: bold;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 5px;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.alert-danger {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.alert-warning {
    background: #fefcbf;
    color: #744210;
    border: 1px solid #f6e05e;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-section {
    background: white;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-section h2 {
    margin-bottom: 15px;
}

.booking-form .form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .nav-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .container {
        padding: 15px;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
    }
    
    .form-inline {
        flex-direction: column;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    /* Additional styles for booking form */
.date-type-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.date-type-group input[type="date"] {
    flex: 1;
    min-width: 150px;
}

.date-type-options {
    display: flex;
    gap: 20px;
    align-items: center;
}

.date-type-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    cursor: pointer;
}

.date-range-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.date-range-group label {
    font-weight: normal;
}

.participants-group {
    display: flex;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.participants-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    cursor: pointer;
}

#gradeLevelContainer {
    margin-left: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #667eea;
}

#imagePreviewContainer {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border: 1px dashed #ccc;
}

#imagePreviewContainer h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #555;
}

#imagePreview {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

#fileNameDisplay {
    margin: 5px 0 10px 0;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .date-type-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-type-options {
        justify-content: center;
    }
    
    .participants-group {
        gap: 10px;
    }
    
    .date-range-group {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Time input styles for 24-hour format */
.time-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-input-group input[type="text"].time-input-24h {
    flex: 1;
    min-width: 150px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    letter-spacing: 2px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: border-color 0.3s;
}

.time-input-group input[type="text"].time-input-24h:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.time-input-group input[type="text"].time-input-24h::placeholder {
    color: #aaa;
    font-size: 14px;
    letter-spacing: normal;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.time-format-hint {
    font-size: 12px;
    color: #888;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    font-weight: 600;
}

/* Error state for time inputs */
.time-input-group input[type="text"].time-input-24h.error {
    border-color: #fc8181;
    background-color: #fff5f5;
}

/* Responsive */
@media (max-width: 768px) {
    .time-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .time-format-hint {
        align-self: flex-start;
    }
}

/* In your style section */
.booking-card.is-recurring {
    border-left-color: #ed8936;
    background: #fffbeb;
}

.booking-card.is-recurring .recurring-badge {
    background: #ed8936;
    color: white;
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 12px;
    margin-left: 6px;
}

.booking-card.is-recurring-expanded {
    border-left-style: dashed;
    border-left-color: #f6ad55;
    background: #fffaf0;
}

/* Month Grid - Fixed */
.month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.month-card {
    background: #fafcff;
    border-radius: 12px;
    padding: 16px 14px 14px;
    border: 1px solid #e8ecf0;
    transition: all 0.2s;
}

.month-card:hover {
    border-color: #4299e1;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.06);
}

.month-card .month-title {
    font-weight: 700;
    color: #1a202c;
    font-size: 17px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8ecf0;
    margin-bottom: 10px;
}

.month-card .weekday-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 5px;
}

.month-card .weekday-row .weekday-label {
    font-size: 13px;
    font-weight: 700;
    color: #718096;
    text-align: center;
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month-card .day-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

/* Day cell styling - no extra text */
.month-card .day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 44px;
    position: relative;
    background: white;
    text-align: center;
}

.month-card .day-cell .day-number {
    font-weight: 600;
    color: #2d3748;
    font-size: 15px;
    line-height: 1;
}

.month-card .day-cell .day-number.weekend {
    color: #fc8181;
}

.month-card .day-cell .day-number.other-month {
    color: #cbd5e0;
}

/* Booking dot - positioned below the day number */
/* Support for multiple dots on the same day */
.month-card .day-cell .booking-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 2px;
    transition: all 0.2s;
    display: inline-block;
    vertical-align: middle;
}

.month-card .day-cell .booking-dot.has-booking {
    background: #4299e1;
}

.month-card .day-cell .booking-dot.has-your-booking {
    background: #38b2ac;
    width: 10px;
    height: 10px;
}

/* Container for multiple dots */
.month-card .day-cell .dots-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-top: 2px;
}

/* Today highlight */
.month-card .day-cell.today-cell {
    background: #ebf8ff !important;
    border: 2px solid #4299e1 !important;
    border-radius: 6px;
}

.month-card .day-cell:hover {
    background: #edf2f7;
}

.month-card .day-cell.has-booking:hover {
    background: #ebf8ff;
}

/* TOOLTIP */
.month-card .day-cell .booking-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a202c;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    white-space: normal;
    z-index: 1000;
    min-width: 220px;
    max-width: 300px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    line-height: 1.5;
    pointer-events: none;
}

.month-card .day-cell .booking-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a202c;
}

.month-card .day-cell.has-booking:hover .booking-tooltip {
    display: block;
}

.month-card .day-cell .booking-tooltip .tooltip-item {
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.month-card .day-cell .booking-tooltip .tooltip-item:last-child {
    border-bottom: none;
}

.month-card .day-cell .booking-tooltip .tooltip-item .tt-event {
    font-weight: 600;
    color: #fff;
}

.month-card .day-cell .booking-tooltip .tooltip-item .tt-time {
    color: #90cdf4;
}

.month-card .day-cell .booking-tooltip .tooltip-item .tt-venue {
    color: #fbd38d;
}

.month-card .day-cell .booking-tooltip .tooltip-item .tt-teacher {
    color: #fbb6ce;
}

.month-card .day-cell .booking-tooltip .tooltip-item .tt-you {
    color: #38b2ac;
    font-weight: 600;
}

.month-card .day-cell .booking-tooltip .tooltip-item > div {
    white-space: normal;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px; /* Adds a tiny space between wrapped words */
}

.month-card .day-cell .booking-tooltip .tooltip-item .tt-created {
    color: #a0aec0;
    font-size: 11px;
    display: block;
    margin-top: 2px;
}

.month-card .day-cell .booking-tooltip .tooltip-item .tt-created .tt-label {
    color: #718096;
}

.recurring-days {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.recurring-days label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: normal;
    cursor: pointer;
    padding: 4px 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.recurring-days label:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.recurring-days label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.recurring-days label input[type="checkbox"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.month-card .month-title {
    font-weight: 700 !important;
    color: #1a202c;
    font-size: 17px;
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8ecf0;
    margin-bottom: 10px;
}

.month-card .day-cell.has-booking:hover {
    background: #edf2f7 !important;
}
}