@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

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

:root {
    --felt: #053831;
    --felt-mid: #07503f;
    --felt-light: #0a6b54;
    --ivory: #f4f0d7;
    --ivory-dim: #ede9c8;
    --ivory-muted: rgba(244, 240, 215, 0.55);
    --ivory-faint: rgba(244, 240, 215, 0.15);
    --ivory-border: rgba(244, 240, 215, 0.22);
    --chalk: #ffffff;
    --text-on-felt: #f4f0d7;
    --text-on-felt-muted: rgba(244, 240, 215, 0.6);
    --ball-red: #c0392b;
    --ball-yellow: #d4a017;
    --ball-blue-val: #185fa5;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.13);
    --input-bg: rgba(0, 0, 0, 0.25);
    --input-border: rgba(255, 255, 255, 0.2);
    --input-focus-border: var(--ivory);
}

body {
    /* font-family: 'DM Sans', sans-serif; */
    font-family: "Montserrat", sans-serif;

    background: var(--felt);
    color: var(--text-on-felt);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Pocket dots decorative */
/* body::after {
      content: '';
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background-image:
        radial-gradient(circle 42px at 0px 0px, rgba(0,0,0,0.35) 60%, transparent 60%),
        radial-gradient(circle 42px at 100% 0px, rgba(0,0,0,0.35) 60%, transparent 60%),
        radial-gradient(circle 42px at 0px 100%, rgba(0,0,0,0.35) 60%, transparent 60%),
        radial-gradient(circle 42px at 100% 100%, rgba(0,0,0,0.35) 60%, transparent 60%),
        radial-gradient(circle 32px at 50% 0px, rgba(0,0,0,0.25) 60%, transparent 60%),
        radial-gradient(circle 32px at 50% 100%, rgba(0,0,0,0.25) 60%, transparent 60%);
      pointer-events: none;
      z-index: 0;
    } */

.page {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── HEADER ── */
header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.4rem;
}

.logo-wrap img {
    /* width: 110px; */
    height: auto;
}

header h1 {
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 400;
    color: var(--ivory);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

header h1 em {
    font-style: italic;
    color: rgba(244, 240, 215, 0.75);
}

header p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-on-felt-muted);
    letter-spacing: 0.02em;
}

a[href^="mailto:"] {
  color: var(--ball-yellow);
}

/* ── DIVIDER ── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 1.6rem;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--ivory-border);
}

.divider-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-on-felt-muted);
}

/* ── CARD ── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ── FIELDS ── */
.field { margin-bottom: 1.1rem; }
.field:last-child { margin-bottom: 0; }

label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-on-felt-muted);
    margin-bottom: 6px;
}

input,
select {
    width: 100%;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--ivory);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    -webkit-appearance: none;
}

input::placeholder {
    color: rgba(244, 240, 215, 0.3);
}

input:focus,
select:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(244, 240, 215, 0.12);
    background: rgba(0, 0, 0, 0.35);
}

select option {
    background: #053831;
    color: #f4f0d7;
}

/* date/time input color fix */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.5);
    cursor: pointer;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.duration-hint {
    font-size: 0.75rem;
    color: var(--text-on-felt-muted);
    margin-top: 5px;
}

/* ── TABLES GRID ── */
.tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.table-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 16px 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.table-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.table-btn:hover:not(.unavailable):not(.loading) {
    border-color: rgba(244, 240, 215, 0.45);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.table-btn.selected {
    border: 1.5px solid var(--ivory);
    background: rgba(244, 240, 215, 0.14);
    box-shadow: 0 0 0 3px rgba(244, 240, 215, 0.1);
}

.table-btn.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Snooker ball number badge */
.t-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Serif Display', serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: #fff;
    margin-bottom: 8px;
    position: relative;
    /* subtle 3D ball look */
    box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.4), inset 1px 1px 3px rgba(255, 255, 255, 0.25);
}

.ball-1 {
    background: radial-gradient(circle at 35% 35%, #ED1C24, #b0151b);
}

.ball-2 {
    background: radial-gradient(circle at 35% 35%, #FFD200, #c2a000);
}

.ball-3 {
    background: radial-gradient(circle at 35% 35%, #008C44, #006030);
}

.ball-4 {
    background: radial-gradient(circle at 35% 35%, #8B4513, #5c2e0c);
}

.t-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ivory);
    margin-bottom: 4px;
}

.table-btn.selected .t-name {
    color: #fff;
}

.t-status {
    font-size: 0.75rem;
    color: var(--text-on-felt-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-free {
    background: #7ec850;
    box-shadow: 0 0 5px #7ec850;
}

.dot-busy {
    background: #e74c3c;
    box-shadow: 0 0 5px #e74c3c;
}

.dot-unknown {
    background: rgba(255, 255, 255, 0.3);
}

/* ── SUBMIT ── */
.submit-btn {
    width: 100%;
    padding: 15px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--felt);
    background: var(--ivory);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    margin-top: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover:not(:disabled) {
    background: #fff;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.99) translateY(0);
}

.submit-btn:disabled {
    background: rgba(244, 240, 215, 0.18);
    color: rgba(244, 240, 215, 0.4);
    cursor: not-allowed;
    box-shadow: none;
}

/* ── ALERTS ── */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 1rem;
    border: 1px solid transparent;
}

.alert strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.alert-success {
    background: rgba(126, 200, 80, 0.12);
    color: #a8d97a;
    border-color: rgba(126, 200, 80, 0.3);
}

.alert-error {
    background: rgba(231, 76, 60, 0.12);
    color: #f1948a;
    border-color: rgba(231, 76, 60, 0.3);
}

.alert-info {
    background: rgba(52, 152, 219, 0.12);
    color: #85c1e9;
    border-color: rgba(52, 152, 219, 0.25);
}

.alert-warn {
    background: rgba(212, 160, 23, 0.12);
    color: #f4d03f;
    border-color: rgba(212, 160, 23, 0.3);
}

.conflict-list {
    margin-top: 6px;
}

.conflict-item {
    font-size: 0.8rem;
    padding: 4px 0;
    border-bottom: 1px solid rgba(241, 148, 138, 0.2);
    opacity: 0.85;
}

.conflict-item:last-child {
    border-bottom: none;
}

/* ── SPINNER ── */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(5, 56, 49, 0.3);
    border-top-color: var(--felt);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

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

/* ── FOOTER ── */
.footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.72rem;
    color: rgba(244, 240, 215, 0.3);
    letter-spacing: 0.05em;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .page {
        padding: 0rem 1rem 3rem;
    }

    .row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    header h1 {
        font-size: 1.75rem;
    }
    
    .field { /* margin-bottom: 1.1rem; */ }
.field:last-child { margin-bottom: 1.1rem; }
}

@media (min-width: 600px) {
    .page {
        padding: 0rem 2rem 5rem;
    }
}