/**
 * Course Builder Custom CSS
 * Extensions to Bootstrap for the course builder application
 */

/* General Layout */
body {
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: 600;
}

/* Card Enhancements */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* Course Statistics */
.statistic {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #495057;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Course Stats in Dashboard */
.course-stats {
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
}

/* Section Items */
.section-item {
    transition: transform 0.2s ease-in-out;
    cursor: move;
}

.section-item:hover {
    transform: translateY(-2px);
}

.drag-handle {
    cursor: grab;
    font-size: 1.25rem;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Sortable Placeholder */
.sortable-placeholder {
    border: 2px dashed #007bff;
    background-color: #f8f9fa;
    height: 80px;
    margin: 0.75rem 0;
    border-radius: 0.375rem;
}

/* Asset Items */
.asset-item {
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    border-radius: 0.375rem;
    padding: 0.25rem;
}

.asset-item:hover {
    transform: scale(1.05);
    background-color: #e9ecef;
}

.asset-item img {
    border-radius: 0.25rem;
    transition: opacity 0.2s ease-in-out;
}

.asset-item:hover img {
    opacity: 0.8;
}

/* Page Editor Layout */
.page-editor-container {
    height: calc(100vh - 120px);
}

.editor-sidebar {
    border-left: 1px solid #e9ecef;
    background-color: #fff;
    height: 100%;
    overflow-y: auto;
}

/* TinyMCE Customizations */
.tox-tinymce {
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
}

.tox .tox-editor-header {
    border-bottom: 1px solid #e9ecef !important;
}

/* Auto-save Status */
#saveStatus {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#saveStatus i {
    font-size: 1rem;
}

/* Progress Indicators */
.progress {
    height: 0.5rem;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn-sm {
    font-size: 0.8125rem;
}

/* Dropdown Menus */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.dropdown-item i {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 0.75rem 0.75rem;
}

/* Navigation Enhancements */
.navbar {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.nav-link {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    color: #adb5bd;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Quiz Editor Styles */
.question-item {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out;
}

.question-item:hover {
    border-color: #007bff;
}

.question-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.question-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.answer-option {
    padding: 0.5rem;
    margin: 0.25rem 0;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
}

.correct-answer {
    background-color: #d1e7dd;
    border-color: #badbcc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .btn {
        font-size: 0.875rem;
    }
    
    .navbar-brand {
        font-size: 1.125rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .dropdown,
    .modal {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
        break-inside: avoid;
    }
    
    .card-header {
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #212529;
        color: #fff;
    }
    
    .card {
        background-color: #343a40;
        border-color: #495057;
    }
    
    .card-header {
        background-color: #495057;
        border-color: #6c757d;
    }
    
    .form-control,
    .form-select {
        background-color: #495057;
        border-color: #6c757d;
        color: #fff;
    }
    
    .modal-content {
        background-color: #343a40;
        color: #fff;
    }
}

/* Accessibility Enhancements */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus Indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid;
    }
    
    .form-control,
    .form-select {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}