/**
 * ZenTables Widget v2.0
 * Design Apple-inspired avec couleur marque #5FA45F
 */

/* ============================================================================
   Variables CSS - Theme Apple
   ============================================================================ */
:root {
    /* Couleurs principales */
    --zt-primary: #5FA45F;
    --zt-primary-hover: #4E8F4E;
    --zt-primary-light: rgba(95, 164, 95, 0.12);
    --zt-primary-subtle: rgba(95, 164, 95, 0.08);

    /* Couleurs sémantiques */
    --zt-danger: #FF3B30;
    --zt-danger-light: rgba(255, 59, 48, 0.12);
    --zt-success: #34C759;
    --zt-warning: #FF9500;

    /* Couleurs neutres - Apple style */
    --zt-bg: #FFFFFF;
    --zt-bg-secondary: #F5F5F7;
    --zt-bg-tertiary: #E8E8ED;
    --zt-bg-elevated: rgba(255, 255, 255, 0.72);

    /* Textes */
    --zt-text: #1D1D1F;
    --zt-text-secondary: #86868B;
    --zt-text-tertiary: #AEAEB2;

    /* Bordures */
    --zt-border: rgba(0, 0, 0, 0.08);
    --zt-border-focus: rgba(95, 164, 95, 0.4);

    /* Rayons - Apple genereux */
    --zt-radius-xs: 8px;
    --zt-radius-sm: 12px;
    --zt-radius: 16px;
    --zt-radius-lg: 20px;
    --zt-radius-xl: 28px;
    --zt-radius-full: 9999px;

    /* Ombres - subtiles */
    --zt-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --zt-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --zt-shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
    --zt-shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.16);

    /* Transitions - Apple smooth */
    --zt-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --zt-ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.1);
    --zt-duration: 0.3s;
    --zt-duration-fast: 0.2s;

    /* Typographie */
    --zt-font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    --zt-font-weight-regular: 400;
    --zt-font-weight-medium: 500;
    --zt-font-weight-semibold: 600;
    --zt-font-weight-bold: 700;

    /* Blur pour effet glass */
    --zt-blur: blur(20px);
}

/* ============================================================================
   Reset & Base
   ============================================================================ */
.zentables-widget {
    font-family: var(--zt-font);
    font-size: 15px;
    line-height: 1.47059;
    letter-spacing: -0.022em;
    color: var(--zt-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.zentables-widget * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Mode pleine page */
.zentables-widget.fullpage {
    position: relative;
    bottom: auto;
    right: auto;
    max-width: 420px;
    margin: 0 auto;
}

.zentables-widget.fullpage .zt-collapsed {
    display: none;
}

.zentables-widget.fullpage .zt-expanded {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: auto;
    border-radius: var(--zt-radius-lg);
    box-shadow: var(--zt-shadow);
}

/* ============================================================================
   État replié (Collapsed) - Pilule Apple
   ============================================================================ */
.zt-collapsed {
    display: flex;
    align-items: stretch;
    height: 56px;
    width: 280px;
    background: var(--zt-bg);
    border-radius: var(--zt-radius-full);
    box-shadow: var(--zt-shadow-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--zt-duration) var(--zt-ease),
                box-shadow var(--zt-duration) var(--zt-ease);
}

.zt-collapsed:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--zt-shadow-elevated);
}

.zt-collapsed:active {
    transform: translateY(0) scale(0.98);
}

.zt-collapsed.hidden {
    display: none;
}

.zt-brand {
    width: 56px;
    background: var(--zt-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--zt-duration) var(--zt-ease);
}

.zt-brand:hover {
    background: var(--zt-primary-hover);
}

.zt-brand svg {
    width: 26px;
    height: 26px;
    fill: white;
}

.zt-cta {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: var(--zt-font-weight-semibold);
    font-size: 15px;
    color: var(--zt-text);
    padding: 0 20px;
}

.zt-cta svg {
    width: 20px;
    height: 20px;
    stroke: var(--zt-primary);
}

/* ============================================================================
   État déplié (Expanded) - Card Apple avec transitions fluides
   ============================================================================ */
.zt-expanded {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 360px;
    max-height: calc(100vh - 48px);
    background: var(--zt-bg);
    border-radius: var(--zt-radius-lg);
    box-shadow: var(--zt-shadow-elevated);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--zt-border);
    /* Transition pour la hauteur automatique */
    transition: box-shadow var(--zt-duration) var(--zt-ease);
}

.zt-expanded.visible {
    display: flex;
    animation: zt-slideUp 0.45s var(--zt-ease-spring);
}

.zt-expanded.closing {
    animation: zt-slideDown 0.35s var(--zt-ease) forwards;
}

@keyframes zt-slideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes zt-slideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(24px) scale(0.94);
    }
}

/* ============================================================================
   Header - Style Apple minimaliste
   ============================================================================ */
.zt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    background: var(--zt-bg);
    flex-shrink: 0;
}

.zt-header-title {
    font-size: 20px;
    font-weight: var(--zt-font-weight-bold);
    letter-spacing: -0.03em;
    color: var(--zt-text);
}

.zt-header-subtitle {
    font-size: 13px;
    font-weight: var(--zt-font-weight-regular);
    color: var(--zt-text-secondary);
    margin-top: 2px;
    line-height: 1.4;
}

.zt-header-subtitle .zt-link {
    color: var(--zt-primary);
    text-decoration: none;
    font-weight: var(--zt-font-weight-medium);
    transition: opacity var(--zt-duration-fast) var(--zt-ease);
}

.zt-header-subtitle .zt-link:hover {
    opacity: 0.7;
}

.zt-close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--zt-bg-secondary);
    border-radius: var(--zt-radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--zt-duration-fast) var(--zt-ease);
}

.zt-close:hover {
    background: var(--zt-bg-tertiary);
    transform: scale(1.05);
}

.zt-close:active {
    transform: scale(0.95);
}

.zt-close svg {
    width: 14px;
    height: 14px;
    stroke: var(--zt-text-secondary);
    stroke-width: 2.5;
}

/* ============================================================================
   Body (scrollable) avec transitions fluides
   ============================================================================ */
.zt-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
    /* Smooth scroll pour iOS */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.zt-body.animating {
    overflow: hidden;
    flex: none;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.zt-body::-webkit-scrollbar {
    width: 6px;
}

.zt-body::-webkit-scrollbar-track {
    background: transparent;
}

.zt-body::-webkit-scrollbar-thumb {
    background: var(--zt-bg-tertiary);
    border-radius: var(--zt-radius-full);
    transition: background var(--zt-duration-fast) var(--zt-ease);
}

.zt-body::-webkit-scrollbar-thumb:hover {
    background: var(--zt-text-tertiary);
}

/* ============================================================================
   Accordéons - Style Apple épuré avec animations fluides
   ============================================================================ */
.zt-accordion {
    margin: 0 12px 8px;
    background: var(--zt-bg-secondary);
    border-radius: var(--zt-radius);
    overflow: hidden;
    transition: all var(--zt-duration) var(--zt-ease);
}

.zt-accordion:last-child {
    margin-bottom: 12px;
}

/* Animation shake pour attirer l'attention */
.zt-accordion.shake {
    animation: zt-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes zt-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.zt-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    cursor: pointer;
    transition: background var(--zt-duration-fast) var(--zt-ease);
    user-select: none;
}

.zt-accordion-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.zt-accordion-header:active {
    background: rgba(0, 0, 0, 0.04);
}

.zt-accordion-title {
    font-weight: var(--zt-font-weight-semibold);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--zt-text-secondary);
}

.zt-accordion-value {
    font-weight: var(--zt-font-weight-semibold);
    font-size: 15px;
    color: var(--zt-primary);
    margin-left: auto;
    margin-right: 8px;
    transition: transform var(--zt-duration-fast) var(--zt-ease);
}

.zt-accordion.open .zt-accordion-value {
    transform: scale(0.95);
    opacity: 0.7;
}

.zt-accordion-arrow {
    width: 18px;
    height: 18px;
    stroke: var(--zt-text-tertiary);
    transition: transform var(--zt-duration) var(--zt-ease-spring);
}

.zt-accordion.open .zt-accordion-arrow {
    transform: rotate(180deg);
}

/* Animation du contenu avec grid pour height auto */
.zt-accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s var(--zt-ease-spring),
                opacity 0.3s var(--zt-ease);
    opacity: 0;
}

.zt-accordion-inner {
    overflow: hidden;
    padding: 0 16px;
    transition: padding 0.4s var(--zt-ease-spring);
}

.zt-accordion.open .zt-accordion-content {
    grid-template-rows: 1fr;
    opacity: 1;
}

.zt-accordion.open .zt-accordion-inner {
    padding: 0 16px 16px;
}

/* Inner pour le calendrier */
.zt-calendar-inner {
    overflow: hidden;
}

/* Animation des éléments internes */
.zt-accordion-inner .zt-guests-grid,
.zt-accordion-inner .zt-dates-row,
.zt-accordion-inner .zt-floors-list,
.zt-accordion-inner .zt-time-service {
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.45s var(--zt-ease-spring),
                opacity 0.35s var(--zt-ease);
    transition-delay: 0.08s;
}

.zt-accordion.open .zt-accordion-inner .zt-guests-grid,
.zt-accordion.open .zt-accordion-inner .zt-dates-row,
.zt-accordion.open .zt-accordion-inner .zt-floors-list,
.zt-accordion.open .zt-accordion-inner .zt-time-service {
    transform: translateY(0);
    opacity: 1;
}

/* Stagger animation pour les boutons */
.zt-accordion.open .zt-guest-btn,
.zt-accordion.open .zt-date-btn,
.zt-accordion.open .zt-floor-btn,
.zt-accordion.open .zt-time-btn {
    animation: zt-staggerIn 0.4s var(--zt-ease-spring) backwards;
}

.zt-accordion.open .zt-guest-btn:nth-child(1),
.zt-accordion.open .zt-date-btn:nth-child(1),
.zt-accordion.open .zt-floor-btn:nth-child(1) { animation-delay: 0.02s; }

.zt-accordion.open .zt-guest-btn:nth-child(2),
.zt-accordion.open .zt-date-btn:nth-child(2),
.zt-accordion.open .zt-floor-btn:nth-child(2) { animation-delay: 0.04s; }

.zt-accordion.open .zt-guest-btn:nth-child(3),
.zt-accordion.open .zt-date-btn:nth-child(3),
.zt-accordion.open .zt-floor-btn:nth-child(3) { animation-delay: 0.06s; }

.zt-accordion.open .zt-guest-btn:nth-child(4),
.zt-accordion.open .zt-floor-btn:nth-child(4) { animation-delay: 0.08s; }

.zt-accordion.open .zt-guest-btn:nth-child(5),
.zt-accordion.open .zt-floor-btn:nth-child(5) { animation-delay: 0.1s; }

.zt-accordion.open .zt-guest-btn:nth-child(6) { animation-delay: 0.12s; }
.zt-accordion.open .zt-guest-btn:nth-child(7) { animation-delay: 0.14s; }
.zt-accordion.open .zt-guest-btn:nth-child(8) { animation-delay: 0.16s; }
.zt-accordion.open .zt-guest-btn:nth-child(9) { animation-delay: 0.18s; }
.zt-accordion.open .zt-guest-btn:nth-child(10) { animation-delay: 0.2s; }

@keyframes zt-staggerIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================================================
   Grille Couverts - Boutons Apple
   ============================================================================ */
.zt-guests-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.zt-guest-btn {
    aspect-ratio: 1;
    border: none;
    border-radius: var(--zt-radius-sm);
    background: var(--zt-bg);
    font-size: 17px;
    font-weight: var(--zt-font-weight-semibold);
    color: var(--zt-text);
    cursor: pointer;
    transition: all var(--zt-duration-fast) var(--zt-ease);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--zt-shadow-sm);
}

.zt-guest-btn:hover {
    background: var(--zt-primary-light);
    transform: scale(1.05);
}

.zt-guest-btn:active {
    transform: scale(0.95);
}

.zt-guest-btn.selected {
    background: var(--zt-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(95, 164, 95, 0.3);
}

.zt-guest-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================================
   Sélection Date - Cards Apple
   ============================================================================ */
.zt-dates-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.zt-date-btn {
    padding: 14px 10px;
    border: none;
    border-radius: var(--zt-radius-sm);
    background: var(--zt-bg);
    cursor: pointer;
    transition: all var(--zt-duration-fast) var(--zt-ease);
    text-align: center;
    box-shadow: var(--zt-shadow-sm);
}

.zt-date-btn:hover {
    background: var(--zt-primary-light);
    transform: translateY(-2px);
}

.zt-date-btn:active {
    transform: translateY(0) scale(0.98);
}

.zt-date-btn.selected {
    background: var(--zt-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(95, 164, 95, 0.3);
}

.zt-date-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.zt-date-day {
    font-weight: var(--zt-font-weight-semibold);
    font-size: 14px;
}

.zt-date-sub {
    font-size: 12px;
    font-weight: var(--zt-font-weight-regular);
    color: var(--zt-text-secondary);
    margin-top: 3px;
}

.zt-date-btn.selected .zt-date-sub {
    color: rgba(255, 255, 255, 0.75);
}

.zt-date-btn svg {
    width: 22px;
    height: 22px;
    stroke: var(--zt-text-secondary);
    margin-bottom: 4px;
}

.zt-date-btn.selected svg {
    stroke: white;
}

/* Calendrier complet - Style Apple Calendar avec animation */
.zt-calendar-full {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: 0;
    background: var(--zt-bg);
    border-radius: var(--zt-radius-sm);
    box-shadow: var(--zt-shadow-sm);
    opacity: 0;
    overflow: hidden;
    transition: grid-template-rows 0.4s var(--zt-ease),
                margin-top 0.4s var(--zt-ease),
                opacity 0.3s var(--zt-ease),
                padding 0.4s var(--zt-ease);
}

.zt-calendar-full > * {
    overflow: hidden;
}

.zt-calendar-full.visible {
    grid-template-rows: 1fr;
    margin-top: 12px;
    padding: 14px;
    opacity: 1;
}

/* Animation des jours du calendrier */
.zt-calendar-full.visible .zt-cal-day {
    animation: zt-calDayIn 0.3s var(--zt-ease) backwards;
}

.zt-calendar-full.visible .zt-cal-day:nth-child(7n+1) { animation-delay: 0.02s; }
.zt-calendar-full.visible .zt-cal-day:nth-child(7n+2) { animation-delay: 0.04s; }
.zt-calendar-full.visible .zt-cal-day:nth-child(7n+3) { animation-delay: 0.06s; }
.zt-calendar-full.visible .zt-cal-day:nth-child(7n+4) { animation-delay: 0.08s; }
.zt-calendar-full.visible .zt-cal-day:nth-child(7n+5) { animation-delay: 0.1s; }
.zt-calendar-full.visible .zt-cal-day:nth-child(7n+6) { animation-delay: 0.12s; }
.zt-calendar-full.visible .zt-cal-day:nth-child(7n+7) { animation-delay: 0.14s; }

@keyframes zt-calDayIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zt-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.zt-calendar-nav button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--zt-radius-full);
    background: var(--zt-bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--zt-duration-fast) var(--zt-ease);
}

.zt-calendar-nav button:hover {
    background: var(--zt-primary-light);
}

.zt-calendar-nav button:active {
    transform: scale(0.92);
}

.zt-calendar-nav button svg {
    width: 16px;
    height: 16px;
    stroke: var(--zt-text);
}

.zt-calendar-month {
    font-weight: var(--zt-font-weight-semibold);
    font-size: 15px;
}

.zt-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    margin-bottom: 6px;
}

.zt-calendar-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: var(--zt-font-weight-semibold);
    color: var(--zt-text-tertiary);
    padding: 6px 0;
    text-transform: uppercase;
}

.zt-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.zt-cal-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: var(--zt-font-weight-medium);
    border-radius: var(--zt-radius-full);
    cursor: pointer;
    transition: all var(--zt-duration-fast) var(--zt-ease);
}

.zt-cal-day:hover:not(.disabled):not(.empty) {
    background: var(--zt-primary-light);
}

.zt-cal-day:active:not(.disabled):not(.empty) {
    transform: scale(0.9);
}

.zt-cal-day.selected {
    background: var(--zt-primary);
    color: white;
    font-weight: var(--zt-font-weight-semibold);
}

.zt-cal-day.today:not(.selected) {
    background: var(--zt-primary-subtle);
    color: var(--zt-primary);
    font-weight: var(--zt-font-weight-bold);
}

.zt-cal-day.disabled {
    color: var(--zt-text-tertiary);
    cursor: not-allowed;
    opacity: 0.4;
}

/* Date complète - liste d'attente possible */
.zt-cal-day.full {
    color: var(--zt-warning);
    font-weight: var(--zt-font-weight-semibold);
}

.zt-cal-day.full::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--zt-warning);
    border-radius: var(--zt-radius-full);
}

.zt-cal-day.full:hover {
    background: rgba(255, 149, 0, 0.15);
}

.zt-cal-day.full.selected {
    background: var(--zt-warning);
    color: white;
}

.zt-cal-day.full.selected::after {
    background: white;
}

.zt-cal-day.empty {
    cursor: default;
}

/* ============================================================================
   Sélection Salle - Liste Apple
   ============================================================================ */
.zt-floors-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.zt-floor-btn {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: none;
    border-radius: var(--zt-radius-sm);
    background: var(--zt-bg);
    cursor: pointer;
    transition: all var(--zt-duration-fast) var(--zt-ease);
    font-size: 15px;
    font-weight: var(--zt-font-weight-medium);
    color: var(--zt-text);
    box-shadow: var(--zt-shadow-sm);
}

.zt-floor-btn:hover {
    background: var(--zt-primary-light);
}

.zt-floor-btn:active {
    transform: scale(0.98);
}

.zt-floor-btn.selected {
    background: var(--zt-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(95, 164, 95, 0.3);
}

.zt-floor-btn .zt-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--zt-border);
    border-radius: var(--zt-radius-full);
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--zt-duration-fast) var(--zt-ease);
}

.zt-floor-btn.selected .zt-check {
    background: white;
    border-color: white;
}

.zt-floor-btn.selected .zt-check::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--zt-primary);
    border-radius: var(--zt-radius-full);
}

/* ============================================================================
   Sélection Heure - Pills Apple
   ============================================================================ */
.zt-time-service {
    margin-bottom: 16px;
}

.zt-time-service:last-child {
    margin-bottom: 0;
}

.zt-service-label {
    font-size: 12px;
    font-weight: var(--zt-font-weight-semibold);
    color: var(--zt-text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.zt-service-color {
    width: 8px;
    height: 8px;
    border-radius: var(--zt-radius-full);
}

.zt-time-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zt-time-btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--zt-radius-full);
    background: var(--zt-bg);
    font-size: 14px;
    font-weight: var(--zt-font-weight-medium);
    color: var(--zt-text);
    cursor: pointer;
    transition: all var(--zt-duration-fast) var(--zt-ease);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--zt-shadow-sm);
}

.zt-time-btn:hover:not(.disabled) {
    background: var(--zt-primary-light);
    transform: scale(1.02);
}

.zt-time-btn:active:not(.disabled) {
    transform: scale(0.96);
}

.zt-time-btn.selected {
    background: var(--zt-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(95, 164, 95, 0.3);
}

.zt-time-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.zt-time-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--zt-radius-full);
    background: var(--zt-primary);
}

.zt-time-btn.disabled .zt-time-dot {
    background: var(--zt-danger);
}

.zt-time-btn.selected .zt-time-dot {
    background: white;
}

/* Icône cloche pour créneaux liste d'attente */
.zt-time-bell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.zt-time-bell svg {
    width: 14px;
    height: 14px;
    stroke: var(--zt-warning);
}

/* Créneaux complets avec liste d'attente */
.zt-time-btn.waitlist-slot {
    border: 1px dashed var(--zt-warning);
    background: rgba(255, 149, 0, 0.08);
    color: var(--zt-text-secondary);
}

.zt-time-btn.waitlist-slot:hover {
    background: rgba(255, 149, 0, 0.15);
    border-color: var(--zt-warning);
    color: var(--zt-text);
}

.zt-time-btn.waitlist-slot.selected {
    background: var(--zt-warning);
    border: none;
    color: white;
}

.zt-time-btn.waitlist-slot.selected .zt-time-bell svg {
    stroke: white;
}

.zt-no-slots {
    text-align: center;
    padding: 24px;
    color: var(--zt-text-secondary);
    font-size: 14px;
}

/* ============================================================================
   Liste d'attente - Waitlist Mode
   ============================================================================ */
.zt-waitlist-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--zt-warning);
    background: linear-gradient(135deg, #FF9500 0%, #FF6B00 100%);
    border-radius: var(--zt-radius-sm);
    margin-bottom: 16px;
    color: white;
}

.zt-waitlist-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--zt-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zt-waitlist-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.zt-waitlist-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.zt-waitlist-text strong {
    font-size: 14px;
    font-weight: var(--zt-font-weight-semibold);
}

.zt-waitlist-text span {
    font-size: 12px;
    opacity: 0.9;
}

/* Bouton Être notifié */
.zt-reserve-btn.waitlist-mode {
    background: var(--zt-warning);
    background: linear-gradient(135deg, #FF9500 0%, #FF6B00 100%);
    box-shadow: 0 4px 16px rgba(255, 149, 0, 0.3);
}

.zt-reserve-btn.waitlist-mode:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.35);
}

/* Bandeau waitlist dans le formulaire */
.zt-form-waitlist-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin: 12px 20px 0;
    background: linear-gradient(135deg, #FF9500 0%, #FF6B00 100%);
    border-radius: var(--zt-radius-sm);
    color: white;
    font-size: 13px;
    font-weight: var(--zt-font-weight-medium);
}

.zt-form-waitlist-banner svg {
    width: 18px;
    height: 18px;
    stroke: white;
    flex-shrink: 0;
}

/* Succès waitlist */
.zt-success-icon.waitlist {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.15) 0%, rgba(255, 107, 0, 0.15) 100%);
}

.zt-success-icon.waitlist svg {
    stroke: var(--zt-warning);
}

.zt-waitlist-info {
    background: var(--zt-bg-secondary);
    border-radius: var(--zt-radius-sm);
    padding: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--zt-text-secondary);
    line-height: 1.5;
}

/* Notice aucune table disponible */
.zt-no-tables-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--zt-bg-tertiary);
    border-radius: var(--zt-radius-sm);
    margin-bottom: 16px;
    color: var(--zt-text);
}

.zt-notice-icon {
    width: 36px;
    height: 36px;
    background: var(--zt-text-tertiary);
    border-radius: var(--zt-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zt-notice-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.zt-notice-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.zt-notice-text strong {
    font-size: 14px;
    font-weight: var(--zt-font-weight-semibold);
}

.zt-notice-text span {
    font-size: 12px;
    color: var(--zt-text-secondary);
}

/* ============================================================================
   Footer avec bouton Réserver - CTA Apple
   ============================================================================ */
.zt-footer {
    padding: 16px 20px 20px;
    background: var(--zt-bg);
    flex-shrink: 0;
}

.zt-reserve-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--zt-radius-sm);
    background: var(--zt-primary);
    color: white;
    font-size: 17px;
    font-weight: var(--zt-font-weight-semibold);
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all var(--zt-duration-fast) var(--zt-ease);
    box-shadow: 0 4px 16px rgba(95, 164, 95, 0.3);
}

.zt-reserve-btn:hover:not(:disabled) {
    background: var(--zt-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(95, 164, 95, 0.35);
}

.zt-reserve-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.zt-reserve-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* Mention publicitaire */
.zt-powered {
    text-align: center;
    font-size: 11px;
    color: var(--zt-text-tertiary);
    margin-top: 12px;
    letter-spacing: 0.01em;
}

.zt-powered a {
    color: var(--zt-text-secondary);
    text-decoration: none;
    font-weight: var(--zt-font-weight-medium);
    transition: color var(--zt-duration-fast) var(--zt-ease);
}

.zt-powered a:hover {
    color: var(--zt-primary);
}

/* ============================================================================
   Formulaire de coordonnées - Apple Forms
   ============================================================================ */
/* Animation de transition sélection <-> formulaire */
#zt-selection {
    animation: zt-fadeSlideIn 0.4s var(--zt-ease-spring);
}

#zt-selection.hiding {
    animation: zt-fadeSlideOutLeft 0.3s var(--zt-ease) forwards;
}

.zt-form {
    display: none;
}

.zt-form.visible {
    display: block;
    animation: zt-fadeSlideInRight 0.4s var(--zt-ease-spring);
}

.zt-form.hiding {
    animation: zt-fadeSlideOutRight 0.3s var(--zt-ease) forwards;
}

@keyframes zt-fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zt-fadeSlideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zt-fadeSlideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

@keyframes zt-fadeSlideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.zt-form-summary {
    background: var(--zt-bg-secondary);
    border-radius: var(--zt-radius-sm);
    padding: 16px;
    margin: 12px 20px 20px;
}

.zt-form-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.zt-form-summary-label {
    color: var(--zt-text-secondary);
    font-size: 14px;
}

.zt-form-summary-value {
    font-weight: var(--zt-font-weight-semibold);
    font-size: 14px;
}

.zt-form-fields {
    padding: 0 20px;
}

.zt-form-group {
    margin-bottom: 16px;
}

.zt-form-label {
    display: block;
    font-size: 13px;
    font-weight: var(--zt-font-weight-medium);
    color: var(--zt-text-secondary);
    margin-bottom: 6px;
}

.zt-form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--zt-border);
    border-radius: var(--zt-radius-sm);
    font-size: 16px;
    font-family: var(--zt-font);
    color: var(--zt-text);
    background: var(--zt-bg);
    transition: all var(--zt-duration-fast) var(--zt-ease);
    -webkit-appearance: none;
}

.zt-form-input::placeholder {
    color: var(--zt-text-tertiary);
}

.zt-form-input:focus {
    outline: none;
    border-color: var(--zt-primary);
    box-shadow: 0 0 0 4px var(--zt-primary-light);
}

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

.zt-phone-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px;
}

.zt-civility-row {
    display: flex;
    gap: 8px;
}

.zt-civility-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--zt-border);
    border-radius: var(--zt-radius-sm);
    background: var(--zt-bg);
    font-size: 15px;
    font-weight: var(--zt-font-weight-medium);
    cursor: pointer;
    transition: all var(--zt-duration-fast) var(--zt-ease);
}

.zt-civility-btn:hover {
    border-color: var(--zt-primary);
    background: var(--zt-primary-light);
}

.zt-civility-btn.selected {
    background: var(--zt-primary);
    border-color: var(--zt-primary);
    color: white;
}

.zt-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--zt-primary);
    font-size: 14px;
    font-weight: var(--zt-font-weight-medium);
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
    transition: all var(--zt-duration-fast) var(--zt-ease);
}

.zt-back-btn:hover {
    opacity: 0.7;
}

.zt-back-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--zt-primary);
}

/* ============================================================================
   Écran de succès - Apple Success
   ============================================================================ */
.zt-success {
    display: none;
    padding: 40px 24px;
    text-align: center;
}

.zt-success.visible {
    display: block;
    animation: zt-expandIn 0.4s var(--zt-ease-spring);
}

.zt-success-icon {
    width: 72px;
    height: 72px;
    background: var(--zt-primary-light);
    border-radius: var(--zt-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.zt-success-icon svg {
    width: 36px;
    height: 36px;
    stroke: var(--zt-primary);
    stroke-width: 3;
}

.zt-success h3 {
    font-size: 22px;
    font-weight: var(--zt-font-weight-bold);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.zt-success p {
    color: var(--zt-text-secondary);
    font-size: 15px;
    margin-bottom: 16px;
}

.zt-success-code {
    font-size: 28px;
    font-weight: var(--zt-font-weight-bold);
    color: var(--zt-primary);
    letter-spacing: 3px;
    margin-bottom: 24px;
    font-family: 'SF Mono', 'Menlo', monospace;
}

.zt-success-details {
    background: var(--zt-bg-secondary);
    border-radius: var(--zt-radius-sm);
    padding: 16px;
    text-align: left;
}

/* ============================================================================
   Loading - Apple Spinner
   ============================================================================ */
.zt-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--zt-bg-elevated);
    backdrop-filter: var(--zt-blur);
    -webkit-backdrop-filter: var(--zt-blur);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--zt-radius-lg);
}

.zt-loading.visible {
    display: flex;
}

.zt-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--zt-bg-tertiary);
    border-top-color: var(--zt-primary);
    border-radius: var(--zt-radius-full);
    animation: zt-spin 0.8s linear infinite;
}

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

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 400px) {
    .zt-expanded {
        left: 12px;
        right: 12px;
        width: auto;
        bottom: 12px;
        border-radius: var(--zt-radius);
    }

    .zt-collapsed {
        width: 260px;
    }

    .zentables-widget {
        bottom: 12px;
        right: 12px;
    }
}

@media (max-height: 700px) {
    .zt-expanded {
        max-height: calc(100vh - 24px);
        bottom: 12px;
    }
}

/* ============================================================================
   Dark Mode Support (optionnel - basé sur prefers-color-scheme)
   ============================================================================ */
@media (prefers-color-scheme: dark) {
    .zentables-widget.auto-theme {
        --zt-bg: #1C1C1E;
        --zt-bg-secondary: #2C2C2E;
        --zt-bg-tertiary: #3A3A3C;
        --zt-bg-elevated: rgba(28, 28, 30, 0.72);
        --zt-text: #FFFFFF;
        --zt-text-secondary: #98989D;
        --zt-text-tertiary: #636366;
        --zt-border: rgba(255, 255, 255, 0.1);
        --zt-primary-light: rgba(95, 164, 95, 0.2);
    }
}
