/**
 * Restaurant Reservation System - Front-Office Styles
 * Version 1.1.2
 * v1.1.2: Styles pour affichage des places restantes
 * Interface client pour les réservations
 */

/* Variables */
:root {
    --res-primary: #2563eb;
    --res-primary-hover: #1d4ed8;
    --res-primary-light: #dbeafe;
    --res-secondary: #64748b;
    --res-success: #22c55e;
    --res-warning: #f59e0b;
    --res-danger: #ef4444;
    --res-text: #1e293b;
    --res-text-light: #64748b;
    --res-border: #e2e8f0;
    --res-bg: #f8fafc;
    --res-white: #ffffff;
    --res-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --res-shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --res-radius: 8px;
    --res-radius-lg: 12px;
}

/* Reset */
.res-front-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--res-bg);
    color: var(--res-text);
    line-height: 1.5;
}

/* Container */
.res-front-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.res-front-header {
    background: var(--res-white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--res-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.res-front-logo h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--res-primary);
}

.res-front-logo img {
    max-height: 50px;
    width: auto;
}

/* Restaurant Logo v1.1.1 */
.res-restaurant-logo {
    max-height: 60px;
    width: auto;
    border-radius: var(--res-radius);
}

.res-front-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.res-user-info {
    color: var(--res-text-light);
    font-size: 0.875rem;
}

/* Main */
.res-front-main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.res-front-content {
    background: var(--res-white);
    border-radius: var(--res-radius-lg);
    box-shadow: var(--res-shadow-lg);
    padding: 2rem;
}

/* Restaurant Header v1.1.1 */
.res-restaurant-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--res-border);
}

.res-restaurant-name {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    color: var(--res-primary);
    font-weight: 700;
}

.res-front-title {
    margin: 0;
    font-size: 1.25rem;
    color: var(--res-text-light);
    font-weight: 400;
}

/* Footer */
.res-front-footer {
    background: var(--res-white);
    padding: 1rem 2rem;
    text-align: center;
    color: var(--res-text-light);
    font-size: 0.875rem;
    border-top: 1px solid var(--res-border);
}

/* Buttons */
.res-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--res-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    gap: 0.5rem;
}

.res-btn-primary {
    background: var(--res-primary);
    color: var(--res-white);
}

.res-btn-primary:hover {
    background: var(--res-primary-hover);
}

.res-btn-primary:disabled {
    background: var(--res-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.res-btn-secondary {
    background: var(--res-white);
    color: var(--res-text);
    border: 1px solid var(--res-border);
}

.res-btn-secondary:hover {
    background: var(--res-bg);
}

.res-btn-link {
    background: transparent;
    color: var(--res-primary);
    padding: 0.5rem;
}

.res-btn-link:hover {
    text-decoration: underline;
}

/* Wizard */
.res-wizard {
    max-width: 800px;
    margin: 0 auto;
}

.res-wizard-step {
    display: none;
}

.res-wizard-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.res-step-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
    color: var(--res-text);
}

.res-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--res-primary);
    color: var(--res-white);
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
}

.res-step-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--res-border);
}

.res-placeholder {
    text-align: center;
    color: var(--res-text-light);
    padding: 2rem;
}

/* Calendar */
.res-calendar-wrapper {
    margin-bottom: 1.5rem;
}

.res-calendar-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.res-calendar-prev,
.res-calendar-next {
    background: transparent;
    border: 1px solid var(--res-border);
    padding: 0.5rem 1rem;
    border-radius: var(--res-radius);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--res-text);
    transition: all 0.2s ease;
}

.res-calendar-prev:hover:not(:disabled),
.res-calendar-next:hover:not(:disabled) {
    background: var(--res-bg);
    border-color: var(--res-primary);
}

.res-calendar-prev:disabled,
.res-calendar-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.res-calendars-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.res-calendar-month {
    background: var(--res-white);
    border: 1px solid var(--res-border);
    border-radius: var(--res-radius);
    padding: 1rem;
}

.res-calendar-header {
    text-align: center;
    margin-bottom: 1rem;
}

.res-calendar-header h4 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--res-text);
    text-transform: capitalize;
}

.res-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.5rem;
}

.res-calendar-weekdays span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--res-text-light);
    padding: 0.5rem 0;
}

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

.res-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: var(--res-radius);
    position: relative;
    transition: all 0.2s ease;
}

.res-day-empty {
    background: transparent;
}

.res-day-past {
    color: var(--res-text-light);
    opacity: 0.4;
}

.res-day-today {
    font-weight: 700;
}

.res-day-selectable {
    cursor: pointer;
}

.res-day-selectable:hover {
    background: var(--res-primary-light);
}

.res-day.selected {
    background: var(--res-primary);
    color: var(--res-white);
}

/* Availability dots */
.res-day::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.res-day-available::after {
    background: var(--res-success);
}

.res-day-limited::after {
    background: var(--res-warning);
}

.res-day-full::after {
    background: var(--res-danger);
}

.res-day-closed::after {
    background: #d1d5db;
}

.res-day-past::after {
    display: none;
}

/* Legend */
.res-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--res-border);
}

.res-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--res-text-light);
}

.res-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.res-legend-dot.res-available {
    background: var(--res-success);
}

.res-legend-dot.res-limited {
    background: var(--res-warning);
}

.res-legend-dot.res-full {
    background: var(--res-danger);
}

.res-legend-dot.res-closed {
    background: #d1d5db;
}

/* Shift Selection */
.res-shifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.res-shift-card {
    background: var(--res-white);
    border: 2px solid var(--res-border);
    border-radius: var(--res-radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.res-shift-card:hover {
    border-color: var(--res-primary);
    box-shadow: var(--res-shadow);
}

.res-shift-card.selected {
    border-color: var(--res-primary);
    background: var(--res-primary-light);
}

.res-shift-card h4 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    color: var(--res-text);
}

.res-shift-card .res-shift-time {
    color: var(--res-text-light);
    font-size: 0.875rem;
    margin: 0;
}

/* v1.1.4: Styles pour les services avec disponibilité */
.res-shift-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8fafc;
}

.res-shift-card.disabled:hover {
    border-color: var(--res-border);
    box-shadow: none;
}

.res-shift-status {
    margin: 0.5rem 0 0;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.res-shift-status.res-status-available {
    background: #d1fae5;
    color: #065f46;
}

.res-shift-status.res-status-limited {
    background: #fef3c7;
    color: #92400e;
}

.res-shift-status.res-status-full {
    background: #fee2e2;
    color: #991b1b;
}

.res-shift-max-covers {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}

/* Timeslot Selection */
.res-timeslots-container {
    margin-bottom: 1.5rem;
}

.res-timeslots-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--res-text);
}

.res-timeslots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.res-timeslot {
    padding: 0.75rem 0.5rem;
    background: var(--res-white);
    border: 1px solid var(--res-border);
    border-radius: var(--res-radius);
    text-align: center;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.res-timeslot:hover {
    border-color: var(--res-primary);
}

.res-timeslot.selected {
    background: var(--res-primary);
    color: var(--res-white);
    border-color: var(--res-primary);
}

.res-timeslot.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Party Size */
.res-party-size-container {
    margin-bottom: 1.5rem;
}

.res-party-size-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--res-text);
}

.res-party-size-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.res-party-size-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--res-white);
    border: 1px solid var(--res-border);
    border-radius: var(--res-radius);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.res-party-size-btn:hover:not(:disabled) {
    background: var(--res-primary-light);
    border-color: var(--res-primary);
}

.res-party-size-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.res-party-size-value {
    font-size: 1.5rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* Notes */
.res-notes-container {
    margin-bottom: 1.5rem;
}

.res-notes-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--res-text);
}

.res-notes-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--res-border);
    border-radius: var(--res-radius);
    font-size: 0.875rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    box-sizing: border-box;
}

.res-notes-input:focus {
    outline: none;
    border-color: var(--res-primary);
    box-shadow: 0 0 0 3px var(--res-primary-light);
}

/* Confirmation Summary */
.res-confirmation-summary {
    background: var(--res-bg);
    border-radius: var(--res-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.res-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--res-border);
}

.res-summary-row:last-child {
    border-bottom: none;
}

.res-summary-label {
    color: var(--res-text-light);
}

.res-summary-value {
    font-weight: 500;
    color: var(--res-text);
}

/* Success Message */
.res-success-message {
    text-align: center;
    padding: 2rem;
}

.res-success-icon {
    width: 80px;
    height: 80px;
    background: var(--res-success);
    color: var(--res-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
}

.res-success-message h3 {
    font-size: 1.5rem;
    margin: 0 0 1rem;
    color: var(--res-text);
}

.res-success-message p {
    color: var(--res-text-light);
    margin: 0 0 2rem;
}

.res-success-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Loading */
.res-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--res-text-light);
}

.res-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--res-border);
    border-top-color: var(--res-primary);
    border-radius: 50%;
    margin-right: 0.75rem;
    animation: spin 1s linear infinite;
}

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

/* Notifications */
.res-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--res-radius);
    color: var(--res-white);
    font-size: 0.875rem;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    box-shadow: var(--res-shadow-lg);
}

.res-notification.success {
    background: var(--res-success);
}

.res-notification.error {
    background: var(--res-danger);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* v1.1.2: Styles pour les créneaux avec places restantes */
.res-timeslot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.res-slot-time {
    font-weight: 600;
    font-size: 0.9rem;
}

.res-slot-status {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-weight: 500;
}

.res-slot-status.limited {
    background-color: #fef3c7;
    color: #92400e;
}

.res-slot-status.full {
    background-color: #fee2e2;
    color: #991b1b;
}

.res-timeslot.unavailable {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.res-timeslot.unavailable:hover {
    background-color: #f1f5f9;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .res-front-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .res-front-main {
        padding: 1rem;
    }
    
    .res-front-content {
        padding: 1.5rem;
    }
    
    .res-calendars-container {
        grid-template-columns: 1fr;
    }
    
    .res-calendar-legend {
        gap: 1rem;
    }
    
    .res-step-actions {
        flex-direction: column;
    }
    
    .res-success-actions {
        flex-direction: column;
    }
}

/* ============================================
 * Formulaire de Contact - v1.2.9
 * ============================================ */

.res-contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.res-contact-form .res-form-section {
    margin-bottom: 2rem;
}

.res-contact-form .res-form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dbeafe;
}

/* Civilité */
.res-civility-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.res-civility-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.res-civility-option:hover {
    border-color: #2563eb;
    background: #dbeafe;
}

.res-civility-option input[type="radio"] {
    display: none;
}

.res-civility-option input[type="radio"]:checked + span {
    color: #2563eb;
    font-weight: 600;
}

.res-civility-option:has(input[type="radio"]:checked) {
    border-color: #2563eb;
    background: #dbeafe;
}

/* Grille du formulaire */
.res-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.res-form-grid .res-form-field.full-width {
    grid-column: 1 / -1;
}

.res-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.res-form-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

.res-form-field label .required {
    color: #ef4444;
    margin-left: 0.25rem;
}

.res-form-field input[type="text"],
.res-form-field input[type="email"],
.res-form-field input[type="tel"],
.res-form-field textarea {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

.res-form-field input:focus,
.res-form-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px #dbeafe;
}

.res-form-field input:invalid:not(:placeholder-shown),
.res-form-field input.error {
    border-color: #ef4444;
}

.res-form-field textarea {
    min-height: 100px;
    resize: vertical;
}

/* Checkboxes */
.res-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.res-checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.res-checkbox-field input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    cursor: pointer;
    accent-color: #2563eb;
}

.res-checkbox-field label {
    font-size: 0.875rem;
    color: #1e293b;
    cursor: pointer;
    line-height: 1.4;
}

.res-checkbox-field label a {
    color: #2563eb;
    text-decoration: underline;
}

.res-checkbox-field label a:hover {
    color: #1d4ed8;
}

/* Notice reCAPTCHA */
.res-recaptcha-notice {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.5;
}

.res-recaptcha-notice a {
    color: #2563eb;
    text-decoration: underline;
}

/* Responsive pour le formulaire de contact */
@media (max-width: 640px) {
    .res-civility-options {
        flex-direction: column;
    }
    
    .res-civility-option {
        justify-content: center;
    }
    
    .res-form-grid {
        grid-template-columns: 1fr;
    }
    
    .res-contact-form .res-form-section-title {
        font-size: 0.9rem;
    }
}
