/* My Courses Page - Table Layout */

:root {
    --primary-900: #0F172A;
    --primary-700: #1E40AF;
    --primary-600: #2563EB;
    --primary-500: #3B82F6;
    --primary-200: #BFDBFE;
    --primary-50: #DBEAFE;
    --accent-600: #0891B2;
    --accent-500: #06B6D4;
    --accent-50: #CFFAFE;
    --success: #10B981;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

/* Remove theme padding from parent container on My Courses page */
#primary.content-area.wpex-clr {
    padding-bottom: 0 !important;
}

/* Page Background - Full width wrapper */
.dep-my-courses-wrapper {
    background: var(--gray-50);
    width: 100%;
    padding: 2rem 0 3rem 0;
    margin: 0;
}

/* Container - Content centered with max-width */
.dep-my-courses-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 3rem 2rem;
}

/* Empty/Notice States */
.dep-my-courses.dep-empty,
.dep-my-courses.dep-notice {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--gray-600);
    font-size: 1.125rem;
}

.dep-my-courses.dep-notice {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--gray-700);
}

.dep-my-courses.dep-notice a {
    color: var(--primary-700);
    font-weight: 600;
    text-decoration: none;
}

.dep-my-courses.dep-notice a:hover {
    text-decoration: underline;
}

/* ==================== HEADER ==================== */

.dep-courses-header {
    margin-bottom: 2rem;
}

.dep-courses-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 1.5rem 0;
    letter-spacing: -0.02em;
}

/* Stats */
.dep-courses-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.stat {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 200ms ease;
}

.stat:hover {
    border-color: var(--primary-200);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-700);
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-top: 0.25rem;
}

/* ==================== TABS ==================== */

.dep-courses-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 200ms ease;
}

.tab-btn:hover {
    color: var(--gray-900);
    border-bottom-color: var(--gray-300);
}

.tab-btn-active {
    color: var(--primary-700);
    border-bottom-color: var(--primary-700);
}

/* ==================== TABLE ==================== */

.dep-courses-table-wrapper {
    overflow-x: auto;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.dep-courses-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.dep-courses-table thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.dep-courses-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dep-courses-table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: all 200ms ease;
}

.dep-courses-table tbody tr:hover {
    background: var(--gray-50);
}

.dep-courses-table tbody tr:last-child {
    border-bottom: none;
}

.dep-courses-table td {
    padding: 1.5rem 1rem;
    vertical-align: middle;
}

/* Course Column */
.course-col {
    min-width: 300px;
}

.course-info {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.dep-course-table-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--gray-100);
    flex-shrink: 0;
}

.dep-course-table-thumb.dep-placeholder {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.course-meta h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.3;
}

.course-next {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0.25rem 0 0 0;
}

/* Course Card - needs position:relative so flag/logo overlays work */
.course-card-link {
    position: relative;
}

/* Course Card Flag - Language flag in top-left corner of insignia area */
.course-card-flag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 10;
}

.course-card-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Course Badge/Insignia */
.course-card-insignia {
    display: flex;
    justify-content: flex-start;
    margin-top: 0.75rem;
}

.course-card-insignia img {
    height: 50px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    border-radius: 4px;
}

/* Progress Column */
.progress-col {
    min-width: 150px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-600) 0%, var(--primary-500) 100%);
    border-radius: 4px;
    transition: width 300ms ease;
}

/* 100% progress = green */
.course-row[data-status="completed"] .progress-fill {
    background: var(--success);
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Date/Time Columns */
.date-col,
.time-col {
    font-size: 0.9rem;
    color: var(--gray-600);
    text-align: center;
}

/* Actions Column */
.actions-col {
    text-align: center;
    min-width: 250px;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.btn-continue {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: var(--primary-700);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 200ms ease;
    cursor: pointer;
    border: none;
}

.btn-continue:hover {
    background: var(--primary-600);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-reset-progress {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 200ms ease;
    cursor: pointer;
}

.btn-reset-progress:hover {
    background: #DC2626;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-reset-progress:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1200px) {
    .dep-my-courses-container {
        padding: 1.5rem;
    }

    .dep-courses-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .course-col {
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .dep-my-courses-wrapper {
        padding: 1rem 0;
    }

    .dep-my-courses-container {
        padding: 0 1rem;
    }

    .dep-courses-header h1 {
        font-size: 1.5rem;
    }

    .dep-courses-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

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

    .dep-courses-table {
        min-width: 800px;
    }

    .dep-courses-table td {
        padding: 1rem 0.75rem;
        font-size: 0.85rem;
    }

    .dep-courses-table th {
        padding: 0.75rem;
        font-size: 0.75rem;
    }

    .course-col {
        min-width: 200px;
    }

    .course-info {
        gap: 0.75rem;
    }

    .dep-course-table-thumb {
        width: 50px;
        height: 50px;
    }

    .course-meta h3 {
        font-size: 0.85rem;
    }

    .course-next {
        display: none;
    }

    .course-card-insignia {
        margin-top: 0.5rem;
    }

    .course-card-insignia img {
        height: 40px;
        max-width: 60px;
    }

    .progress-col {
        min-width: 120px;
    }

    .actions-col {
        min-width: 200px;
    }

    .btn-continue,
    .btn-reset-progress {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .dep-my-courses-wrapper {
        padding: 0.75rem 0;
    }

    .dep-my-courses-container {
        padding: 0 0.75rem;
    }

    .dep-courses-header h1 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .dep-courses-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .stat-icon {
        width: 24px;
        height: 24px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .dep-courses-tabs {
        overflow-x: auto;
        margin: 1rem 0;
        gap: 0;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .dep-courses-table {
        min-width: 100%;
        font-size: 0.8rem;
    }

    .dep-courses-table td,
    .dep-courses-table th {
        padding: 0.75rem 0.5rem;
    }

    .course-col {
        min-width: 130px;
    }

    .dep-course-table-thumb {
        width: 40px;
        height: 40px;
    }

    .course-meta h3 {
        font-size: 0.8rem;
    }

    .progress-col {
        min-width: 80px;
    }

    .progress-bar {
        height: 6px;
        margin-bottom: 0.25rem;
    }

    .progress-text {
        font-size: 0.75rem;
    }

    .date-col,
    .time-col {
        display: none;
    }

    .actions-col {
        min-width: 120px;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .btn-continue,
    .btn-reset-progress {
        padding: 0.45rem 0.8rem;
        font-size: 0.75rem;
        width: 100%;
        text-align: center;
    }
}
