/* Time Blocks Table Styles */
.time-blocks-table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.25rem;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.time-blocks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.time-blocks-table th {
    background: #1e293b;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    position: relative;
    border: none;
}

.time-blocks-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.time-blocks-table th.sortable:hover {
    background: #334155;
}

.sort-indicator {
    margin-left: 5px;
    font-size: 0.8em;
}

.time-blocks-table td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #e9ecef;
    position: relative;
    vertical-align: middle;
}

.date-cell {
    background: #f8f9fa;
    text-align: left !important;
    min-width: 120px;
}

.date-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-content strong {
    color: #333;
    font-size: 0.95rem;
}

.date-content small {
    color: #6c757d;
    font-size: 0.8rem;
}

.day-name {
    color: #3b82f6;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.block-content {
    position: relative;
    min-height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.event-count {
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.activity-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: #10b981;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Cell Activity Classes */
.no-activity {
    background: #f8f9fa;
    color: #6c757d;
}

.low-activity {
    background: #e8f5e9;
    color: #2e7d32;
}

.medium-activity {
    background: #fff3e0;
    color: #ef6c00;
}

.high-activity {
    background: #ffebee;
    color: #c62828;
}

/* Row Classes */
.time-blocks-table tr.today {
    background: rgba(33, 150, 243, 0.05);
    border: 2px solid #2196f3;
}

.time-blocks-table tr.no-data {
    opacity: 0.6;
}

.time-blocks-table tr.high-activity {
    background: rgba(76, 175, 80, 0.05);
}

.total-cell {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.summary-row {
    background: #f1f5f9;
    font-weight: bold;
    border-top: 2px solid #cbd5e1;
}

.summary-row td {
    padding: 15px 8px;
    color: #333;
}

/* Loading and Empty States */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.spinner-large {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h5 {
    color: #333;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 20px;
}

/* Table Summary */
.table-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #3b82f6;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    color: #3b82f6;
    border: 1px solid #3b82f6 !important;
}

.btn-outline:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-1px);
    border: 1px solid #3b82f6 !important;
}

/* Ensure Bootstrap outline primary buttons are visible (fix hover/invisible issue) */
.btn-outline-primary {
    background: transparent;
    color: #0d6efd; /* bootstrap primary */
    border: 1px solid #0d6efd !important;
}

.btn-outline-primary:hover:not(:disabled) {
    background: #0d6efd;
    color: #ffffff;
    transform: translateY(-1px);
    border: 1px solid #0a58ca !important;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .table-actions {
        justify-content: center;
    }

    .time-blocks-table {
        font-size: 0.8rem;
    }

    .time-blocks-table th,
    .time-blocks-table td {
        padding: 8px 4px;
    }

    .date-cell {
        min-width: 100px;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .time-blocks-table th,
    .time-blocks-table td {
        padding: 6px 2px;
        font-size: 0.75rem;
    }
}
