/* ===========================
      MODERN COURSES DASHBOARD STYLES
      =========================== */

.courses-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Apply modern form styling to Bootstrap controls inside Investech modals */
.modal-investech .form-control,
.modal-investech .form-select,
.modal-investech textarea.form-control {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #ffffff;
    width: 100%;
}

.modal-investech .form-select {
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
}

.modal-investech .form-control:focus,
.modal-investech .form-select:focus,
.modal-investech textarea.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    background: #fafbff;
}

.modal-investech .form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.modal-investech .form-control.is-invalid,
.modal-investech .form-select.is-invalid,
.modal-investech textarea.form-control.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.modal-investech .form-control.is-valid,
.modal-investech .form-select.is-valid,
.modal-investech textarea.form-control.is-valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.modal-investech .form-select.is-valid,
.modal-investech .form-select.is-invalid {
    --bs-form-select-bg-icon: none;
}


/* Header Styles */
.dashboard-header {
    background: var(--primary-gradient);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,1000 1000,0 1000,1000"/></svg>');
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.dashboard-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin: 0.5rem 0 0 0;
    font-weight: 400;
}

.btn-create-course {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    color: white;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-create-course:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.6);
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
}

/* Controls Styles */
.dashboard-controls {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.controls-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1.5rem;
    align-items: end;
}

.search-container {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: #94a3b8;
    font-size: 1.1rem;
    z-index: 2;
}

.search-clear-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #94a3b8;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 2;
}

.search-clear-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.filter-container, .entries-container {
    position: relative;
}

.filter-label, .entries-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.filter-select, .filter-container select, .entries-select {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: #f8fafc;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus, .filter-container select:focus, .entries-select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-icon, .filter-container i, .entries-icon {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    color: #94a3b8;
    pointer-events: none;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
    margin-bottom: 1.5rem;
}

.table-wrapper {
    overflow-x: auto;
}

.courses-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Allow member settings table content to wrap without clipping translations */
#membersTable th,
#membersTable td {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

/* Apply table header styles to any CRUD table */
.table-header,
.courses-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.table-header th,
.courses-table thead th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.875rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

.table-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.table-header th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.875rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

.sortable-header,
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    position: relative;
}

.sortable-header:hover,
th.sortable:hover {
    background: rgba(102, 126, 234, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sort-icon {
    opacity: 0.4;
    transition: opacity 0.2s ease;
    font-size: 0.75rem;
}

.sortable-header:hover .sort-icon,
th.sortable:hover .sort-icon {
    opacity: 0.8;
}

.sortable-header.asc .sort-icon,
.sortable-header.desc .sort-icon,
th.sortable.asc .sort-icon,
th.sortable.desc .sort-icon {
    opacity: 1;
    color: #667eea;
}

.actions-header {
    text-align: center;
    width: 180px;
}

.table-body .table-row,
.courses-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.table-body .table-row:hover,
.courses-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(0, 64, 255, 0.02) 0%, rgba(0, 217, 116, 0.02) 100%);
}

.table-body .table-row.own-course {
    background: linear-gradient(135deg, rgba(0, 64, 255, 0.05) 0%, rgba(0, 217, 116, 0.05) 100%);
    border-left: 4px solid #667eea;
}

.table-body .table-row.own-course:hover {
    background: linear-gradient(135deg, rgba(0, 64, 255, 0.08) 0%, rgba(0, 217, 116, 0.08) 100%);
}

.table-body td,
.courses-table tbody td {
    padding: 1.25rem 1.5rem;
    vertical-align: top;
    border-bottom: 1px solid #f1f5f9;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}

/* Email cell specific styling */
.courses-table tbody td:first-child {
    word-break: break-all;
    cursor: pointer;
    transition: all 0.3s ease;
}

.courses-table tbody td:first-child:hover {
    background: linear-gradient(135deg, rgba(0, 64, 255, 0.05) 0%, rgba(0, 217, 116, 0.05) 100%);
    transform: scale(1.02);
    z-index: 10;
    position: relative;
    white-space: normal;
    word-break: break-all;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-weight: 600;
    color: #0040ff;
}

/* Tooltip for long email addresses */
.email-tooltip {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a202c;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.email-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a202c;
}

.courses-table tbody td:first-child:hover .email-tooltip {
    opacity: 1;
}

/* Course Name Cell */
.course-name-cell {
    width: 35%;
}

.course-info {
    display: flex;
    flex-direction: column;
}

.course-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.course-description {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

.owner-badge {
    background: var(--primary-gradient);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Instructor Cell */
.instructor-cell {
    width: 25%;
}

.instructor-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.instructor-avatar {
    font-size: 2rem;
    color: #667eea;
}

.instructor-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.instructor-role {
    font-size: 0.8rem;
    color: #64748b;
}

/* Status Cell */
.status-cell {
    width: 15%;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-pending {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #92400e;
}

.status-accepted {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #065f46;
}

.status-rejected {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: #991b1b;
}

.status-default {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: #1e293b;
}

/* Actions Cell */
.actions-cell {
    width: 1%;
    overflow: visible;
    white-space: nowrap;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.action-view,
.action-btn.view {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.action-view:hover,
.action-btn.view:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.action-edit,
.action-btn.edit {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.action-edit:hover,
.action-btn.edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.action-status {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.action-status:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.action-delete,
.action-btn.delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.action-delete:hover,
.action-btn.delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.action-disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Empty State */
.empty-state td {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-icon {
    font-size: 4rem;
    color: #cbd5e1;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #64748b;
    margin: 0;
}

.empty-description {
    font-size: 1rem;
    color: #94a3b8;
    margin: 0;
    max-width: 400px;
    line-height: 1.6;
}

/* Pagination */
.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.pagination-info {
    color: #64748b;
    font-size: 0.875rem;
}

.filtered-info {
    color: #94a3b8;
    font-style: italic;
}

.pagination-list {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-list .page-item {
    border-radius: 8px;
    overflow: hidden;
}

.pagination-list .page-link {
    padding: 0.5rem 0.875rem;
    color: #64748b;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-list .page-item.active .page-link {
    background: var(--primary-gradient);
    color: white;
    border-color: #667eea;
}

.pagination-list .page-link:hover:not(.disabled) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-color: #667eea;
}

.pagination-list .page-item.disabled .page-link {
    color: #cbd5e1;
    cursor: not-allowed;
}

/* Modal Styles */
.modern-modal {
    border: none;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modern-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
}

.modern-header .modal-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: #1e293b;
}

.modern-body {
    padding: 2rem;
}

.modern-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
    gap: 1rem;
}

.modern-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
}

.modern-btn.btn-primary {
    background: var(--primary-gradient);
    border-color: #667eea;
}

.modern-btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.modern-btn.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

.modern-btn.btn-secondary:hover {
    background: #e2e8f0;
    color: #475569;
}

.modern-btn.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
}

.modern-btn.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.readonly-input {
    background: #f1f5f9 !important;
    color: #64748b;
    cursor: not-allowed;
}

.select-wrapper {
    position: relative;
}

.form-select {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: #f8fafc;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.select-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.875rem;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.5rem;
}

.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: none;
}

.form-input:invalid ~ .error-message,
.form-textarea:invalid ~ .error-message {
    display: block;
}

/* Info Banners */
.info-banner {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #1e40af;
}

.instructor-banner {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #0ea5e9;
    color: #0c4a6e;
}

.warning-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    color: #92400e;
    font-size: 0.875rem;
}

/* Validation Errors */
.validation-errors {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #f87171;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #991b1b;
}

.validation-errors h6 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.validation-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Delete Confirmation */
.delete-confirmation {
    padding: 1rem 0;
}

.delete-icon {
    font-size: 4rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.delete-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.delete-message {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 1rem;
}

/* Course Details */
.course-details-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.5rem;
}

.details-header {
    margin-bottom: 1.5rem;
}

.details-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.course-info-grid .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0;
}

.course-info-grid .row:last-child {
    border-bottom: none;
}

/* Toast Styles */
.modern-toast {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modern-toast-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}

.modern-toast-body {
    padding: 1rem;
    font-size: 0.875rem;
}

.modern-toast.bg-success .modern-toast-header {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-bottom-color: #10b981;
}

.modern-toast.bg-danger .modern-toast-header {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-bottom-color: #ef4444;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-title {
        font-size: 2rem;
    }

    .courses-dashboard {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .dashboard-title {
        font-size: 1.75rem;
    }

    .action-buttons {
        flex-wrap: wrap;
    }

    .course-title {
        font-size: 1rem;
    }

    .instructor-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination-section {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Smooth Animations */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Focus Styles for Accessibility */
.action-btn:focus,
.btn-create-course:focus,
.modern-btn:focus {
    outline: 3px solid rgba(102, 126, 234, 0.3);
    outline-offset: 2px;
}

.search-input:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: 3px solid rgba(102, 126, 234, 0.2);
    outline-offset: -1px;
}

/* Enhanced Course Modal Styles - Full Width */
.course-modal-body {
    max-height: 80vh;
    min-height: 60vh;
    overflow-y: auto;
    padding: 2rem;
}

/* Full-width form container */
.course-form-container-full {
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Full-width form sections */
.form-section-full {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    width: 100%;
    transition: all 0.3s ease;
}

/* Ensure hidden sections don't affect layout but maintain modal size */
.form-section-full.d-none {
    display: none !important;
}

/* Ensure modal content maintains minimum space when sections are hidden */
.course-form-container-full {
    min-height: 50vh;
}

.form-section-full:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

/* Section headers */
.section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.section-title {
    color: #475569;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: #667eea;
    font-size: 1.2rem;
}

/* Section content */
.section-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Enhanced form field styling for better UX */
.form-input, .form-textarea, .form-select {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #ffffff;
    width: 100%;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    background: #fafbff;
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Form validation styling */
.form-input.is-invalid, .form-textarea.is-invalid, .form-select.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.is-valid, .form-textarea.is-valid, .form-select.is-valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Enhanced form field grouping */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Enhanced button styling within modal */
.modern-btn {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.modern-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.modern-btn:hover::before {
    left: 100%;
}

.modern-btn.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.modern-btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.modern-btn.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modern-btn.btn-secondary:hover {
    background: #e2e8f0;
    color: #334155;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.modern-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.modern-btn .spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Form buttons */
.btn-outline-success, .btn-outline-primary, .btn-outline-danger {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Small trash buttons within modal */
.btn-outline-danger.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
    border-radius: 8px;
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ef4444;
    color: #ef4444;
    background: transparent;
    transition: all 0.3s ease;
}

.btn-outline-danger.btn-sm:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-outline-danger.btn-sm i {
    font-size: 0.875rem;
}

/* Remove buttons in dynamic lists */
.remove-translation, .remove-schedule, .remove-requirement, .remove-host, .remove-language {
    border: 2px solid #ef4444;
    color: #ef4444;
    background: transparent;
    border-radius: 8px;
    padding: 0.375rem 0.625rem;
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.remove-translation:hover, .remove-schedule:hover, .remove-requirement:hover, 
.remove-host:hover, .remove-language:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-outline-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Enrollment Documents Modal Styles */
.enrollment-info-card {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.learner-info {
    margin-bottom: 1rem;
}

.learner-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.learner-icon {
    font-size: 2.5rem;
    color: #667eea;
}

.learner-details {
    flex: 1;
}

.learner-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
}

.learner-email {
    font-size: 0.95rem;
    color: #64748b;
}

.course-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.info-item:last-child {
    border-bottom: none;
}

.info-icon {
    font-size: 1.1rem;
    color: #667eea;
    width: 20px;
    text-align: center;
}

.info-label {
    font-weight: 600;
    color: #475569;
    min-width: 80px;
}

.info-value {
    color: #1e293b;
    font-weight: 500;
}

.documents-section {
    margin-top: 1rem;
}

.documents-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.documents-title i {
    color: #667eea;
    font-size: 1.2rem;
}

.documents-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.document-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.document-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.document-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    border-radius: 12px;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.document-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.document-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.document-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.document-action-btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    font-weight: 500;
}

.preview-btn {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.preview-btn:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.download-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

.empty-documents {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.empty-message {
    font-size: 1.1rem;
    font-weight: 500;
    color: #64748b;
}

/* Enhanced modal close button */
.modern-close {
    background-color: rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.modern-close:hover {
    background-color: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

.modern-close::before {
    content: '';
    font-family: 'Bootstrap Icons';
    font-size: 1.25rem;
}

/* Responsive design */
@media (max-width: 1200px) {
    .course-modal-body {
        padding: 1.5rem;
    }
    
    .form-section-full {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .course-modal-body {
        padding: 1rem;
    }
    
    .form-section-full {
        padding: 1rem;
    }
    
    .modern-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .learner-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .info-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .info-label {
        min-width: auto;
    }
    
    .document-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .document-info {
        align-items: center;
    }
}

/* Document Preview Modal Styles */
.preview-container {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #64748b;
}

.preview-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #667eea;
}

.preview-pdf {
    width: 100%;
    height: 600px;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

.preview-pdf iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-image {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    min-height: 400px;
}

.preview-image img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s ease;
}

.preview-unsupported {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 3rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
}

.unsupported-content {
    text-align: center;
    max-width: 400px;
}

.unsupported-icon {
    font-size: 4rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.unsupported-content h5 {
    color: #374151;
    font-weight: 700;
    margin-bottom: 1rem;
}

.unsupported-content p {
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
