:root {
    --primary-color: #0066cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
}

/* Badge overflow handling */
.badge {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: top;
}

.badge.bg-secondary {
    max-width: 150px; /* Shorter limit for subject badges */
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.clickable-tile {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.clickable-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    filter: brightness(1.05);
}

.clickable-tile:active {
    transform: translateY(-1px);
}

.card-header {
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
}

.content-view {
    animation: fadeIn 0.3s ease-in;
}

/* Printable styles */
@media print {
    .d-print-none {
        display: none !important;
    }
    
    .modal-dialog {
        margin: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }
    
    .modal-content {
        border: none !important;
        box-shadow: none !important;
    }
    
    .printable-page {
        page-break-after: always;
    }
    
    .printable-page:last-child {
        page-break-after: auto;
    }
    
    body {
        background: white !important;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .printable-header {
        border-bottom: 2px solid #333;
        margin-bottom: 20px;
        padding-bottom: 10px;
    }
    
    .printable-section {
        margin-bottom: 15px;
        page-break-inside: avoid;
    }
    
    .printable-section h3 {
        color: #333;
        border-bottom: 1px solid #ccc;
        padding-bottom: 5px;
        margin-bottom: 10px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.list-group-item {
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.list-group-item:hover {
    border-left-color: var(--primary-color);
    background-color: #f8f9fa;
}

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

.btn {
    transition: all 0.2s;
}

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

.modal-content {
    border: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Dashboard Stats Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004a99 100%);
}

.card.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #1e7e34 100%);
}

.card.bg-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #117a8b 100%);
}

.card.bg-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d39e00 100%);
}

/* Lesson and Assessment Cards */
.card-footer {
    background-color: #f8f9fa;
}

.card-title {
    color: #2c3e50;
    font-weight: 600;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Custom Alert Styles */
.alert {
    border-left: 4px solid;
    border-radius: 0.25rem;
}

.alert-info {
    border-left-color: var(--info-color);
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

/* Rubric Styling */
.rubric-container {
    margin: 1rem 0;
}

.rubric-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.rubric-table {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.rubric-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    color: var(--primary-color);
    border: 1px solid #dee2e6;
}

.rubric-table td {
    vertical-align: top;
    border: 1px solid #dee2e6;
    padding: 0.75rem 0.5rem;
}

.rubric-table td:first-child {
    background-color: #fafbfc;
    font-weight: 500;
}

.rubric-table td:last-child {
    text-align: center;
    vertical-align: middle;
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--primary-color);
}

.rubric-table small {
    line-height: 1.3;
    color: #495057;
}

.rubric-table strong {
    color: var(--primary-color);
    font-size: 0.85rem;
}

/* Grade scale styling */
.rubric-container .badge {
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

/* Responsive rubric table */
@media (max-width: 768px) {
    .rubric-table {
        font-size: 0.8rem;
    }
    
    .rubric-table th,
    .rubric-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .rubric-table small {
        font-size: 0.75rem;
    }
}

/* Enhanced question display */
.question-item {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.question-item .badge {
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Question number styling - ensure visibility in print */
.question-item .card-header strong,
.question-card .card-header strong {
    display: inline-block;
    min-width: 90px;
    white-space: nowrap;
}

.bloom-level {
    background-color: #e3f2fd;
    color: #1565c0;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Export Format Modal Styles */
#exportFormatModal .btn {
    text-align: left;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

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

#exportFormatModal .btn i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

#exportFormatModal .btn small {
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* Teacher Key Styles */
.teacher-key-toggle {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
}

.teacher-key-warning {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border: 2px solid #f5c6cb !important;
}

.teacher-key-answer {
    background-color: #d4edda !important;
    color: #155724 !important;
    border-left: 4px solid #28a745 !important;
}

.teacher-key-explanation {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
    border-left: 4px solid #17a2b8 !important;
}


@media print {
    .teacher-key-warning {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .teacher-key-answer {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Ensure question numbers are fully visible */
    .question-item .card-header,
    .question-card .card-header {
        overflow: visible !important;
    }
    
    .question-item .card-header strong,
    .question-card .card-header strong {
        min-width: 100px !important;
        display: inline-block !important;
        white-space: nowrap !important;
    }
    
    .question-item .card-header .d-flex,
    .question-card .card-header .d-flex {
        flex-wrap: nowrap !important;
    }
}

/* ============================================================================
   VISUAL ENHANCEMENT SYSTEM STYLES
   ============================================================================ */

/* Enhanced button with gradient */
.btn-enhance-visuals {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-enhance-visuals:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Content images */
.content-image {
    margin: 20px 0;
    text-align: center;
}

.content-image img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.content-image img:hover {
    transform: scale(1.02);
}

.content-image figcaption {
    margin-top: 8px;
    font-style: italic;
    color: #6c757d;
}

/* Fair-use placeholder */
.fair-use-placeholder {
    border-left: 4px solid #0dcaf0;
    padding: 15px;
    margin: 20px 0;
    background-color: #e7f5ff;
}

/* Content images section */
.content-images-section {
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
    margin-top: 30px;
}

.content-images-section h4 {
    color: #495057;
    margin-bottom: 20px;
}

/* Visual badge */
.badge.bg-success {
    background-color: #28a745 !important;
}

/* Enhancement modal customization */
#enhancement-modal .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

#enhancement-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

#enhancement-modal .progress {
    height: 25px;
    border-radius: 10px;
}

#enhancement-modal .progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

/* Icon button for enhance */
.btn-info i.bi-image {
    font-size: 1rem;
}

/* Table view styles */
.table-responsive {
    margin: 0;
}

.table-hover tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

.table td {
    vertical-align: middle;
}

.table .btn-group {
    white-space: nowrap;
}

.table .btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Ensure badges in tables don't wrap */
.table .badge {
    white-space: nowrap;
}

/* Make table action buttons compact */
.table .btn-group .dropdown-menu {
    min-width: auto;
}

/* Sortable table headers */
.table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.table th.sortable:hover {
    background-color: #f8f9fa;
}

.table th.sortable i {
    font-size: 0.875rem;
    margin-left: 0.25rem;
}

