/* ==============================
   TuS Courses - Shared Components CSS
   ============================== */

/* ==============================
   CSS CUSTOM PROPERTIES (THEME VARIABLES)
   ============================== */
:root {
    /* Primary theme colors */
    --theme-primary: #fcea10;
    --theme-primary-light: #f4d03f;
    --theme-primary-dark: #e6d409;
    --theme-dark: #1d1d1c;
    --theme-light: #ffffd6;
    
    /* Semantic colors */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --secondary-color: #6c757d;
    
    /* Background variants */
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
    
    /* Shadows */
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0,0,0,0.08);
    --shadow-heavy: 0 15px 40px rgba(252,234,16,0.2);
    
    /* Border radius */
    --radius-small: 0.25rem;
    --radius-medium: 0.375rem;
    --radius-large: 0.5rem;
    --radius-xl: 15px;
}

/* Dark theme variables */
body.dark {
    --bg-card: #2d2d2c;
    --bg-card-hover: #1d1d1c;
    --border-color: #495057;
    --text-muted: #a0a0a0;
    --shadow-heavy: 0 15px 40px rgba(252,234,16,0.1);
}

/* Layout Components */
.full-width-card {
    margin-left: 1rem;
    margin-right: 1rem;
}

.sticky-header {
    position: -webkit-sticky;
    position: sticky;
    top: 70px;
    z-index: 100;
    background-color: #fcea10;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    margin-left: 1rem;
    margin-right: 1rem;
}

/* Icon System */
.icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Theme-aware icon styling - Light Mode */
body.light .theme-icon,
.theme-icon {
    color: #1d1d1c !important;
}

body.light .theme-icon-bg,
.theme-icon-bg {
    background-color: #fcea10 !important;
}

/* Theme-aware icon styling - Dark Mode */
body.dark .theme-icon {
    color: #fcea10 !important;
}

body.dark .theme-icon-bg {
    background-color: #1d1d1c !important;
}

/* Card Components */
.custom-card-header {
    background-color: #fcea10 !important;
    color: #1d1d1c;
    padding: 1rem 1.5rem;
}

.custom-card-border {
    border: 1px solid #dee2e6;
}

.custom-header {
    background: linear-gradient(135deg, #fcea10 0%, #e6d409 100%);
    color: #1d1d1c;
}

.header-title {
    color: #1d1d1c !important;
}

.header-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d1d1c;
}

/* Card Hover Effects */
.hover-card {
    transition: all 0.3s ease;
    /* cursor: pointer; */
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

/* Edit Instructors Layout */
.edit-instructors-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 90px);
}

.instructors-content {
    flex: 1;
    overflow: hidden;
}

.list-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.save-button-container {
    flex-shrink: 0;
    padding: 1rem 0;
    border-top: 1px solid var(--bs-border-color);
    margin-top: auto;
}

/* Light theme save button background */
body.light .save-button-container {
    background-color: #ffffd6;
}

/* Dark theme save button background */
body.dark .save-button-container {
    background-color: #1d1d1c;
    border-top-color: #495057;
}

.save-button-container .btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

.save-button-container .btn:not(:disabled) {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ==============================
   BADGE SYSTEM (CONSOLIDATED)
   ============================== */

/* Instructor/Participant Badges */
.instructor-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.instructor-badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-medium);
    background: rgba(29,29,28,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(29,29,28,0.3);
    color: var(--theme-dark);
    font-weight: 500;
    transition: all 0.2s ease;
}

.instructor-badge:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

/* Badge variants using theme variables */
.badge-theme {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-light) 100%);
    color: var(--theme-dark);
    border: 1px solid rgba(29,29,28,0.2);
    font-weight: 500;
}

.participant-item {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
    transition: none;
}

/* Button Components */
.custom-action-btn {
    background-color: #fcea10 !important;
    border: 1px solid #fcea10 !important;
    color: #1d1d1c !important;
    transition: all 0.3s ease;
}

.custom-action-btn:hover {
    background-color: #1d1d1c !important;
    border-color: #1d1d1c !important;
    color: #fcea10 !important;
}

.custom-action-btn:focus {
    background-color: #1d1d1c !important;
    border-color: #1d1d1c !important;
    color: #fcea10 !important;
    box-shadow: 0 0 0 0.2rem rgba(252, 234, 16, 0.25) !important;
}

/* Three dots menu styling */
.three-dots-menu {
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    user-select: none;
    color: #1d1d1c !important;
}

.three-dots-menu:hover {
    background-color: rgba(29, 29, 28, 0.1);
    color: #1d1d1c !important;
}

/* Loading and Error States */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
}

/* ==============================
   DARK THEME SUPPORT
   ============================== */

/* Dark theme card support */
body.dark .card {
    background-color: #1d1d1c;
    border-color: #495057;
    color: #ffffd6;
}

body.dark .sticky-header {
    background-color: #1d1d1c;
    border-color: #495057;
    color: #ffffd6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark .custom-card-header {
    background-color: #1d1d1c !important;
    color: #fcea10;
}

body.dark .custom-card-border {
    border-color: #495057;
}

body.dark .custom-header {
    background: linear-gradient(135deg, #1d1d1c 0%, #0d0d0c 100%);
    color: #fcea10;
}

body.dark .header-title {
    color: #fcea10 !important;
}

body.dark .header-text {
    color: #fcea10;
}

body.dark .participant-item {
    background-color: #2d2d2c;
    border-color: #495057;
}

body.dark .instructor-badge.bg-light {
    background-color: #495057 !important;
    color: #ffffd6 !important;
    border-color: #6c757d !important;
}

body.dark .custom-action-btn {
    background-color: #1d1d1c !important;
    border: 1px solid #1d1d1c !important;
    color: #fcea10 !important;
    transition: all 0.3s ease;
}

body.dark .custom-action-btn:hover {
    background-color: #fcea10 !important;
    border-color: #fcea10 !important;
    color: #1d1d1c !important;
}

body.dark .custom-action-btn:focus {
    background-color: #fcea10 !important;
    border-color: #fcea10 !important;
    color: #1d1d1c !important;
    box-shadow: 0 0 0 0.2rem rgba(29, 29, 28, 0.25) !important;
}

body.dark .three-dots-menu {
    color: #fcea10 !important;
}

body.dark .three-dots-menu:hover {
    background-color: rgba(252, 234, 16, 0.1);
    color: #fcea10 !important;
}

body.dark .text-muted {
    color: #a0a0a0 !important;
}

body.dark .fw-semibold {
    color: #ffffd6 !important;
}

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

/* Mobile-specific optimizations */
@media (max-width: 768px) {

    .sticky-header,
    .full-width-card {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    .sticky-header {
        top: calc(env(safe-area-inset-top, 0px) + 70px);
        border-radius: 0.375rem;
    }

    .three-dots-menu {
        font-size: 1.3rem;
        padding: 0.5rem;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .custom-action-btn {
        min-height: 44px;
        font-size: 1rem;
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .header-text {
        font-size: 1.1rem;
    }

    /* Remove hover effects on mobile */
    .three-dots-menu:hover {
        background-color: transparent;
    }

    body.dark .three-dots-menu:hover {
        background-color: transparent;
    }

    .custom-action-btn:hover {
        background-color: #fcea10 !important;
        border-color: #fcea10 !important;
        color: #1d1d1c !important;
    }

    body.dark .custom-action-btn:hover {
        background-color: #1d1d1c !important;
        border-color: #1d1d1c !important;
        color: #fcea10 !important;
    }
}

/* Remove hover effects from cards */
.card:hover {
    transform: none !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Schedule Grid Styling */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    min-height: 300px;
}

.day-column {
    display: flex;
    flex-direction: column;
    border: 2px solid #1d1d1c;
    border-radius: 0.375rem;
    overflow: hidden;
}

.day-header {
    background-color: #1d1d1c;
    color: #ffffd6;
    padding: 0.75rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #ffffd6;
}

.day-schedules {
    flex: 1;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.schedule-item {
    background-color: #fcea10;
    border: 1px solid #1d1d1c;
    border-radius: 0.25rem;
    padding: 0.5rem;
    font-size: 0.875rem;
    position: relative;
}

.schedule-time {
    font-weight: 600;
    color: #1d1d1c;
}

.schedule-duration {
    font-size: 0.75rem;
    color: #1d1d1c;
    margin: 0.25rem 0;
    opacity: 0.7;
}

.schedule-actions {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
}

.schedule-actions .dropdown-toggle::after {
    display: none;
}

.schedule-actions .btn {
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    color: #1d1d1c;
    font-size: 1rem;
}

.schedule-actions .btn:hover {
    background-color: rgba(29, 29, 28, 0.1);
}

.no-schedule {
    text-align: center;
    padding: 2rem 0.5rem;
    color: #6c757d;
}

/* Dark theme schedule support */
body.dark .day-header {
    background-color: #fcea10;
    color: #1d1d1c;
    border-bottom: 2px solid #1d1d1c;
}

body.dark .day-column {
    border-color: #fcea10;
}

body.dark .schedule-item {
    background-color: #1d1d1c;
    border-color: #fcea10;
}

body.dark .schedule-time {
    color: #fcea10;
}

body.dark .schedule-duration {
    color: #fcea10;
}

body.dark .schedule-actions .btn {
    color: #fcea10;
}

/* Mobile schedule optimizations */
@media (max-width: 768px) {
    .schedule-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .day-column {
        margin-bottom: 1rem;
    }
}

/* Ensure consistent text colors across themes */
body.light {
    --text-primary: #1d1d1c;
    --text-muted: #6c757d;
    --bg-primary: #ffffd6;
    --accent-primary: #fcea10;
}

body.dark {
    --text-primary: #ffffd6;
    --text-muted: #a0a0a0;
    --bg-primary: #1d1d1c;
    --accent-primary: #fcea10;
}

/* ==============================
   ATTENDANCE MATRIX STYLING
   ============================== */

/* Full viewport height container for attendance */
.attendance-full-height {
    height: calc(100vh - 180px);
    overflow: hidden;
}

.attendance-full-height .card {
    height: 100%;
    overflow: hidden;
}

.attendance-full-height .card-body {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Attendance Matrix Container */
.attendance-matrix-container {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    min-width: 100%;
    position: relative;
    max-height: calc(100vh - 280px);
}

/* Attendance Grid */
.attendance-header {
    display: grid;
    align-items: center;
    gap: 1px;
    background-color: #dee2e6;
    border-radius: 0.25rem 0.25rem 0 0;
    overflow: hidden;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
}

.attendance-matrix {
    display: grid;
    align-items: center;
    gap: 1px;
    background-color: #dee2e6;
    border-radius: 0 0 0.25rem 0.25rem;
    overflow: hidden;
}

/* Headers */


/* Participant Cells */
.participant-cell {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-right: 1px solid #dee2e6;
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: var(--participant-column-width, 200px);
    display: flex;
    align-items: center;
}

.participant-name {
    font-weight: 500;
    color: #1d1d1c;
}

/* Attendance Cells */
.attendance-cell {
    background-color: #ffffff;
    padding: 0.5rem;
    text-align: center;
    min-width: 120px;
    border-right: 1px solid #dee2e6;
}

/* Attendance Buttons */
.attendance-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 auto;
}

.attendance-btn.present {
    background-color: #28a745;
    color: white;
    border-color: #1e7e34;
}

.attendance-btn.absent {
    background-color: #dc3545;
    color: white;
    border-color: #bd2130;
}

.attendance-btn.unmarked {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

.attendance-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Dark theme attendance support */


body.dark .participant-cell {
    background-color: #2d2d2c;
    border-color: #495057;
}

body.dark .participant-name {
    color: #ffffd6;
}

body.dark .attendance-cell {
    background-color: #1d1d1c;
    border-color: #495057;
}

body.dark .attendance-btn.unmarked {
    background-color: #495057;
    color: #a0a0a0;
    border-color: #6c757d;
}

/* Mobile attendance optimizations */
@media (max-width: 768px) {
    .attendance-full-height {
        height: calc(100vh - 120px);
    }

    .participant-header,
    .participant-cell {
        min-width: var(--participant-column-width, 200px);
    }

    .date-header,
    .attendance-cell {
        min-width: 80px;
    }

    .attendance-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .date-header {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }
}

/* === IMPORT WORKFLOW STYLES === */
.import-wizard-steps {
    /* Background and border are now handled by ThemedCard */
    padding: 0;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 100px;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.step-indicator.active .step-number {
    background: #1d1d1c;
    color: #fcea10;
    border-color: #1d1d1c;
    transform: scale(1.1);
}

.step-indicator.completed .step-number {
    background: #1d1d1c;
    color: #fcea10;
    border-color: #1d1d1c;
}

.step-title {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.step-indicator.active .step-title {
    color: var(--text-primary);
    font-weight: bold;
}

.step-connector {
    flex: 1;
    height: 3px;
    background: var(--text-primary);
    margin: 0 1rem;
    margin-top: 20px;
    border-radius: 2px;
}

/* Dark theme support for import wizard is handled by ThemedCard */

body.dark .step-number {
    background: #495057;
    color: #a0a0a0;
}

body.dark .step-indicator.active .step-number {
    background: #fcea10;
    color: #1d1d1c;
    border-color: #fcea10;
}

body.dark .step-indicator.completed .step-number {
    background: #fcea10;
    color: #1d1d1c;
    border-color: #fcea10;
}

/* Step titles and connectors now use CSS variables for automatic theming */

.file-upload-zone {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bs-light);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.file-upload-zone:hover {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

.file-upload-zone.drag-over {
    border-color: var(--bs-success);
    background: var(--bs-success-bg-subtle);
}

.file-upload-zone.loading {
    pointer-events: none;
    opacity: 0.7;
}

.mapping-table th {
    background: var(--bs-secondary-bg);
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.mapping-table td {
    padding: 0.5rem;
    font-size: 0.875rem;
    color: var(--bs-text-primary);
    vertical-align: middle;
}

.mapping-table .form-select,
.text-muted {
    font-size: 0.875rem;
}

.preview-value {
    font-family: monospace;
    background: var(--bs-secondary-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.result-stat {
    background: var(--bs-success-border-subtle);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.result-stat.success {
    background: var(--bs-success-bg-subtle);
    border: 1px solid var(--bs-success-border-subtle);
}

.result-stat.info {
    background: var(--bs-info-bg-subtle);
    border: 1px solid var(--bs-info-border-subtle);
}

.result-stat.warning {
    background: var(--bs-warning-bg-subtle);
    border: 1px solid var(--bs-warning-border-subtle);
}

.result-stat .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--bs-text-muted);
}

.result-stat .stat-label {
    color: var(--bs-text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.progress-stat {
    padding: 0.5rem;
}

.progress-stat .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--bs-primary);
}

.progress-stat .stat-label {
    color: var(--bs-text-muted);
    font-size: 0.875rem;
}

.stat-item {
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: #d1e7dd;
    margin-bottom: 0.5rem;
}

.stat-item .stat-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--bs-text-muted);
}

.stat-item .stat-label {
    color: var(--bs-text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.preview-data {
    max-height: 300px;
    overflow-y: auto;
}