/**
 * Table Styles
 * Modern appointment schedule table
 */

.schedule-section {
    margin: var(--space-2xl) 0;
}

.schedule-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.schedule-header h5 {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
}

/* Desktop Table View */
.table-container {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.table-wrapper {
    overflow-x: auto;
}

.appointment-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.appointment-table thead {
    background: var(--bg-table-header);
    color: var(--text-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.appointment-table th {
    padding: var(--space-md) var(--space-sm);
    text-align: center;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    border-bottom: 2px solid var(--color-primary);
    white-space: nowrap;
}

.appointment-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 11;
    background: var(--bg-table-header);
}

.appointment-table tbody tr {
    transition: background-color var(--transition-fast);
}

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

.appointment-table tbody tr:hover {
    background: rgba(58, 96, 207, 0.05);
}

.appointment-table td {
    padding: var(--space-md) var(--space-sm);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
}

.appointment-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--bg-card);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    border-right: 1px solid var(--border-color);
    z-index: 9;
}

.appointment-table tbody tr:nth-child(even) td:first-child {
    background: var(--bg-card-hover);
}

.appointment-table tbody tr:hover td:first-child {
    background: rgba(58, 96, 207, 0.05);
}

/* Appointment Cell */
.appointment-cell {
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    min-height: 60px;
    vertical-align: middle;
}

.appointment-cell:not(.restricted-cell):hover {
    background: rgba(144, 238, 144, 0.3) !important;
    transform: scale(1.02);
}

.appointment-cell.restricted-cell {
    background: rgba(252, 84, 100, 0.1);
    cursor: not-allowed;
}

.appointment-cell.restricted-cell:hover {
    background: rgba(252, 84, 100, 0.2) !important;
}

.appointment-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.appointment-status {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
}

.appointment-status.open {
    color: var(--color-success);
}

.appointment-status.closed {
    color: var(--text-muted);
}

.appointment-capacity {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card-hover);
    border-radius: var(--border-radius-sm);
}

/* Mobile Schedule View */
.mobile-schedule {
    display: none;
}

.date-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.date-card .card-header {
    background: var(--color-primary);
    color: var(--text-light);
    padding: var(--space-md) var(--space-lg);
    font-weight: var(--font-weight-semibold);
}

.date-card .card-body {
    padding: 0;
}

.time-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.time-slot:last-child {
    border-bottom: none;
}

.time-slot:hover {
    background: rgba(144, 238, 144, 0.2);
}

.time-slot.restricted {
    background: rgba(252, 84, 100, 0.1);
    cursor: not-allowed;
}

.time-slot.restricted:hover {
    background: rgba(252, 84, 100, 0.2);
}

.time-slot-time {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.time-slot-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
}

.time-slot-status.available {
    color: var(--color-success);
}

.time-slot-status.unavailable {
    color: var(--text-muted);
}

/* Hidden state for filtered times */
.hidden {
    display: none !important;
}

/* Responsive Tables */
@media (max-width: 1024px) {
    .appointment-table th,
    .appointment-table td {
        padding: var(--space-sm) var(--space-xs);
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 768px) {
    .table-container {
        display: none;
    }
    
    .mobile-schedule {
        display: block;
    }
}

/* Loading State */
.table-loading {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.table-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}
