/* ================================================================
   CampSuite Global Styles
   Grandma-first: large text, generous touch targets, high contrast
   ================================================================ */

/* Base font: 16px everywhere — never smaller than the browser default */
html {
    font-size: 16px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
    -webkit-text-size-adjust: 100%;
}

/* ── Focus styles ── visible, high-contrast ring for keyboard users */
:focus-visible {
    outline: 3px solid #059669;
    outline-offset: 2px;
}

/* ── Form inputs ── bigger touch targets, clearer text */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
    font-size: 1rem;
    min-height: 48px;
}

@media (min-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    input[type="password"],
    input[type="date"],
    input[type="time"],
    input[type="search"],
    select,
    textarea {
        min-height: 44px;
    }
}

/* ── Checkboxes & radio buttons ── larger touch targets */
input[type="checkbox"],
input[type="radio"] {
    min-width: 20px;
    min-height: 20px;
}

/* ── Buttons ── generous touch targets (44px minimum on mobile) */
button,
[type="submit"],
a.inline-flex {
    min-height: 44px;
}

/* ── Smooth transitions for interactive elements ── */
input, select, textarea, button, a {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* ── Mobile drawer animation ── */
#cs-mobile {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}

#cs-mobile.cs-open {
    transform: translateX(0);
}

#cs-overlay {
    opacity: 0;
    transition: opacity 0.25s ease;
}

#cs-overlay.cs-open {
    opacity: 1;
}

/* ── Table responsive helpers ── */
@media (max-width: 767px) {
    .cs-table-desktop {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .cs-table-mobile {
        display: none !important;
    }
}

/* ── Validation messages ── make errors prominent and readable */
.field-validation-error {
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ── Contact search results dropdown ── */
.cs-search-results {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    z-index: 110;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
}

.cs-search-results.cs-visible {
    display: block;
}

.cs-search-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.1s;
}

.cs-search-item:hover {
    background: #f0fdf4;
}

.cs-search-item:last-child {
    border-bottom: none;
}

.cs-search-item-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #0f172a;
}

.cs-search-item-detail {
    font-size: 0.8125rem;
    color: #64748b;
    margin-top: 2px;
}

/* ── Match banner (duplicate detection) ── */
.cs-match-banner {
    display: none;
    padding: 12px 16px;
    border-radius: 12px;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    margin-top: 12px;
    font-size: 0.875rem;
    align-items: center;
    gap: 10px;
}

.cs-match-banner.cs-visible {
    display: flex;
}

.cs-match-banner-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9375rem;
    flex-shrink: 0;
}

.cs-match-banner-info {
    flex: 1;
    min-width: 0;
}

.cs-match-banner-name {
    font-weight: 700;
    color: #1e40af;
}

.cs-match-banner-detail {
    font-size: 0.8125rem;
    color: #3b82f6;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs-match-use {
    padding: 6px 14px;
    border-radius: 10px;
    border: none;
    background: #2563eb;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    min-height: 36px;
}

.cs-match-use:hover {
    background: #1d4ed8;
}

/* ── Linked guest banner ── */
.cs-linked-guest {
    display: none;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    font-size: 0.875rem;
    align-items: center;
    gap: 10px;
}

.cs-linked-guest.cs-visible {
    display: flex;
}

.cs-linked-guest-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #059669;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.cs-linked-guest-info {
    flex: 1;
}

.cs-linked-guest-name {
    font-weight: 700;
    color: #065f46;
}

.cs-linked-guest-detail {
    font-size: 0.8125rem;
    color: #059669;
    margin-top: 2px;
}

.cs-linked-clear {
    padding: 6px 14px;
    border-radius: 10px;
    border: 1.5px solid #bbf7d0;
    background: #fff;
    color: #059669;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 36px;
}

.cs-linked-clear:hover {
    background: #f0fdf4;
}

/* ── Stepper (+ / - buttons for party size) ── */
.cs-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.cs-stepper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    color: #475569;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.cs-stepper-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.cs-stepper-btn:active {
    background: #cbd5e1;
}

.cs-stepper-value {
    width: 48px !important;
    min-height: 48px !important;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    border: none !important;
    border-left: 1.5px solid #e2e8f0 !important;
    border-right: 1.5px solid #e2e8f0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: #fff;
    -moz-appearance: textfield;
}

.cs-stepper-value::-webkit-inner-spin-button,
.cs-stepper-value::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
