/**
 * NBW Styles - Design System et Widget de Réservation
 * VERSION 1.2.0 - Perplexity Design System Compatible
 */

:root {
  /* Color Tokens */
  --color-white: #ffffff;
  --color-cream-50: #fcfcf9;
  --color-cream-100: #fffdfd;
  --color-slate-500: #626c71;
  --color-slate-900: #13343b;
  --color-teal-500: #21808d;
  --color-teal-600: #1d7480;
  --color-red-500: #c0152f;
  --color-orange-500: #a84b2f;
  --color-brown-rgb: 94, 82, 64;

  /* Semantic Mappings */
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-surface: var(--color-white);
  --color-border: rgba(var(--color-brown-rgb), 0.2);
  --color-error: var(--color-red-500);
  
  /* Spacing & Radius */
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Widget Container */
.nbw-booking {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    background: var(--color-surface);
    color: var(--color-text);
    max-width: 520px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: var(--shadow-sm);
    margin: 20px 0;
}

.nbw-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--space-16);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-12);
}

.nbw-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.nbw-meta {
    font-size: 14px;
    color: var(--color-text-secondary);
    text-align: right;
}

/* Rows & Labels */
.nbw-row {
    margin-bottom: var(--space-16);
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.nbw-row label {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

.nbw-row select {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-base);
    border: 1px solid var(--color-border);
    background-color: var(--color-white);
    font-size: 15px;
}

/* Calendar Grid */
.nbw-calendar {
    background: #fafafa;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-12);
}

.nbw-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.nbw-cal-title {
    font-weight: 700;
    font-size: 16px;
}

.nbw-cal-prev, .nbw-cal-next {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    line-height: 28px;
    text-align: center;
}

.nbw-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.nbw-cal-dow div {
    display: inline-block;
    width: calc(100% / 7);
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: var(--color-slate-500);
    padding-bottom: 8px;
}

.nbw-cal-day {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
}

.nbw-cal-day:hover:not(.is-empty):not(.is-disabled) {
    background: #eee;
    border-color: var(--color-primary);
}

.nbw-cal-day.is-selected {
    background: var(--color-primary) !important;
    color: white;
}

.nbw-cal-day.is-disabled {
    color: #ccc;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ✅ NOUVEAU : Boîte de résumé dynamique */
.nbw-summary-box {
    background: rgba(33, 128, 141, 0.08);
    border: 1px solid var(--color-primary);
    padding: var(--space-16);
    border-radius: var(--radius-md);
    margin: 20px 0;
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.6;
}

.nbw-summary-box strong {
    color: var(--color-primary);
}

/* Button & Messages */
.nbw-btn-hold {
    background: var(--color-primary);
    color: white;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-base);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.nbw-btn-hold:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.nbw-btn-hold:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nbw-msg {
    margin-top: 15px;
    font-size: 13px;
    padding: 10px;
    border-radius: 6px;
    display: none;
}

.nbw-msg.is-ok { background: #e7f6f3; color: #21808d; border: 1px solid #21808d; }
.nbw-msg.is-err { background: #fbe9eb; color: #c0152f; border: 1px solid #c0152f; display: block; }

/* Responsive adjustments */
@media (max-width: 480px) {
    .nbw-booking { padding: 10px; }
    .nbw-cal-day { font-size: 11px; }
}