/**
 * Guests Page Styles - Miracollo Antigravity
 * Versione: 1.0.0
 * Coerente con planning.css (glassmorphism, colori)
 */

/* ============================================
   CSS VARIABLES
============================================ */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 30, 0.8);
    --bg-hover: rgba(255, 255, 255, 0.05);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    --status-paid: #22c55e;
    --status-partial: #f59e0b;
    --status-pending: #ef4444;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.2s ease;
}

/* ============================================
   BASE STYLES
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================
   HEADER
============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-tabs {
    display: flex;
    gap: 0.25rem;
}

.nav-tab {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-tab.active {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.15);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hotel-name {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   MAIN CONTENT
============================================ */
.main-content {
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* ============================================
   TOOLBAR
============================================ */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.guest-count {
    color: var(--text-muted);
    font-size: 0.875rem;
    background: var(--bg-card);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
}

.toolbar-center {
    flex: 1;
    max-width: 500px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.search-input:not(:placeholder-shown) + .search-clear {
    opacity: 1;
}

.search-clear:hover {
    color: var(--text-primary);
}

.toolbar-right {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   BUTTONS
============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.1rem;
    font-weight: 300;
}

.btn-secondary {
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-danger {
    padding: 0.75rem 1.25rem;
    background: var(--status-pending);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-icon-only {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.btn-icon-only:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon-only.danger:hover {
    color: var(--status-pending);
}

/* ============================================
   TABLE
============================================ */
.table-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.guests-table {
    width: 100%;
    border-collapse: collapse;
}

.guests-table thead {
    background: rgba(0, 0, 0, 0.3);
}

.guests-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.guests-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.guests-table tbody tr:last-child {
    border-bottom: none;
}

.guests-table tbody tr:hover {
    background: var(--bg-hover);
}

.guests-table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
}

/* Column widths */
.col-name { width: 20%; }
.col-email { width: 18%; }
.col-phone { width: 12%; }
.col-nationality { width: 10%; }
.col-document { width: 12%; }
.col-stays { width: 8%; text-align: center; }
.col-loyalty { width: 10%; }
.col-actions { width: 10%; text-align: right; }

/* Guest name cell */
.guest-name {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.guest-name-main {
    font-weight: 600;
    color: var(--text-primary);
}

.guest-name-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Loyalty badge */
.loyalty-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
}

.loyalty-badge.standard {
    background: rgba(100, 100, 100, 0.3);
    color: var(--text-secondary);
}

.loyalty-badge.silver {
    background: rgba(192, 192, 192, 0.2);
    color: #c0c0c0;
}

.loyalty-badge.gold {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.loyalty-badge.platinum {
    background: rgba(229, 228, 226, 0.2);
    color: #e5e4e2;
}

/* Actions cell */
.actions-cell {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
}

/* ============================================
   EMPTY STATE
============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   MODAL
============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-small {
    max-width: 450px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

/* ============================================
   FORM STYLES
============================================ */
.form-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title .toggle-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.collapsible .section-title {
    cursor: pointer;
}

.collapsible .section-title:hover {
    color: var(--text-primary);
}

.collapsible.collapsed .section-content {
    display: none;
}

.collapsible.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ============================================
   TOAST NOTIFICATIONS
============================================ */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    animation: slideIn 0.3s ease;
}

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

.toast.success {
    border-left: 3px solid var(--status-paid);
}

.toast.error {
    border-left: 3px solid var(--status-pending);
}

.toast.warning {
    border-left: 3px solid var(--status-partial);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-center {
        max-width: none;
        order: -1;
    }
    
    .nav-tabs {
        display: none;
    }
    
    .guests-table th,
    .guests-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .col-email,
    .col-document,
    .col-loyalty {
        display: none;
    }
}
