/* BB Groups Schedule Table Widget Styles */

/* Base Table Styles */
.bb-schedule-table-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.bb-schedule-table {
    width: 100%;
    margin: 0;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border-collapse: collapse;
}

/* Modern Table Variations */
.bb-schedule-table.table-modern {
    border-spacing: 0 10px;
    border-collapse: separate;
}

.bb-schedule-table.table-modern tbody tr {
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bb-schedule-table.table-modern tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.bb-schedule-table.table-modern td {
    border: none;
    padding: 20px;
}

.bb-schedule-table.table-modern td:first-child {
    border-radius: 10px 0 0 10px;
}

.bb-schedule-table.table-modern td:last-child {
    border-radius: 0 10px 10px 0;
}

/* Glassmorphism Style */
.bb-schedule-table.table-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
}

.bb-schedule-table.table-glass thead {
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.bb-schedule-table.table-glass tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dark Theme */
.bb-schedule-table.dark-theme {
    background: #1a1a1a;
    color: #e0e0e0;
}

.bb-schedule-table.dark-theme thead {
    background: #0a0a0a;
    color: #fff;
}

.bb-schedule-table.dark-theme tbody tr {
    border-bottom: 1px solid #2a2a2a;
}

.bb-schedule-table.dark-theme tbody tr:hover {
    background: #252525;
}

/* Gradient Headers */
.bb-schedule-table.gradient-1 thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.bb-schedule-table.gradient-2 thead {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.bb-schedule-table.gradient-3 thead {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
}

.bb-schedule-table.gradient-4 thead {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: #fff;
}

/* Table Layout Styles */
.bb-schedule-table thead {
    background: #2c3e50;
    color: #fff;
}

.bb-schedule-table thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bb-schedule-table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.bb-schedule-table tbody tr {
    transition: all 0.3s ease;
}

.bb-schedule-table.table-striped tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.bb-schedule-table.table-hover tbody tr:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.bb-schedule-table.table-bordered {
    border: 1px solid #dee2e6;
}

.bb-schedule-table.table-bordered td,
.bb-schedule-table.table-bordered th {
    border: 1px solid #dee2e6;
}

.bb-schedule-table tbody td.day-cell {
    font-weight: 600;
    background-color: #f1f3f5;
    vertical-align: top;
}

/* BuddyBoss Integration Styles */
.subject-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.subject-link:hover .subject-pill {
    background: #007cba;
    color: #fff;
    transform: scale(1.05);
}

/* Time Slot Styling */
.time-slot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Subject Pills */
.subject-pill {
    background: #f0f0f0;
    padding: 6px 16px;
    border-radius: 25px;
    display: inline-block;
    transition: all 0.3s ease;
}

.subject-pill:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

/* Badge Styles for Exam Boards */
.exam-board-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exam-board-badge.cambridge {
    background: #e3f2fd;
    color: #1976d2;
}

.exam-board-badge.edexcel {
    background: #fce4ec;
    color: #c2185b;
}

/* Enrollment Status */
.enrollment-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
}

.enrollment-status.enrolled {
    color: #2e7d32;
}

.enrollment-status.not-enrolled {
    color: #d32f2f;
}

/* Animated Hover Effects */
.bb-schedule-table tbody tr {
    position: relative;
    overflow: hidden;
}

/* Mobile Card Layout */
@media (max-width: 768px) {
    .bb-schedule-table tbody tr {
        background: #fff;
        border-radius: 12px;
        margin-bottom: 16px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
        transition: all 0.3s ease;
    }
    
    .bb-schedule-table tbody tr:active {
        transform: scale(0.98);
    }
    
    .bb-schedule-table tbody td.day-cell {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #fff;
        font-size: 20px;
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
        padding: 20px;
        text-align: center;
        position: relative;
        overflow: hidden;
    }
    
    .bb-schedule-table tbody td.day-cell::after {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 200%;
        height: 200%;
        background: rgba(255, 255, 255, 0.1);
        transform: rotate(45deg);
    }
}

/* Accordion Styles */
.mobile-accordion {
    display: none;
}

.accordion-day {
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Today's accordion header highlight */
.accordion-day.is-today .accordion-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

/* Today badge */
.accordion-day.is-today .accordion-header .today-badge {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 1px;
    margin-left: 10px;
    display: inline-block;
}

.accordion-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #3498db;
    transition: width 0.3s ease;
}

.accordion-header:hover::before,
.accordion-header.active::before {
    width: 100%;
    opacity: 0.1;
}

.accordion-header::after {
    content: '+';
    font-size: 24px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.accordion-header.active::after {
    transform: rotate(45deg);
}

.accordion-content {
    display: none;
    padding: 15px;
    background-color: #f8f9fa;
}

.accordion-content.active {
    display: block;
}

.mobile-time-slot {
    position: relative;
    padding: 15px;
    padding-left: 30px;
    margin-bottom: 10px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.mobile-time-slot::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
}

.mobile-time-slot:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.mobile-time-slot:last-child {
    margin-bottom: 0;
}

.mobile-time {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.mobile-subject {
    color: #495057;
    margin-bottom: 5px;
    font-size: 16px;
}

.mobile-subject a {
    color: #007cba;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-subject a:hover {
    color: #005a87;
    text-decoration: underline;
}

.mobile-board {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 5px;
}

.mobile-instructor {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 5px;
}

.mobile-status {
    margin-top: 10px;
}

/* Detail Row Styles */
.detail-row td {
    background: #f8f9fa;
    padding: 0 !important;
}

.detail-wrapper {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    padding: 10px;
    background: #fff;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.detail-item strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

/* Loading Animation */
.bb-schedule-table.loading tbody {
    opacity: 0.5;
    pointer-events: none;
}

.bb-schedule-table.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Sort Indicators */
.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 25px !important;
}

.sort-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.sortable:hover .sort-icon {
    opacity: 1;
}

.sort-asc .sort-icon::before {
    content: '↑';
}

.sort-desc .sort-icon::before {
    content: '↓';
}

/* Selected Row Highlight */
.bb-schedule-table tbody tr.selected-row {
    background-color: #e3f2fd !important;
    box-shadow: 0 0 0 2px #2196f3;
}

/* Hover Active State */
.bb-schedule-table tbody tr.hover-active {
    background-color: #f5f5f5;
}

/* Has Overflow Indicator */
.bb-schedule-table-wrapper.has-overflow {
    position: relative;
}

.bb-schedule-table-wrapper.has-overflow::after {
    content: '→';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: #999;
    animation: slide 1.5s ease-in-out infinite;
}

@keyframes slide {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(10px); }
}

/* Print Styles */
@media print {
    .bb-schedule-table-wrapper {
        overflow: visible !important;
    }
    
    .bb-schedule-table {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .bb-schedule-table thead {
        background: #f0f0f0 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .bb-schedule-table tbody tr:nth-child(even) {
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .mobile-accordion {
        display: none !important;
    }