/* TKD Forms Trainer - Main Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

/* Force white text for all navbar elements */
.navbar-dark .navbar-nav .nav-link {
    color: #ffffff !important;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: #f0f0f0 !important;
}

.navbar-dark .navbar-brand {
    color: #ffffff !important;
}

/* Cards */
.card {
    border: none;
    overflow: visible !important; /* Allow dropdowns to overflow */
}

/* Only apply hover effects to non-table cards */
.card:not(:has(.table)):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

/* Video Containers */
.video-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
}

/* Tables */
.table {
    background: white;
    border-radius: 8px;
}

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

/* Fix dropdown cutoff in tables - must override Bootstrap defaults */
.card,
.card-body,
.card-body.p-0,
.table-responsive,
.card.shadow-sm,
.card.shadow-sm .card-body {
    overflow: visible !important;
}

/* Ensure dropdowns appear above everything */
.table .dropdown-menu,
.card .dropdown-menu {
    z-index: 1050;
    position: absolute;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Progress Bars */
.progress {
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Score Display */
.score-display {
    font-size: 4rem;
    font-weight: bold;
    line-height: 1;
}

.score-passed {
    color: var(--success-color);
}

.score-failed {
    color: var(--danger-color);
}

/* Exam Stats */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: bold;
}

.stat-card .stat-label {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .score-display {
        font-size: 3rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* Admin Specific */
.admin-sidebar {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.admin-sidebar .nav-link:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: #e7f1ff;
}

.file-upload-area.drag-over {
    border-color: var(--primary-color);
    background: #e7f1ff;
}

/* Technique List */
.technique-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.technique-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.technique-item.incomplete {
    border-left: 4px solid var(--warning-color);
}

.technique-item.complete {
    border-left: 4px solid var(--success-color);
}

/* Sortable Items (for drag-drop) */
.sortable-item {
    cursor: move;
    transition: all 0.2s;
}

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

.sortable-ghost {
    opacity: 0.4;
}

.sortable-handle {
    cursor: grab;
    color: #6c757d;
}

.sortable-handle:active {
    cursor: grabbing;
}

/* Video Status Indicators */
.video-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.video-status i {
    font-size: 1.2rem;
}

.video-status.has-video {
    color: var(--success-color);
}

.video-status.no-video {
    color: var(--danger-color);
}