/* Reset and Base styles */
:root {
    --primary-color: #4e54c8;
    --secondary-color: #00b09b;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    --light-bg: #f8f9fa;
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --primary-gradient: linear-gradient(135deg, #4f46e5, #6366f1);
    --secondary-gradient: linear-gradient(135deg, #0ea5e9, #38bdf8);
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
}

/* Base & Layout */
body {
    background-color: #f8f9ff;
    font-family: Arial, sans-serif;
}

/* General Styles */
.navbar-brand img {
    height: 40px;
    margin-right: 10px;
}

.container img {
    height: 120px;
}

.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: white;
    padding: 20px 0;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

.time-slot-card {
    padding: 1rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    height: 100%;
}

.time-slot-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.btn-check:checked + .time-slot-card {
    background: var(--primary-gradient);
    color: white;
}

.btn-check:checked + .time-slot-card .text-muted {
    color: rgba(255,255,255,0.8) !important;
}

.quota-info {
    padding-left: 1rem;
    border-left: 1px solid rgba(0,0,0,0.1);
    padding-top: 0.5rem;
    text-align: center;
}

.btn-check:checked + .time-slot-card .quota-info {
    border-left-color: rgba(255,255,255,0.2);
}

/* Navbar Styling */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Main Content Area */
.main-content {
    margin-bottom: 70px;
    padding: 2rem 0;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.stat-card:nth-child(1) {
    background: var(--primary-gradient);
}

.stat-card:nth-child(2) {
    background: var(--secondary-gradient);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h5 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.stat-card p {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.stat-card .icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.2;
}

/* Data Table Card */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 20px;
    border-radius: 15px 15px 0 0 !important;
}

.card-title {
    color: #2c3e50;
    margin-bottom: 0;
    font-weight: 600;
}

/* Search Form */
.input-group {
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    overflow: hidden;
}

.form-control {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    width: 100%;
    padding: 0.75rem 1rem;
}

.form-control:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

/* Table Styling */
.table {
    margin: 0;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #eee;
    color: #444;
    font-weight: 600;
    padding: 1rem;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: #f8f9ff;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Pagination */
.pagination {
    margin: 20px 0 0;
    justify-content: center;
}

.page-link {
    border: none;
    padding: 10px 15px;
    margin: 0 5px;
    border-radius: 8px;
    color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--primary-gradient);
    color: white;
}

/* Form Container */
.form-container {
    background-color: #f3f4f6;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 2rem auto;
    border: 1px solid #e5e7eb;
}

/* Form Groups */
.mb-3 {
    background-color: #ffffff;
    padding: 1rem;
    margin-bottom: 1.5rem !important;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* Labels */
.form-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.9rem;
}

/* Required Field Indicator */
.text-danger {
    color: #dc2626 !important;
    margin-left: 4px;
}

/* Input Fields */
.form-control {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

/* Date Input Specific */
input[type="date"].form-control {
    height: calc(1.5em + 1rem + 2px);
    padding: 0.5rem 1rem;
}

/* Select Dropdown */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

/* Helper Text */
.text-muted {
    color: #6b7280 !important;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Validation States */
.form-control.is-invalid {
    border-color: #dc2626;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc2626'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc2626' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 15px;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .table {
        font-size: 14px;
    }
    
    .main-content {
        padding: 10px;
    }

    .form-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on mobile */
    }
}

@media print {
    .no-print {
        display: none !important;
    }
}

/* Settings Page Styles */
.btn-lg {
    padding: 0.75rem 1.25rem;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.g-4 {
    --bs-gutter-x: 2rem;
    --bs-gutter-y: 2rem;
}

/* A5 Print Styles */
@media screen {
    .confirmation-card {
        width: 148mm;
        min-height: 210mm;
        margin: 20px auto;
        padding: 20px;
        background: white;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
        border-radius: 12px;
    }
}

@media print {
    @page {
        size: A5 portrait;
        margin: 0;
    }
    
    body {
        margin: 0;
        padding: 0;
    }
    
    .confirmation-card {
        width: 148mm;
        min-height: 210mm;
        padding: 15mm;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }
    
    .no-print {
        display: none !important;
    }

    .table {
        font-size: 12pt;
    }
}

/* Booking Confirmation Styles */
.booking-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.booking-code {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 2rem;
}

.confirmation-table {
    margin-bottom: 0;
}

.confirmation-table th {
    background-color: #f8fafc !important;
    font-weight: 600;
    color: #475569;
    width: 30%;
}

.confirmation-table td {
    color: #1e293b;
}

.confirmation-table th,
.confirmation-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.print-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

.qr-container {
    display: inline-block;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.qr-container img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Date Picker Styles */
.date-picker-container {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    padding: 1rem;
    width: 100%;
    max-width: 300px;
}

.date-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.month-nav {
    background: var(--primary-gradient);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(30px, 1fr));
    gap: 4px;
    text-align: center;
    margin-bottom: 0.5rem;
}

.weekday-header {
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.25rem 0;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
    width: 32px;
    height: 32px;
    margin: 0 auto;
    border: 1px solid transparent;
}

.calendar-day:not(.disabled):hover {
    background: var(--primary-gradient);
    color: white;
}

.calendar-day.selected {
    background: var(--primary-gradient);
    color: white;
}

.calendar-day.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.calendar-day.today {
    border: 2px solid var(--primary-color);
}

.date-info {
    text-align: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.875rem;
}

#currentMonth {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .date-picker-container {
        max-width: 100%;
    }
    
    .calendar-grid {
        gap: 2px;
    }
    
    .calendar-day {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}