:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    background-color: #f3f4f6;
    /* Fallback/Base color */
    overflow-x: hidden;
    /* Prevent horizontal scroll from pseudo if any */
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('custom_bg.png') no-repeat center center fixed;
    background-size: cover;
    opacity: 0.65;
    /* 35% Transparency */
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.65);
    /* 35% Transparent */
    backdrop-filter: blur(10px);
    /* Glassmorphism effect */
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #111827;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out;
    box-sizing: border-box;
    /* Fix padding issues */
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

button:hover {
    background-color: var(--primary-hover);
}

/* Calendar specifics */
input[type="date"] {
    position: relative;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.time-slot {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.time-slot:hover {
    background-color: #f9fafb;
    border-color: var(--primary-color);
}

.time-slot.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.time-slot.disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.hidden {
    display: none;
}

/* Responsive Table Styles */
.table-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
}

.responsive-table th,
.responsive-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 0.95rem;
}

.responsive-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.badge {
    background-color: #dbeafe;
    color: #1e40af;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Action Buttons */
.btn-icon {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    text-decoration: none;
    color: #374151;
    display: inline-block;
}

.btn-icon:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

.btn-delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
}

/* Mobile Responsive (Stack View) */
@media screen and (max-width: 768px) {
    .admin-container {
        padding: 20px !important;
        /* Reduce padding on mobile */
    }

    /* Center header content */
    .admin-container>div:first-child {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .admin-container>div:first-child>div:last-child {
        justify-content: center;
    }

    .responsive-table thead {
        display: none;
        /* Hide header on mobile */
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
        /* Ensure padding doesn't overflow width */
    }

    .responsive-table tr {
        margin-bottom: 15px;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        padding: 5px;
        /* Inner spacing */
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 10px;
        border-bottom: 1px solid #f3f4f6;
        font-size: 0.9rem;
    }

    .responsive-table td:last-child {
        border-bottom: none;
        justify-content: center;
        /* Center actions */
        padding-top: 15px;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        text-align: left;
        flex-basis: 40%;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close {
    color: #aaa;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Flatpickr Custom Styles */
.weekend-date {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
}

.booked-date {
    background: #eab308 !important;
    color: white !important;
    border-color: #eab308 !important;
}

/* Only disable interaction if explicitly disabled (Visitor View) */
.weekend-date.flatpickr-disabled,
.booked-date.flatpickr-disabled {
    cursor: not-allowed !important;
    pointer-events: none;
    /* Ensure unclickable */
}

.available-date {
    background: #22c55e !important;
    color: white !important;
    border-color: #22c55e !important;
}

/* Ensure disabled dates are not clickable */
.flatpickr-day.flatpickr-disabled {
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile Calendar Fixes */
@media screen and (max-width: 480px) {
    .flatpickr-calendar {
        width: 300px !important;
        /* Force fit small screens */
        left: 50% !important;
        transform: translateX(-50%) !important;
        /* Center horizontally */
    }

    .flatpickr-days {
        width: 300px !important;
    }

    .dayContainer {
        width: 300px !important;
        min-width: 300px !important;
        max-width: 300px !important;
    }

    .flatpickr-day {
        max-width: 38px !important;
        height: 38px !important;
        line-height: 38px !important;
        font-size: 0.9rem !important;
        /* Slightly smaller text */
    }
}