/* My Bookings Page Styles */

:root {
    --booking-card-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --badge-pending: #f59e0b;
    --badge-confirmed: #10b981;
    --badge-in-progress: #3b82f6;
    --badge-completed: #6366f1;
    --badge-cancelled: #ef4444;
    --badge-no-show: #a855f7;
}

.bookings-hero {
    background: linear-gradient(120deg, var(--primary) 0%, #1e293b 100%);
    color: #fff;
    padding: 48px 0;
}

.bookings-hero .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.bookings-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.bookings-hero p {
    font-size: 1.05rem;
    opacity: 0.9;
    margin: 0;
    max-width: 520px;
}

.bookings-hero .hero-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.bookings-hero .hero-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.bookings-summary {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 20px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: 0 16px 50px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
}

.summary-card .summary-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
    margin-bottom: 12px;
}

.summary-card .summary-value {
    font-size: 2.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.summary-card .summary-subtitle {
    font-size: 0.9rem;
    opacity: 0.7;
}

.bookings-content {
    background: #f8fafc;
    padding: 48px 0 64px;
    min-height: 60vh;
}

.bookings-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--booking-card-shadow);
    border: 1px solid rgba(15, 23, 42, 0.04);
}

.bookings-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.bookings-toolbar .filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.bookings-toolbar select {
    appearance: none;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    background: #fff;
    font-size: 0.95rem;
    color: #1f2937;
    min-width: 180px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.work-time-editor {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    padding: 24px 28px;
    margin-bottom: 36px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.work-time-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.work-time-copy h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.work-time-copy .section-subtitle {
    color: #475569;
    margin: 0;
    max-width: 620px;
}

.work-time-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.work-time-controls select {
    appearance: none;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    font-size: 0.93rem;
    min-width: 190px;
    color: #1f2937;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.work-time-controls select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 147, 111, 0.18);
}

.work-time-table {
    margin-top: 22px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.work-time-scroll {
    overflow-x: auto;
}

.work-time-grid table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.work-time-grid thead {
    background: #f1f5f9;
}

.work-time-grid th,
.work-time-grid td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    font-size: 0.92rem;
    color: #1f2937;
    vertical-align: top;
}

.work-time-grid tbody tr:hover {
    background: rgba(241, 245, 249, 0.6);
}

.work-time-series {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.work-time-service {
    font-weight: 600;
    color: #0f172a;
}

.work-time-series .series-meta {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.series-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-size: 0.78rem;
    font-weight: 600;
}

.reference-badge {
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
}

.work-time-datetime {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #334155;
}

.work-time-datetime .time-range {
    font-size: 0.85rem;
    color: #0f172a;
    font-weight: 600;
}

.work-time-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.work-time-status.pending {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.work-time-status.confirmed {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.work-time-status.in_progress {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.work-time-status.completed {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
}

.work-time-status.cancelled,
.work-time-status.no_show {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.work-time-status.badge-neutral {
    background: rgba(148, 163, 184, 0.18);
    color: #475569;
}

.work-time-location {
    color: #475569;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.work-time-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.work-time-actions .btn {
    padding: 8px 14px;
    font-size: 0.82rem;
}

.work-time-empty {
    text-align: center;
    padding: 36px 20px;
    color: #64748b;
}

.work-time-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: rgba(37, 99, 235, 0.4);
}

.work-time-empty p {
    max-width: 420px;
    margin: 0 auto;
}

.work-time-loading {
    padding: 28px 20px;
}

@media (max-width: 1024px) {
    .bookings-sections {
        grid-template-columns: 1fr;
    }

    .work-time-copy h2 {
        font-size: 1.3rem;
    }

    .work-time-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .work-time-controls select {
        flex: 1 1 200px;
    }
}

@media (max-width: 640px) {
    .work-time-editor {
        padding: 20px;
    }

    .work-time-controls {
        gap: 10px;
    }

    .work-time-controls select {
        min-width: 0;
        width: 100%;
    }

    .work-time-grid table {
        min-width: 640px;
    }
}

.bookings-sections {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
}

.bookings-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bookings-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
}

.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.booking-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.booking-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.booking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.booking-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.booking-subtitle {
    margin-top: 4px;
    font-size: 0.95rem;
    color: #475569;
}

.booking-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.08);
    color: #1e293b;
}

.status-badge i {
    font-size: 0.8rem;
}

.status-pending { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.status-confirmed { background: rgba(16, 185, 129, 0.16); color: #047857; }
.status-in_progress { background: rgba(59, 130, 246, 0.16); color: #1d4ed8; }
.status-completed { background: rgba(99, 102, 241, 0.16); color: #4338ca; }
.status-cancelled { background: rgba(239, 68, 68, 0.16); color: #b91c1c; }
.status-no_show { background: rgba(168, 85, 247, 0.16); color: #7e22ce; }

.booking-meta {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.meta-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: #475569;
    font-size: 0.95rem;
}

.meta-item i {
    color: var(--primary);
    margin-top: 3px;
}

.booking-actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.booking-actions .btn {
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.booking-details {
    margin-top: 18px;
    border-top: 1px dashed rgba(148, 163, 184, 0.35);
    padding-top: 16px;
    display: none;
    color: #475569;
    font-size: 0.95rem;
}

.booking-card.expanded .booking-details {
    display: block;
}

.empty-state {
    padding: 40px 30px;
    background: #fff;
    border-radius: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    text-align: center;
    color: #475569;
    box-shadow: var(--booking-card-shadow);
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.loading-state {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #475569;
}

.loading-state i {
    font-size: 1.6rem;
    color: var(--primary);
}

.bookings-badge-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.badge-small {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.location-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(49, 130, 206, 0.12);
    color: #1e3a8a;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-icon {
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.btn-icon:hover { background: rgba(148, 163, 184, 0.2); }

.location-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.location-modal[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

.location-modal__dialog {
    width: 100%;
    max-width: 640px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.location-modal__header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.location-modal__header h2 {
    font-size: 1.35rem;
    margin: 0 0 6px 0;
    color: #0f172a;
}

.location-modal__subtitle {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.location-modal__form {
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row label {
    display: block;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
}

.form-row textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.field-hint {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 0.85rem;
}

.location-coordinates {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border: 1px dashed #cbd5f5;
    border-radius: 12px;
    background: #f8fbff;
}

.location-coordinates > div {
    min-width: 120px;
}

.coordinate-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.coordinate-value {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 600;
}

.location-modal__alert {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.location-modal__alert.error {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.location-modal__alert.success {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.location-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

#saveLocationUpdate .loading-label {
    display: none;
    gap: 8px;
    align-items: center;
}

#saveLocationUpdate.saving .default-label { display: none; }
#saveLocationUpdate.saving .loading-label { display: inline-flex; }

@media (max-width: 640px) {
    .location-modal__dialog { border-radius: 12px; }
    .location-modal__header { flex-direction: column; }
    .location-coordinates { flex-direction: column; align-items: flex-start; }
    .location-modal__footer { flex-direction: column; }
    .location-modal__footer .btn { width: 100%; }
}

@media (max-width: 1024px) {
    .bookings-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bookings-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .bookings-hero {
        padding: 36px 0;
    }

    .bookings-hero h1 {
        font-size: 2rem;
    }

    .bookings-summary {
        grid-template-columns: 1fr;
    }

    .bookings-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .bookings-toolbar select {
        width: 100%;
    }
}
