/* court_details.php specific styles */

.cd-page {
    background: #f5f3ff;
    min-height: 100vh;
    padding-bottom: 4rem;
}

/* Hero card */
.cd-hero-card {
    background: #fff;
    border: 1px solid #e0e7ff;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.cd-hero-img-wrap {
    flex: 0 0 400px;
    max-width: 400px;
    background: #0f0f1a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1.5rem;
}

.cd-hero-img-wrap img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 260px;
    border-radius: 10px;
    display: block;
}

.cd-hero-info {
    flex: 1;
    padding: 2rem 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #fff;
}

.cd-badge-new {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.18rem 0.55rem;
    background: #a5b4fc;
    color: #1e1b4b;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.cd-venue-name {
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}

.cd-venue-meta {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.cd-venue-meta i {
    margin-right: 0.3rem;
}

.cd-price-hero {
    align-self: flex-start;
    margin-top: 1.25rem;
    background: linear-gradient(135deg, #1e1b4b, #16213e);
    border: 1px solid rgba(165, 180, 252, 0.3);
    color: #a5b4fc;
    font-weight: 800;
    font-size: 1.15rem;
    border-radius: 10px;
    padding: 0.45rem 1rem;
    white-space: nowrap;
}

.cd-price-hero small {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    opacity: 0.82;
    color: #a5b4fc;
}

@media (max-width: 700px) {
    .cd-hero-card {
        flex-direction: column;
    }

    .cd-hero-img-wrap {
        flex: unset;
        max-width: 100%;
        height: 190px;
        padding: 1rem;
    }

    .cd-hero-info {
        padding: 1.25rem 1.25rem 1rem;
    }

    .cd-venue-name {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .cd-hero-img-wrap {
        height: 160px;
    }

    .cd-hero-info {
        padding: 1rem 1rem 0.85rem;
    }

    .cd-venue-name {
        font-size: 1.2rem;
    }

    .cd-venue-meta {
        font-size: 0.78rem;
        gap: 0.6rem;
    }
}

.cd-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.cd-left {
    flex: 0 0 340px;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cd-right {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cd-card {
    background: #fff;
    border: 1px solid #e0e7ff;
    border-radius: 14px;
    padding: 1.35rem 1.5rem;
}

.cd-card-title {
    font-weight: 800;
    font-size: 1rem;
    color: #111827;
    margin: 0 0 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.cd-card-title i {
    color: #6366f1;
}

.cd-about-text {
    color: #4b5563;
    font-size: 0.93rem;
    line-height: 1.65;
    margin: 0;
}

.cd-amenities {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.cd-amenity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: #374151;
    font-weight: 500;
}

.cd-amenity i {
    color: #6366f1;
    font-size: 1rem;
    flex-shrink: 0;
}

.cd-hours-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #374151;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.cd-hours-row:last-child {
    border-bottom: none;
}

.cd-hours-day {
    font-weight: 600;
    color: #111827;
}

.cd-map-frame {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
}

.cd-map-frame iframe {
    width: 100%;
    height: 220px;
    border: none;
    display: block;
    vertical-align: top;
}

.cd-map-open-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: pointer;
    background: transparent;
}

.cd-map-open-overlay:hover {
    background: rgba(99, 102, 241, 0.06);
}

.cd-map-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cd-map-address {
    flex: 1;
    min-width: 0;
}

.cd-map-open-link {
    flex-shrink: 0;
    font-weight: 600;
    color: #6366f1;
    text-decoration: none;
    white-space: nowrap;
}

.cd-map-open-link:hover {
    text-decoration: underline;
    color: #4f46e5;
}

.cd-booking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cd-date-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cd-date-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    border: 1px solid #e0e7ff;
    background: #f9fafb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: #374151;
}

.cd-date-btn:hover {
    background: #e0e7ff;
    color: #111827;
}

.cd-date-label {
    font-weight: 800;
    font-size: 1.05rem;
    color: #111827;
}

.cd-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cd-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.cd-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.cd-leg-available {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
}

.cd-leg-booked {
    background: #e0e7ff;
    border: 1px solid #d1d5db;
}

.cd-leg-internal {
    background: #ffedd5;
    border: 1px solid #fb923c;
}

.cd-leg-openplay {
    background: #ecfeff;
    border: 1px solid #06b6d4;
}

.cd-grid-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cd-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cd-booking-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.cd-booking-table th {
    background: #f9fafb;
    color: #374151;
    font-weight: 700;
    padding: 0.65rem 0.75rem;
    text-align: center;
    border-bottom: 2px solid #e0e7ff;
    white-space: nowrap;
}

.cd-booking-table th:first-child {
    text-align: left;
    border-radius: 8px 0 0 0;
}

.cd-booking-table th:last-child {
    border-radius: 0 8px 0 0;
}

.cd-booking-table td {
    padding: 0.55rem 0.6rem;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.cd-booking-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    padding-left: 0.75rem;
}

.cd-booking-table tr:last-child td {
    border-bottom: none;
}

.cd-booking-table tr:hover td {
    background: #f9fafb;
}

.cd-no-court {
    color: #9ca3af;
    font-size: 0.8rem;
    font-style: italic;
}

.cd-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 70px;
    padding: 0.4rem 0.25rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-direction: column;
    line-height: 1.2;
}

.cd-slot-price {
    font-size: 0.8rem;
    color: #6366f1;
    font-weight: 800;
    margin-top: 2px;
    display: block;
}

.vm-bt-time-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.cd-slot-available {
    background: #ffffff;
    color: #4f46e5 !important;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cd-slot-available:hover {
    background: linear-gradient(135deg, #1e1b4b, #4f46e5);
    border-color: #4f46e5;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.cd-slot-booked {
    background: #e0e7ff;
    color: #9ca3af;
    border-color: #d1d5db;
    cursor: not-allowed;
    pointer-events: none;
}

.cd-slot-booked-pending {
    background: #fff9eb;
    border-color: #f59e0b;
    color: #b45309;
}

.cd-slot-internal {
    background: #ffedd5;
    color: #c2410c;
    border-color: #fb923c;
    cursor: not-allowed;
    pointer-events: none;
}

.cd-slot-nodata {
    background: #f9fafb;
    color: #d1d5db;
    border-color: #e0e7ff;
    cursor: not-allowed;
    pointer-events: none;
}

.pp-price-tag span {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    opacity: 0.82;
    color: #a5b4fc;
}

@media (max-width: 900px) {
    .cd-layout {
        flex-direction: column;
    }

    .cd-left {
        flex: unset;
        max-width: 100%;
        width: 100%;
        order: 2; /* About/Amenities below booking on mobile */
    }

    .cd-right {
        order: 1; /* Booking section first on mobile */
    }
}

/* Live Cam Styles */
.cd-live-cam-wrap {
    position: relative;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    aspect-ratio: 16 / 9;
    display: none;
    /* Hidden by default */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.cd-live-cam-wrap.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.cd-live-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cd-live-badge .pulse {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: pulse-live 1.2s infinite;
}

@keyframes pulse-live {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.cd-cam-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-cam-toggle {
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid #e0e7ff;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-cam-toggle.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    border-color: transparent;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Open Play Specifics ── */
.cd-open-play-card {
    background: #fff;
    border: 1px solid #e0e7ff;
    border-radius: 14px;
    overflow: hidden;
    margin-top: 1.5rem;
}

.cd-op-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.cd-op-header h5 {
    font-weight: 800;
    color: #111827;
    margin: 0;
}

.cd-op-body {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.cd-op-empty-icon {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
    display: block;
}

.cd-op-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 12px;
    padding: 1.5rem;
    color: #fff;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.op-live-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.op-status-pill {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
}

.op-join-btn-sm {
    border-radius: 999px;
    font-weight: 800;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

/* Booking Modal */
.bk-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, .6);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 32px 16px;
}

.bk-overlay.show {
    display: flex;
}

.bk-modal-wrap {
    width: 100%;
    max-width: 500px;
    height: min(90vh, 640px);
    margin: auto;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 70px -10px rgba(0, 0, 0, .45);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: popIn .25s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(.94) translateY(12px); }
    to { opacity: 1; transform: none; }
}

.bk-iframe {
    width: 100%;
    border: none;
    height: 100%;
    flex: 1;
    display: block;
}

/* Ad-hoc style classes */
.star-adjust {
    color: #a5b4fc;
}

.breadcrumb-adjust {
    font-size: 0.85rem;
}

.venue-notice-card {
    text-align: center;
    padding: 4rem 2rem;
}

.venue-notice-icon {
    font-size: 4rem;
    opacity: 0.8;
}

.venue-notice-title {
    font-weight: 800;
    margin-top: 1rem;
    color: #1e293b;
    letter-spacing: -0.5px;
}

.venue-notice-text {
    color: #64748b;
    font-size: 1.05rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

.time-label-wrap {
    vertical-align: middle;
}

.time-text {
    font-weight: 700;
    color: #1e293b;
}

.price-hero-sm {
    font-size: 1rem;
    padding: 0.4rem 0.85rem;
}

.video-cam-adjust {
    object-fit: cover;
    background: #000;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — tablet & mobile improvements
   ═══════════════════════════════════════════════ */

/* ── Tablet (≤ 767px) ── */
@media (max-width: 767.98px) {
    .cd-page {
        padding-bottom: 2.5rem;
    }

    .cd-card {
        padding: 1.1rem 1.2rem;
        border-radius: 12px;
    }

    /* Booking header: stack title + date nav */
    .cd-booking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .cd-date-nav {
        align-self: stretch;
        justify-content: space-between;
    }

    .cd-date-label {
        flex: 1;
        text-align: center;
        font-size: 1rem;
    }

    .cd-date-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    /* Legend: compact */
    .cd-legend {
        gap: 0.5rem 0.75rem;
    }

    .cd-legend-item {
        font-size: 0.75rem;
    }

    /* Table: smaller font */
    .cd-booking-table {
        font-size: 0.8rem;
    }

    .cd-booking-table th {
        padding: 0.55rem 0.6rem;
        font-size: 0.75rem;
    }

    .cd-booking-table td {
        padding: 0.5rem 0.5rem;
    }

    .cd-booking-table td:first-child {
        padding-left: 0.6rem;
    }

    /* Open play card */
    .cd-open-play-card {
        margin-top: 1rem;
    }

    /* Camera toggle */
    .cd-cam-toggle {
        gap: 0.4rem;
    }

    .btn-cam-toggle {
        font-size: 0.8rem;
        padding: 0.45rem 0.75rem;
    }
}

/* ── Mobile (≤ 575px) ── */
@media (max-width: 575.98px) {
    .cd-page {
        padding-bottom: 2rem;
    }

    .cd-card {
        padding: 0.9rem 1rem;
        border-radius: 12px;
    }

    .cd-card-title {
        font-size: 0.92rem;
        margin-bottom: 0.7rem;
    }

    /* Keep layout gap tight */
    .cd-layout {
        gap: 1rem;
    }

    /* Amenities: 1 column on small phones */
    .cd-amenities {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    /* Hours rows: smaller text */
    .cd-hours-row {
        font-size: 0.82rem;
        padding: 0.35rem 0;
    }

    /* Map iframe: shorter height */
    .cd-map-frame iframe {
        height: 180px;
    }

    /* Legend: 2 per row */
    .cd-legend {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem 0.5rem;
    }

    .cd-legend-item {
        font-size: 0.72rem;
    }

    /* Booking table: compact time column, wrap */
    .cd-grid-wrap {
        margin: 0 -0.1rem;
        /* slight bleed to use full width */
    }

    .cd-booking-table {
        font-size: 0.76rem;
    }

    .cd-booking-table th {
        padding: 0.5rem 0.45rem;
        font-size: 0.7rem;
        letter-spacing: -0.01em;
    }

    .cd-booking-table td {
        padding: 0.45rem 0.35rem;
    }

    .cd-booking-table td:first-child {
        padding-left: 0.45rem;
        white-space: normal;
        min-width: 80px;
        max-width: 100px;
    }

    .time-text {
        font-size: 0.69rem;
        line-height: 1.25;
    }

    .cd-slot-price {
        font-size: 0.65rem;
        margin-top: 1px;
    }

    .vm-bt-time-wrap {
        gap: 1px;
    }

    /* Slot buttons: compact */
    .cd-slot {
        min-width: 52px;
        font-size: 0.68rem;
        padding: 0.45rem 0.15rem;
        letter-spacing: 0;
    }

    /* Bottom info row below table */
    .cd-table-footer {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    .price-hero-sm {
        font-size: 0.85rem;
        padding: 0.35rem 0.7rem;
    }

    /* Open play card */
    .cd-op-header {
        padding: 0.9rem 1rem;
    }

    .cd-op-header h5 {
        font-size: 0.95rem;
    }

    .cd-op-body {
        padding: 1.75rem 1rem;
    }

    .cd-op-empty-icon {
        font-size: 2.25rem;
        margin-bottom: 0.75rem;
    }

    .cd-op-banner {
        padding: 1rem;
        gap: 0.75rem;
    }

    /* Venue notice */
    .venue-notice-card {
        padding: 2.5rem 1rem;
    }

    .venue-notice-icon {
        font-size: 3rem;
    }

    .venue-notice-text {
        font-size: 0.95rem;
    }

    /* Breadcrumb */
    .breadcrumb-adjust {
        font-size: 0.78rem;
    }

    /* Camera toggle */
    .btn-cam-toggle {
        font-size: 0.76rem;
        padding: 0.4rem 0.65rem;
    }
}

/* ── Bottom-sheet modal on mobile ── */
@media (max-width: 575.98px) {
    .bk-overlay {
        padding: 0;
        align-items: flex-end;
        justify-content: stretch;
    }

    .bk-modal-wrap {
        max-width: 100%;
        width: 100%;
        height: min(95dvh, 640px);
        border-radius: 20px 20px 0 0;
        margin: 0;
        animation: slideUp .25s cubic-bezier(.34, 1.2, .64, 1);
    }

    @keyframes slideUp {
        from { transform: translateY(30px); opacity: 0; }
        to   { transform: translateY(0);   opacity: 1; }
    }
}

/* ── Very small phones (≤ 380px) ── */
@media (max-width: 380px) {
    .cd-booking-table td:first-child {
        min-width: 70px;
        max-width: 85px;
    }

    .time-text {
        font-size: 0.64rem;
    }

    .cd-slot {
        min-width: 46px;
        font-size: 0.64rem;
    }

    .cd-booking-table th {
        font-size: 0.65rem;
        padding: 0.45rem 0.35rem;
    }
}
