/* ============================================================
   ROG Table Bookings — Frontend Modal
   Matches the site's dark colour scheme:
     bg:      #121212 / #1a1a1a
     surface: #242424
     primary: #c0392b  (red)
     accent:  #e67e22  (orange)
     text:    #f0f0f0
     muted:   #999
     border:  #333
   ============================================================ */

/* ── Trigger button ────────────────────────────────────────────────────── */
.rogb-open-modal,
button[data-rogb-modal] {
    display: inline-block;
    padding: 12px 28px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .3px;
    transition: background .2s;
    text-decoration: none;
}
.rogb-open-modal:hover,
button[data-rogb-modal]:hover {
    background: #a93226;
}

/* ── Overlay ────────────────────────────────────────────────────────────── */
.rogb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;       /* don't intercept clicks when closed */
    transition: opacity .3s;
}
/* Hard hide when the HTML `hidden` attribute is present — `display: flex`
   above otherwise wins over the user-agent default `display: none`. */
.rogb-overlay[hidden] {
    display: none !important;
}
.rogb-overlay--visible {
    opacity: 1;
    pointer-events: auto;       /* re-enable clicks once visible */
}

/* ── Modal box ──────────────────────────────────────────────────────────── */
.rogb-modal {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    color: #f0f0f0;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px;
    transform: translateY(12px);
    transition: transform .3s;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}
.rogb-overlay--visible .rogb-modal {
    transform: translateY(0);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.rogb-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #2e2e2e;
    position: sticky;
    top: 0;
    background: #1a1a1a;
    z-index: 1;
}
.rogb-modal__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}
.rogb-modal__close {
    background: none;
    border: none;
    color: #999;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color .15s;
}
.rogb-modal__close:hover { color: #fff; }

/* ── Step indicator ─────────────────────────────────────────────────────── */
.rogb-steps {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #2e2e2e;
    gap: 0;
}
.rogb-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}
.rogb-step span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #333;
    color: #888;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.rogb-step--active {
    color: #f0f0f0;
}
.rogb-step--active span {
    background: #c0392b;
    color: #fff;
}
.rogb-step--completed span {
    background: #27ae60;
    color: #fff;
}
.rogb-step-sep {
    flex: 1;
    height: 1px;
    background: #333;
    margin: 0 8px;
    min-width: 16px;
}

/* ── Body / panes ────────────────────────────────────────────────────────── */
.rogb-modal__body {
    padding: 24px;
}
.rogb-pane { }
.rogb-pane--success {
    text-align: center;
    padding: 8px 0 16px;
}

/* ── Form elements ───────────────────────────────────────────────────────── */
.rogb-field {
    margin-bottom: 18px;
}
.rogb-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.rogb-field input[type="text"],
.rogb-field input[type="email"],
.rogb-field input[type="tel"],
.rogb-field input[type="number"],
.rogb-field input[type="date"],
.rogb-field input[type="time"],
.rogb-field select,
.rogb-field textarea {
    width: 100%;
    padding: 10px 12px;
    background: #242424;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #f0f0f0;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color .15s;
    appearance: none;
    -webkit-appearance: none;
}
.rogb-field input:focus,
.rogb-field select:focus,
.rogb-field textarea:focus {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, .25);
}
.rogb-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.rogb-field textarea {
    resize: vertical;
    min-height: 80px;
}
.rogb-field input[type="number"] {
    max-width: 120px;
}
.rogb-field input[type="date"] {
    color-scheme: dark;
}
.rogb-req {
    color: #e67e22;
    margin-left: 2px;
}
.rogb-hint {
    font-size: 12px;
    color: #777;
    margin: 6px 0 0;
}
.rogb-hint-inline {
    font-size: 12px;
    color: #777;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Two-column row ──────────────────────────────────────────────────────── */
.rogb-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 500px) {
    .rogb-row { grid-template-columns: 1fr; }
}

/* ── Time slot grid ──────────────────────────────────────────────────────── */
.rogb-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.rogb-slot-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    background: #242424;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #f0f0f0;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    text-align: center;
    gap: 2px;
}
.rogb-slot-btn:hover:not(:disabled) {
    border-color: #c0392b;
    background: #2e1e1e;
}
.rogb-slot-btn--selected {
    border-color: #c0392b !important;
    background: #3a1a1a !important;
}
.rogb-slot-btn--full {
    opacity: .45;
    cursor: not-allowed;
}
.rogb-slot-time {
    font-weight: 700;
    font-size: 15px;
}
.rogb-slot-end {
    color: #888;
    font-size: 12px;
}
.rogb-slot-avail {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}
.rogb-slot-btn--selected .rogb-slot-avail {
    color: #e67e22;
}

/* Selected-slot summary line under the grid. */
.rogb-slot-summary {
    margin-top: 10px;
    color: #e67e22;
    font-weight: 600;
}
.rogb-slot-hint {
    margin-top: 8px;
    color: #888;
    font-size: 12px;
    font-style: italic;
}

/* ── Error banner ────────────────────────────────────────────────────────── */
.rogb-error {
    background: rgba(192, 57, 43, .15);
    border: 1px solid #c0392b;
    border-radius: 4px;
    color: #ff9999;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}
.rogb-error-text {
    color: #ff9999;
}

/* ── Action buttons ──────────────────────────────────────────────────────── */
.rogb-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #2e2e2e;
}
.rogb-btn {
    display: inline-block;
    padding: 11px 24px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .2s, color .2s;
    font-family: inherit;
}
.rogb-btn--primary {
    background: #c0392b;
    color: #fff;
}
.rogb-btn--primary:hover:not(:disabled) {
    background: #a93226;
}
.rogb-btn--primary:disabled {
    opacity: .6;
    cursor: not-allowed;
}
.rogb-btn--ghost {
    background: transparent;
    color: #aaa;
    border: 1px solid #444;
}
.rogb-btn--ghost:hover {
    color: #fff;
    border-color: #666;
}

/* ── Summary table ───────────────────────────────────────────────────────── */
.rogb-summary {
    margin: 16px 0;
}
.rogb-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.rogb-summary-table th,
.rogb-summary-table td {
    padding: 9px 12px;
    border: 1px solid #2e2e2e;
    text-align: left;
    vertical-align: top;
}
.rogb-summary-table th {
    background: #242424;
    font-weight: 600;
    color: #ccc;
    width: 35%;
    white-space: nowrap;
}
.rogb-summary-table td {
    color: #f0f0f0;
}

/* ── Success screen ──────────────────────────────────────────────────────── */
.rogb-success-icon {
    width: 64px;
    height: 64px;
    background: #27ae60;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    margin: 8px auto 20px;
}
.rogb-pane--success h3 {
    font-size: 22px;
    margin: 0 0 8px;
}
.rogb-pane--success p {
    color: #aaa;
    margin: 0 0 16px;
}
.rogb-pane--success .rogb-summary {
    text-align: left;
}

/* ── Loading hint ────────────────────────────────────────────────────────── */
.rogb-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #555;
    border-top-color: #c0392b;
    border-radius: 50%;
    animation: rogb-spin .7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes rogb-spin {
    to { transform: rotate(360deg); }
}
