/* Food Pickup Reservation App Styles */

:root {
    --primary-color: #a32421;
    --accent-color: #d96459;
    --background-color: #fff7ef;
    --text-color: #1e1e1e;
    --border-radius: 14px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

.logout-form {
    display: inline;
}

/* Announcement Banner */
.announcement-banner {
    background: var(--accent-color);
    color: white;
    text-align: center;
    padding: 0.75rem 0;
}

.announcement-banner p {
    font-weight: 500;
}

/* Main Content */
.main {
    flex: 1;
    padding: 2rem 0;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    min-height: 44px;
}

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

.btn-primary:hover {
    background: #8a1e1b;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--accent-color);
    color: white;
}

.btn-secondary:hover {
    background: #c55a50;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-success {
    background: #059669;
    color: white;
}

.btn-success:hover {
    background: #047857;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 52px;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(163, 36, 33, 0.1);
}

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

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Date and Time Selection */
.date-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.date-option {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.date-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.date-option:active {
    transform: translateY(0);
    transition: all 0.05s ease;
}

.date-option.selected {
    border-color: var(--primary-color);
    background: rgba(163, 36, 33, 0.05);
}

.date-day {
    font-weight: 600;
    color: var(--text-color);
}

.date-date {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Time Slots */
.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.time-slot {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}

.time-slot:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.time-slot:active {
    transform: translateY(0);
    transition: all 0.05s ease;
}

.time-slot.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.time-slot.unavailable {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.time-slot.unavailable:hover {
    transform: none;
    border-color: #e5e7eb;
}

.slot-info {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* Reservation Details */
.reservation-details {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--text-color);
}

.detail-value {
    color: #6b7280;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-confirmed {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.status-completed {
    background: #dbeafe;
    color: #1e40af;
}

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

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--text-color);
}

.table tr:hover {
    background: #f9fafb;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.pagination a {
    background: white;
    color: var(--text-color);
    border: 2px solid #e5e7eb;
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    color: #6b7280;
}

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

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: var(--transition);
}

/* Opening Hours */
.opening-hours-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.opening-hours-day {
    width: 100px;
    font-weight: 500;
    flex-shrink: 0;
}

.opening-hours-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    /* Admin header: hamburger layout */
    .mobile-menu-toggle {
        display: flex;
    }

    .admin-header .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
    }

    .admin-header .nav {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 1rem;
        gap: 0;
        border-top: 1px solid #e5e7eb;
        margin-top: 1rem;
    }

    .admin-header .nav.open {
        display: flex;
    }

    .admin-header .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid #f3f4f6;
    }

    .admin-header .logout-form {
        padding-top: 0.5rem;
    }

    .admin-header .logout-form .btn {
        width: 100%;
    }

    .date-picker {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .time-slots {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }

    .card {
        padding: 1.5rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn:last-child {
        margin-bottom: 0;
    }

    /* Keep table action buttons inline */
    .table .btn,
    td .btn {
        width: auto;
        margin-bottom: 0.25rem;
    }

    /* Table responsive */
    .table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Opening hours responsive */
    .opening-hours-row {
        flex-direction: column;
        align-items: stretch;
    }

    .opening-hours-day {
        width: auto;
        font-size: 1.05rem;
        padding-bottom: 0.25rem;
        border-bottom: 1px solid #e5e7eb;
    }

    .opening-hours-field {
        justify-content: space-between;
    }

    .opening-hours-row > .btn {
        width: 100%;
    }

    /* Pagination */
    .pagination a,
    .pagination span {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 1rem 0;
    }

    .card {
        padding: 1rem;
    }

    .date-picker {
        grid-template-columns: repeat(2, 1fr);
    }

    .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }

    .card-title {
        font-size: 1.25rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.8rem;
    }
}
