/* Reservations Table - Material Design 3.0 */

.reservations-page {
    padding: 2rem;
    background: var(--bg-primary);
    min-height: 100vh;
}

.reservations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.reservations-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.reservations-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.reservations-count {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--md-corner-radius-small);
    font-size: 0.9rem;
    font-weight: 600;
}

.reservations-filter {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filter-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--md-corner-radius-small);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-chip:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Table Container */
.reservations-table-container {
    background: var(--bg-card);
    border-radius: var(--md-corner-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--md-elevation-1);
}

.reservations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

/* Table Header */
.reservations-table thead {
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.reservations-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.reservations-table th:hover {
    background: var(--bg-hover);
}

.reservations-table th.sortable {
    padding-right: 2rem;
}

.sort-indicator {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.sort-indicator.asc {
    color: var(--primary);
}

.sort-indicator.desc {
    color: var(--primary);
    transform: translateY(-50%) rotate(180deg);
}

/* Table Body */
.reservations-table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

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

.reservations-table tbody tr:nth-child(even) {
    background: rgba(var(--primary-rgb), 0.02);
}

.reservations-table tbody tr:nth-child(even):hover {
    background: var(--bg-hover);
}

.reservations-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

/* Column Styles */
.col-name {
    font-weight: 600;
    color: var(--text-primary);
}

.col-firstname {
    color: var(--text-secondary);
}

.col-phone {
    font-family: var(--font-family-mono);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.col-covers {
    font-weight: 600;
    color: var(--covers-color);
    text-align: center;
}

.col-time {
    font-weight: 600;
    color: var(--primary);
    font-family: var(--font-family-mono);
}

.col-remarks {
    color: var(--text-secondary);
    font-style: italic;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-remarks:hover {
    overflow: visible;
    white-space: normal;
    background: var(--bg-modal);
    position: relative;
    z-index: 100;
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-confirmed {
    background: var(--covers-color);
}

.status-pending {
    background: var(--occupation-color);
}

.status-cancelled {
    background: var(--alert-color);
}

.status-arrived {
    background: var(--primary);
}

/* Action Buttons */
.reservation-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reservations-table tbody tr:hover .reservation-actions {
    opacity: 1;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

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

.action-btn.delete:hover {
    background: var(--alert-color);
}

.action-btn.call:hover {
    background: var(--covers-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

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

.empty-state-message {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

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

/* Search Bar */
.search-container {
    position: relative;
    width: 300px;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--md-corner-radius-small);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--md-corner-radius-small);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Loading State */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--bg-primary), 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .reservations-page {
        padding: 1rem;
    }
    
    .reservations-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .reservations-stats {
        flex-wrap: wrap;
    }
    
    .search-container {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .reservations-table-container {
        overflow-x: auto;
    }
    
    .reservations-table {
        min-width: 800px;
    }
    
    .reservations-header {
        gap: 0.5rem;
    }
    
    .reservations-title {
        font-size: 1.5rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
}

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

.reservations-table tbody tr {
    animation: fadeIn 0.3s ease;
}

/* Highlight searched text */
.highlight {
    background: rgba(var(--primary-rgb), 0.3);
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}