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

:root {
    --primary-color: #1e3a8a;
    --primary-dark: #1e40af;
    --secondary-color: #0ea5e9;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #cbd5e1;
    --bg-light: #f1f5f9;
    --bg-white: #ffffff;
    --nautical-blue: #0c4a6e;
    --nautical-light: #e0f2fe;
    --shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
    --shadow-hover: 0 4px 12px rgba(15, 23, 42, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0c4a6e 0%, #0284c7 50%, #0ea5e9 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 10px;
    color: var(--text-color);
    line-height: 1.5;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px
        );
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 15px;
    padding: 15px 20px;
    position: relative;
}

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

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 300;
    letter-spacing: 0.3px;
}

.form-container {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.booking-form {
    padding: 20px;
}

.form-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--nautical-blue);
    font-weight: 700;
    letter-spacing: 0.3px;
    position: relative;
    padding-bottom: 8px;
}

.form-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.85rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
    background: var(--nautical-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.duration-display {
    margin-top: 10px;
    padding: 12px;
    background: linear-gradient(135deg, var(--nautical-light) 0%, var(--bg-light) 100%);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.05);
}

.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
    font-size: 0.85rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    margin-top: 2px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 3px;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.price-summary {
    background: linear-gradient(135deg, var(--nautical-light) 0%, var(--bg-light) 100%);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.05);
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.95rem;
}

.price-row.total {
    border-top: 3px solid var(--primary-color);
    margin-top: 8px;
    padding-top: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--nautical-blue);
}

.form-actions {
    text-align: center;
}

.btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--nautical-blue) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Loading and Success States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Message Overlay */
.message-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.message-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.message-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.message-overlay.show .message-container {
    transform: scale(1);
}

.success-message {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    padding: 30px 40px;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.6;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.error-message {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    padding: 30px 40px;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.6;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section {
    animation: fadeIn 0.5s ease-out;
}

/* Calendar Styles */
.calendar-container {
    background: linear-gradient(to bottom, var(--nautical-light) 0%, var(--bg-light) 100%);
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.05);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.calendar-nav-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--nautical-blue) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.3);
}

.calendar-nav-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.calendar-nav-btn:active {
    transform: scale(0.95);
}

.calendar-month-year {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.calendar-today-container {
    text-align: center;
    margin-bottom: 6px;
}

.btn-today {
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.3);
    letter-spacing: 0.3px;
}

.btn-today:hover {
    background: #0099cc;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-today:active {
    transform: translateY(0);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.7rem;
    padding: 4px 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--border-radius) * 0.75);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    background: white;
    border: 2px solid transparent;
    font-size: 0.75rem;
    min-height: 0;
    padding: 4px;
}

.calendar-day:hover:not(.disabled):not(.fully-booked) {
    transform: scale(1.05);
    z-index: 1;
    box-shadow: var(--shadow);
}

.calendar-day.disabled {
    color: #999;
    cursor: not-allowed;
    background: #e9ecef;
    border-color: #dee2e6;
    opacity: 0.7;
}

.calendar-day.available {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: var(--nautical-blue);
    border-color: #93c5fd;
}

.calendar-day.available:hover:not(.selected) {
    background: #c3e6cb;
    border-color: var(--primary-color);
}

.calendar-day.partially-booked {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: #fcd34d;
}

.calendar-day.partially-booked:hover:not(.selected) {
    background: #ffeaa7;
    border-color: var(--primary-color);
}

.calendar-day.fully-booked {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    cursor: not-allowed;
}

.calendar-day.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--nautical-blue) 100%);
    color: white;
    border-color: var(--accent-color);
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.4), 0 4px 8px rgba(30, 58, 138, 0.3);
}

.calendar-day.selected:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.calendar-day.today {
    font-weight: 700;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 2px solid transparent;
}

.legend-color.available {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #93c5fd;
}

.legend-color.partially-booked {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fcd34d;
}

.legend-color.fully-booked {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.legend-color.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--nautical-blue) 100%);
    border-color: var(--accent-color);
}

/* Time Slots */
.time-slots-container {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 15px;
}

.time-slots-container h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    justify-items: center;
    max-width: 700px;
    margin: 0 auto;
}

.time-slot {
    padding: 10px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

.time-slot:hover:not(.unavailable):not(.selected) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--nautical-light) 0%, #dbeafe 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.2);
}

.time-slot.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--nautical-blue) 100%);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
}

.time-slot.selected:hover {
    background: var(--primary-color);
    transform: none;
}

.time-slot.selected span {
    color: rgba(255, 255, 255, 0.9);
}

.time-slot strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1rem;
}

.time-slot span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
}

.time-slot.unavailable {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .booking-form {
        padding: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-section {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }

    .form-section h2 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    .form-group input[type="date"],
    .form-group input[type="time"],
    .form-group input[type="number"],
    .form-group select,
    .form-group textarea {
        padding: 7px 10px;
        font-size: 0.85rem;
    }

    .form-group textarea {
        min-height: 70px;
    }

    .checkbox-label {
        font-size: 0.8rem;
    }

    .checkbox-label input[type="checkbox"] {
        width: 15px;
        height: 15px;
        margin-right: 6px;
    }

    .calendar-container {
        padding: 8px;
        margin-bottom: 12px;
    }

    .calendar-grid {
        gap: 2px;
        margin-bottom: 8px;
        max-width: 100%;
    }

    .calendar-day {
        font-size: 0.7rem;
        padding: 2px;
    }

    .calendar-day-header {
        font-size: 0.65rem;
        padding: 3px 2px;
    }

    .calendar-month-year {
        font-size: 0.85rem;
    }

    .calendar-nav-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .calendar-legend {
        gap: 8px;
        font-size: 0.7rem;
    }

    .time-slots-container {
        padding: 10px;
        margin-bottom: 12px;
    }

    .time-slots-container h3 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .time-slots-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .time-slot {
        padding: 8px;
        font-size: 0.85rem;
    }

    .duration-display {
        padding: 10px;
        margin-top: 8px;
    }

    .price-summary {
        padding: 12px;
        margin-bottom: 15px;
    }

    .price-row {
        font-size: 0.9rem;
        padding: 4px 0;
    }

    .price-row.total {
        font-size: 1.05rem;
        margin-top: 6px;
        padding-top: 8px;
    }

    .btn {
        padding: 10px 25px;
        font-size: 0.95rem;
    }
}


/* Admin Dashboard */
.admin-container {
    max-width: 1100px;
}

.admin-header {
    margin-bottom: 20px;
}

.admin-nav {
    margin-top: 10px;
}

.admin-nav-link {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.95rem;
}

.admin-nav-link:hover {
    text-decoration: underline;
}

.admin-main {
    padding-bottom: 20px;
}

.admin-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.admin-filter-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.admin-btn-secondary {
    background: white;
    color: var(--nautical-blue);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.admin-btn-secondary:hover {
    background: var(--nautical-light);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.admin-stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 15px 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.admin-stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.admin-stat-value {
    display: block;
    margin-top: 6px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--nautical-blue);
}

.admin-table-section .admin-table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.admin-table thead {
    background: var(--nautical-blue);
    color: white;
}

.admin-table th {
    font-weight: 600;
    white-space: nowrap;
}

.admin-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.admin-table tbody tr:hover {
    background: #e0f2fe;
}

.admin-table-empty {
    text-align: center;
    padding: 20px 10px;
    color: var(--text-light);
}

.admin-actions-cell {
    white-space: nowrap;
}

.admin-btn-cancel {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.admin-btn-cancel:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.admin-btn-cancel:active {
    transform: translateY(0);
}

.admin-cancelled-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: calc(var(--border-radius) * 0.75);
    font-size: 0.8rem;
    font-weight: 500;
}

/* TimeSlot Management */
.admin-timeslots-section {
    margin-top: 30px;
}

.admin-timeslot-form {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
}

.admin-timeslot-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.admin-timeslot-form small {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-light);
}

.admin-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.admin-btn-edit {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.3);
    margin-right: 8px;
}

.admin-btn-edit:hover {
    background: linear-gradient(135deg, #0099cc 0%, var(--secondary-color) 100%);
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
}

.admin-btn-edit:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4),
    .admin-table th:nth-child(7),
    .admin-table td:nth-child(7) {
        display: none;
    }

    .admin-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
