/**
 * Edmark LMS - Course Dynamic Tables Styles
 * Modern, responsive table styling for coursewise data
 */

/* Table Wrapper */
.edmark-course-table-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin: 40px 0;
}

/* Table Header */
.edmark-course-table-wrapper .table-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #E5E7EB;
}

.edmark-course-table-wrapper .table-title {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.edmark-course-table-wrapper .table-title .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.edmark-course-table-wrapper .table-subtitle {
    font-size: 16px;
    color: #6B7280;
    margin: 0;
}

/* Table Container */
.edmark-table-container {
    overflow-x: auto;
    padding: 0;
}

/* Table Styles */
.edmark-course-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.edmark-course-table thead th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #E5E7EB;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edmark-course-table tbody td {
    padding: 18px 20px;
    border-bottom: 1px solid #F3F4F6;
    color: #0c0c0c;
    vertical-align: middle;
}

.edmark-course-table tbody tr:hover {
    background: #F9FAFB;
    transition: background 0.2s ease;
}

.edmark-course-table tbody tr:last-child td {
    border-bottom: none;
}

.edmark-course-table tfoot td {
    padding: 18px 20px;
    font-weight: 600;
    color: #1F2937;
    border-top: 2px solid #E5E7EB;
}

/* Text Alignment */
.edmark-course-table .text-center {
    text-align: center;
}

.edmark-course-table .text-right {
    text-align: right;
}

.edmark-course-table .text-muted {
    color: #9CA3AF;
}

/* Module Name */
.edmark-course-table .module-name {
    font-size: 15px;
}

.edmark-course-table .module-name strong {
    color: #1F2937;
    font-weight: 600;
}

.edmark-course-table .module-name small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #9CA3AF;
}

/* Badges */
.edmark-course-table .badge-hours,
.edmark-course-table .badge-lessons,
.edmark-course-table .badge-quizzes {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
}

.edmark-course-table .badge-hours {
    background: #DBEAFE;
    color: #1E40AF;
}

.edmark-course-table .badge-lessons {
    background: #D1FAE5;
    color: #065F46;
}

.edmark-course-table .badge-quizzes {
    background: #FEF3C7;
    color: #92400E;
}

/* Status Badge */
.edmark-course-table .status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Focus Items (Study Plan Table) */
.edmark-course-table .focus-item,
.edmark-course-table .deliverable-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}

.edmark-course-table .focus-item:last-child,
.edmark-course-table .deliverable-item:last-child {
    margin-bottom: 0;
}

.edmark-course-table .focus-item .dashicons,
.edmark-course-table .deliverable-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #6B7280;
}

/* Assessment Count */
.edmark-course-table .assessment-count {
    display: inline-block;
    padding: 4px 10px;
    background: #F3F4F6;
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    color: #374151;
}

/* Progress Bar */
.edmark-course-table .progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.edmark-course-table .progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

/* Topics Table */
.edmark-course-table.topics-table .topics-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.edmark-course-table.topics-table .topics-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    padding-left: 0;
    line-height: 1.6;
}

.edmark-course-table.topics-table .topics-list li:last-child {
    margin-bottom: 0;
}

.edmark-course-table.topics-table .topics-list .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Table Footer Note */
.table-footer-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.table-footer-note .dashicons {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .edmark-course-table-wrapper .table-header {
        padding: 24px 20px 16px;
    }
    
    .edmark-course-table-wrapper .table-title {
        font-size: 20px;
    }
    
    .edmark-course-table thead th,
    .edmark-course-table tbody td,
    .edmark-course-table tfoot td {
        padding: 14px 16px;
    }
}

@media (max-width: 768px) {
    .edmark-course-table-wrapper {
        margin: 30px 0;
        border-radius: 8px;
    }
    
    .edmark-course-table-wrapper .table-header {
        padding: 20px 16px 12px;
    }
    
    .edmark-course-table-wrapper .table-title {
        font-size: 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .edmark-course-table-wrapper .table-subtitle {
        font-size: 13px;
    }
    
    /* Make tables scrollable on mobile */
    .edmark-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .edmark-course-table {
        min-width: 600px;
        font-size: 13px;
    }
    
    .edmark-course-table thead th,
    .edmark-course-table tbody td,
    .edmark-course-table tfoot td {
        padding: 12px 12px;
        font-size: 12px;
    }
    
    .edmark-course-table .module-name {
        font-size: 13px;
    }
    
    .edmark-course-table .badge-hours,
    .edmark-course-table .badge-lessons,
    .edmark-course-table .badge-quizzes {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    .edmark-course-table .status-badge {
        padding: 4px 10px;
        font-size: 10px;
    }
    
    .table-footer-note {
        padding: 12px !important;
        font-size: 12px !important;
    }
}

/* Topics Table - Mobile Specific */
@media (max-width: 768px) {
    .edmark-course-table.topics-table {
        min-width: 100%;
    }
    
    .edmark-course-table.topics-table tbody td {
        display: block;
        width: 100%;
        padding: 12px 16px;
    }
    
    .edmark-course-table.topics-table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #E5E7EB;
        border-radius: 8px;
    }
    
    .edmark-course-table.topics-table .module-name {
        background: #F9FAFB;
        border-bottom: 1px solid #E5E7EB;
        padding: 12px 16px !important;
    }
    
    .edmark-course-table.topics-table .topics-list li {
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .edmark-course-table-wrapper {
        box-shadow: none;
        border: 1px solid #E5E7EB;
        page-break-inside: avoid;
    }
    
    .edmark-course-table tbody tr:hover {
        background: transparent;
    }
    
    .table-footer-note {
        page-break-inside: avoid;
    }
}

/* Animation for table rows */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.edmark-course-table tbody tr {
    animation: fadeInUp 0.3s ease forwards;
}

.edmark-course-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.edmark-course-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.edmark-course-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.edmark-course-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.edmark-course-table tbody tr:nth-child(5) { animation-delay: 0.25s; }

/* Accessibility */
.edmark-course-table thead th {
    position: relative;
}

.edmark-course-table:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .edmark-course-table-wrapper {
        background: #1F2937;
    }
    
    .edmark-course-table-wrapper .table-title {
        color: #F9FAFB;
    }
    
    .edmark-course-table-wrapper .table-subtitle {
        color: #9CA3AF;
    }
    
    .edmark-course-table thead th {
        color: #E5E7EB;
        border-bottom-color: #374151;
    }
    
    .edmark-course-table tbody td {
        color: #D1D5DB;
        border-bottom-color: #374151;
    }
    
    .edmark-course-table tbody tr:hover {
        background: #374151;
    }
    
    .edmark-course-table .module-name strong {
        color: #F9FAFB;
    }
}
