/* Custom Styles - Bootstrap loaded via CDN */
:root {
    --brand-color: #071552;
    --primary-color: #071552;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f8fafc;
}

/* Table cell vertical alignment */
.table td,
.table th {
    vertical-align: middle;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.card {
    border: none;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0a1f6e;
    border-color: #0a1f6e;
}

.progress {
    height: 0.75rem;
    border-radius: 0.5rem;
}

.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

.sidebar {
    min-height: calc(100vh - 56px);
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

/* Sidebar Toggle Button */
#sidebarToggle {
    font-size: 1.25rem;
    text-decoration: none;
    position: absolute;
    top: 24px;
    left: 227px;
    background: var(--brand-color, #071552);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.3s ease;
    z-index: 1001;
}

/* Sidebar Toggle when collapsed */
.sidebar.collapsed #sidebarToggle {
    left: 60px;
}

.sidebar .nav-link {
    color: #64748b;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    margin: 0.25rem 0.5rem;
    transition: all 0.2s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.main-content {
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
}

.course-card {
    transition: transform 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-thumbnail {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.stats-card {
    background: #667eea;
    color: white;
    border-radius: 1rem;
    padding: 1.5rem;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.stats-card p {
    margin: 0;
    opacity: 0.9;
}

.table {
    background-color: white;
}

.table thead {
    background-color: #f8fafc;
}

.footer {
    background-color: #1e293b;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Toast Container Styles */
.toast-container {
    z-index: 9999;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    margin-bottom: 0.5rem;
}

.toast-body {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-body i {
    font-size: 1.2rem;
}

/* Avatar Circle */
.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #ffffff;
}

/* Fancy Action Icons */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1rem;
    margin: 0 2px;
    border: none;
}

.action-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.action-icon-edit {
    background: #f59e0b;
    color: white;
}

.action-icon-edit:hover {
    background: #d97706;
    color: white;
}

.action-icon-delete {
    background: #ef4444;
    color: white;
}

.action-icon-delete:hover {
    background: #dc2626;
    color: white;
}

.action-icon-view {
    background: #3b82f6;
    color: white;
}

.action-icon-view:hover {
    background: #2563eb;
    color: white;
}

.action-icon-pdf {
    background: #8b5cf6;
    color: white;
}

.action-icon-pdf:hover {
    background: #7c3aed;
    color: white;
}

.action-icon-verify {
    background: #10b981;
    color: white;
}

.action-icon-verify:hover {
    background: #059669;
    color: white;
}

.action-icon-regenerate {
    background: #f59e0b;
    color: white;
}

.action-icon-regenerate:hover {
    background: #d97706;
    color: white;
}

/* Bootstrap Chip Input Control */
.chip-input-container {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    min-height: 38px;
    background-color: #fff;
    cursor: text;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.chip-input-container:focus-within {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.chip-input-container .chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    background: #4f46e5;
    color: white;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    gap: 0.5rem;
}

.chip-input-container .chip .chip-remove {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.chip-input-container .chip .chip-remove:hover {
    background: rgba(255, 255, 255, 0.5);
}

.chip-input-container .chip-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.chip-input-container .chip-input::placeholder {
    color: #6c757d;
    opacity: 0.6;
}

.chip-input-container .chip-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    display: none;
}

.chip-input-container .chip-dropdown.show {
    display: block;
}

.chip-input-container .chip-dropdown-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.chip-input-container .chip-dropdown-item:hover {
    background-color: #f8f9fa;
}

.chip-input-container .chip-dropdown-item.selected {
    background-color: #e7f3ff;
    font-weight: 500;
}

.chip-input-container .chip-dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Searchable Dropdown with Checkboxes */
.searchable-dropdown {
    position: relative;
}

.searchable-dropdown-toggle {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #fff;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 38px;
}

.searchable-dropdown-toggle:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.searchable-dropdown-toggle .selected-text {
    flex: 1;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-dropdown-toggle .placeholder-text {
    color: #6c757d;
    font-style: italic;
}

.searchable-dropdown-toggle .dropdown-icon {
    margin-left: 0.5rem;
    color: #6c757d;
    transition: transform 0.2s;
}

.searchable-dropdown-toggle.show .dropdown-icon {
    transform: rotate(180deg);
}

.searchable-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow: hidden;
    flex-direction: column;
}

.searchable-dropdown-menu.show {
    display: flex;
}

.searchable-dropdown-search {
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.searchable-dropdown-search input {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.searchable-dropdown-search input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.searchable-dropdown-options {
    overflow-y: auto;
    max-height: 200px;
    padding: 0.25rem 0;
}

.searchable-dropdown-option {
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.15s;
}

.searchable-dropdown-option:hover {
    background-color: #f8f9fa;
}

.searchable-dropdown-option input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
    width: 1rem;
    height: 1rem;
}

.searchable-dropdown-option label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    user-select: none;
}

.searchable-dropdown-option.selected {
    background-color: #e7f3ff;
}

.searchable-dropdown-footer {
    padding: 0.5rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
}

/* Skeleton Loader */
.skeleton {
    background: #f0f0f0;
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-loader {
    padding: 1rem;
}

/* Table Skeleton */
.skeleton-table {
    width: 100%;
}

.skeleton-table-row {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.skeleton-table-cell {
    flex: 1;
    height: 20px;
}

.skeleton-table-cell.small {
    flex: 0.5;
}

.skeleton-table-cell.medium {
    flex: 1.5;
}

.skeleton-table-cell.large {
    flex: 2;
}

/* Card Skeleton */
.skeleton-card {
    padding: 1.5rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-card-header {
    margin-bottom: 1rem;
}

.skeleton-card-title {
    height: 24px;
    width: 60%;
    margin-bottom: 0.5rem;
}

.skeleton-card-subtitle {
    height: 16px;
    width: 40%;
}

.skeleton-card-body {
    margin-top: 1rem;
}

.skeleton-card-line {
    height: 16px;
    margin-bottom: 0.75rem;
}

.skeleton-card-line:last-child {
    width: 80%;
}

/* List Skeleton */
.skeleton-list {
    padding: 1rem 0;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.skeleton-list-item:last-child {
    border-bottom: none;
}

.skeleton-list-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-list-content {
    flex: 1;
}

.skeleton-list-title {
    height: 18px;
    width: 70%;
    margin-bottom: 0.5rem;
}

.skeleton-list-subtitle {
    height: 14px;
    width: 50%;
}

/* Course Card Skeleton */
.skeleton-course-card {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-course-image {
    width: 100%;
    height: 200px;
    border-radius: 0;
}

.skeleton-course-body {
    padding: 1rem;
}

.skeleton-course-title {
    height: 20px;
    width: 80%;
    margin-bottom: 0.75rem;
}

.skeleton-course-text {
    height: 14px;
    margin-bottom: 0.5rem;
}

.skeleton-course-text:last-child {
    width: 60%;
    margin-bottom: 0;
}

.skeleton-course-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-course-badge {
    width: 60px;
    height: 24px;
    border-radius: 12px;
}

.skeleton-course-button {
    width: 80px;
    height: 32px;
    border-radius: 0.25rem;
}

/* Dashboard Stats Skeleton */
.skeleton-stats-card {
    background: #667eea;
    border-radius: 1rem;
    padding: 1.5rem;
    color: white;
}

.skeleton-stats-value {
    height: 48px;
    width: 120px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-stats-label {
    height: 16px;
    width: 80px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* Generic Skeleton */
.skeleton-text {
    height: 16px;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    margin-bottom: 0;
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-square {
    width: 40px;
    height: 40px;
    border-radius: 4px;
}

.skeleton-button {
    width: 100px;
    height: 36px;
    border-radius: 0.375rem;
}

/* Skeleton Container */
.skeleton-container {
    padding: 1rem;
}

.skeleton-container-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    padding: 2rem;
}
