/**
 * ResaVista - Application Client
 * Charte graphique alignée avec la plateforme hôtelière
 */

/* Variables - Identiques à la plateforme principale */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #cffafe;
    
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --header-height: 60px;
    --nav-height: 70px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --bg-tertiary: #475569;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-light: #1e293b;
    --success-light: #064e3b;
    --warning-light: #78350f;
    --danger-light: #7f1d1d;
    --info-light: #164e63;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.client-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.client-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.client-header-inner {
    max-width: 600px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.client-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.client-header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.8rem;
}

.client-room {
    font-weight: 600;
    color: var(--text);
}

.client-guest {
    color: var(--text-muted);
}

/* Main Content */
.client-main {
    flex: 1;
    padding: calc(var(--header-height) + 1rem) 1rem calc(var(--nav-height) + 1rem);
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* Bottom Navigation */
.client-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.5rem;
    z-index: 100;
}

.client-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.client-nav-item svg {
    width: 24px;
    height: 24px;
}

.client-nav-item.active {
    color: var(--primary);
}

.client-nav-item:active {
    background: var(--bg-hover);
}

/* Page Title */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    background: var(--bg);
}

.card-body {
    padding: 1.25rem;
}

/* Service Cards (Home) */
.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.service-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.service-card:active {
    transform: scale(0.98);
}

.service-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card-icon svg {
    width: 28px;
    height: 28px;
}

.service-card-icon.breakfast { background: #fef3c7; color: #f59e0b; }
.service-card-icon.housekeeping { background: #e0e7ff; color: #6366f1; }
.service-card-icon.restaurant { background: #d1fae5; color: #10b981; }
.service-card-icon.parking { background: #cffafe; color: #06b6d4; }
.service-card-icon.room-service { background: #fce7f3; color: #ec4899; }
.service-card-icon.profile { background: var(--bg-hover); color: var(--text-light); }

.service-card-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.service-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: var(--font);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 0.9rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text);
    font-family: var(--font);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Counter Input */
.counter-input {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 0.5rem;
    border: 1px solid var(--border);
}

.counter-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.counter-btn:hover {
    background: var(--primary);
    color: white;
}

.counter-value {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

/* Time Slots */
.time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.time-slot {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
    font-weight: 500;
}

.time-slot:hover {
    border-color: var(--primary);
}

.time-slot.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.time-slot.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg);
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-light);
}

.toggle-label {
    display: flex;
    flex-direction: column;
}

.toggle-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.toggle-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-tertiary);
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.success { background: var(--success-light); color: #059669; }
.status-badge.warning { background: var(--warning-light); color: #b45309; }
.status-badge.danger { background: var(--danger-light); color: #dc2626; }
.status-badge.info { background: #e0e7ff; color: #4f46e5; }

/* Info Box */
.info-box {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #e0e7ff;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid #c7d2fe;
}

[data-theme="dark"] .info-box {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.info-box svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

.info-box p {
    font-size: 0.9rem;
    color: var(--primary-dark);
}

[data-theme="dark"] .info-box p {
    color: var(--primary-light);
}

/* Reservation List */
.reservation-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reservation-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.reservation-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

.reservation-icon svg {
    width: 24px;
    height: 24px;
    color: var(--text-light);
}

.reservation-info {
    flex: 1;
}

.reservation-title {
    font-weight: 600;
}

.reservation-details {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Parking Grid */
.parking-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.parking-spot {
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
    background: var(--bg-card);
}

.parking-spot.available {
    background: var(--success-light);
    border-color: var(--success);
    color: #059669;
}

.parking-spot.occupied {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.parking-spot.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.parking-spot.mine {
    background: #e0e7ff;
    border-color: var(--primary);
    color: var(--primary);
}

/* Menu Items (Room Service) */
.menu-section {
    margin-bottom: 1.5rem;
}

.menu-section-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.menu-item-img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.menu-item-info {
    flex: 1;
}

.menu-item-name {
    font-weight: 600;
}

.menu-item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.menu-item-price {
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.25rem;
}

.menu-item-add {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.menu-item-add:hover {
    background: var(--primary-dark);
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
}

.welcome-banner h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.welcome-banner p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.welcome-banner .stay-info {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.welcome-banner .stay-item {
    display: flex;
    flex-direction: column;
}

.welcome-banner .stay-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

.welcome-banner .stay-value {
    font-weight: 600;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary);
}

.back-link svg {
    width: 18px;
    height: 18px;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: calc(var(--nav-height) + 1rem);
    left: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 568px;
    margin: 0 auto;
}

.toast {
    background: var(--text);
    color: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Print */
@media print {
    .client-header, .client-nav { display: none; }
    .client-main { padding: 0; }
}
