/* Admin Dashboard Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Modal Styles */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: auto;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Login Container */
.login-container {
    padding: 3rem;
    min-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.login-header h2 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Dashboard Styles */
.dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.admin-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo i {
    font-size: 2rem;
    color: #00d4ff;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Navigation */
.admin-nav {
    background: white;
    border-bottom: 1px solid #e1e5e9;
    padding: 0 2rem;
}

.admin-nav ul {
    display: flex;
    list-style: none;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    color: #666;
}

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

.nav-item.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9fa;
}

/* Main Content */
.admin-main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e1e5e9;
}

.tab-header h2 {
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Export Button Styles */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 120px;
    justify-content: center;
}

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

.export-btn:active {
    transform: translateY(0);
}

.xlsx-btn {
    background: linear-gradient(135deg, #217346 0%, #28a745 100%);
    color: white;
}

.xlsx-btn:hover {
    background: linear-gradient(135deg, #1e6b3f 0%, #218838 100%);
}

.pdf-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.pdf-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.export-btn i {
    font-size: 16px;
}

/* Export Loading State */
.export-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.export-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.secondary-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Upload Form */
.upload-form {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.upload-form h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.file-info {
    margin-top: 0.5rem;
}

.file-info small {
    color: #666;
    font-size: 0.8rem;
}

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.course-thumbnail {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.course-info {
    padding: 1.5rem;
}

.course-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.course-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.course-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.course-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #28a745;
    color: white;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

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

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #666;
    font-size: 0.9rem;
}

/* Settings */
.settings-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e1e5e9;
}

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

.setting-item label {
    font-weight: 600;
    color: #333;
}

.setting-item input {
    padding: 0.5rem 1rem;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    width: 200px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left-color: #dc3545;
}

.toast.warning {
    border-left-color: #ffc107;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Course Management Styles */
.courses-section {
    padding: 20px;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.tab-actions {
    display: flex;
    gap: 10px;
}

.courses-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.courses-filters .filter-group {
    flex: 1;
    min-width: 200px;
}

.courses-filters label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.courses-filters input,
.courses-filters select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.course-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.course-stats .stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.course-stats .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.course-stats .stat-card:nth-child(1) .stat-icon {
    background: #3498db;
}

.course-stats .stat-card:nth-child(2) .stat-icon {
    background: #2ecc71;
}

.course-stats .stat-card:nth-child(3) .stat-icon {
    background: #e74c3c;
}

.course-stats .stat-content h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.course-stats .stat-content p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 14px;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.course-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.course-thumbnail {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

.course-thumbnail .video-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.course-thumbnail .video-preview:hover {
    background: rgba(255,255,255,1);
    transform: translate(-50%, -50%) scale(1.1);
}

.course-thumbnail .video-preview i {
    font-size: 24px;
    color: #333;
    margin-left: 3px;
}

.course-thumbnail .default-thumbnail {
    color: #fff;
    font-size: 48px;
}

.course-content {
    padding: 20px;
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.course-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

.course-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.course-status.published {
    background: #d4edda;
    color: #155724;
}

.course-status.draft {
    background: #fff3cd;
    color: #856404;
}

.course-status.imported {
    background: #cce5ff;
    color: #004085;
}

.course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.course-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.course-meta-item i {
    color: #999;
}

.course-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.course-actions .btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    font-size: 12px;
}

.course-actions .btn-primary {
    background: #3498db;
    border-color: #3498db;
}

.course-actions .btn-success {
    background: #2ecc71;
    border-color: #2ecc71;
}

.course-actions .btn-danger {
    background: #e74c3c;
    border-color: #e74c3c;
}

.course-actions .btn-warning {
    background: #f39c12;
    border-color: #f39c12;
}

.loading-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-state i {
    font-size: 24px;
    margin-bottom: 10px;
    color: #3498db;
}

.no-courses-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-courses-message i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ddd;
}

.no-courses-message h3 {
    margin: 0 0 10px 0;
    color: #333;
}

/* Video Preview Modal */
.video-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.video-preview-modal.show {
    opacity: 1;
    visibility: visible;
}

.video-preview-content {
    background: #fff;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    position: relative;
}

.video-preview-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-preview-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.video-preview-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-preview-close:hover {
    color: #333;
}

.video-preview-body {
    padding: 20px;
}

.video-preview-video {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 4px;
}

/* Course Details Modal */
.course-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.course-details-modal.show {
    opacity: 1;
    visibility: visible;
}

.course-details-content {
    background: #fff;
    border-radius: 8px;
    max-width: 80%;
    max-height: 90%;
    overflow: hidden;
    position: relative;
    width: 600px;
}

.course-details-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.course-details-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.course-details-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-details-close:hover {
    color: #333;
}

.course-details-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.course-detail-section {
    margin-bottom: 20px;
}

.course-detail-section h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 5px;
}

.course-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.course-detail-item {
    display: flex;
    flex-direction: column;
}

.course-detail-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.course-detail-value {
    color: #333;
    font-size: 14px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.course-modules-section {
    margin-top: 20px;
}

.course-module {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
}

.course-module-title {
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.course-videos-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.course-video-item {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-video-name {
    color: #333;
    font-size: 14px;
}

.course-video-duration {
    color: #666;
    font-size: 12px;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Edit Course Modal */
.edit-course-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.edit-course-modal.show {
    opacity: 1;
    visibility: visible;
}

.edit-course-content {
    background: #fff;
    border-radius: 8px;
    max-width: 80%;
    max-height: 90%;
    overflow: hidden;
    position: relative;
    width: 600px;
}

.edit-course-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.edit-course-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.edit-course-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-course-close:hover {
    color: #333;
}

.edit-course-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Storage Import Styles */
.storage-section {
    padding: 20px;
}

.storage-import-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.scan-results {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.scan-summary {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.scan-summary h4 {
    margin: 0 0 10px 0;
    color: #1976d2;
}

.scan-summary p {
    margin: 5px 0;
    color: #666;
}

.course-preview {
    margin-bottom: 20px;
}

.course-structure {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.course-item {
    border-bottom: 1px solid #eee;
    padding: 15px;
}

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

.course-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.course-title {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.course-checkbox {
    margin-right: 10px;
}

.module-list {
    margin-left: 20px;
}

.module-item {
    padding: 8px 0;
    border-left: 2px solid #e0e0e0;
    padding-left: 15px;
    margin-bottom: 8px;
}

.module-title {
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}

.video-list {
    margin-left: 15px;
}

.video-item {
    padding: 4px 0;
    color: #666;
    font-size: 14px;
}

.publish-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.import-history {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: #fff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    border-left: 4px solid #28a745;
}

.history-item h5 {
    margin: 0 0 5px 0;
    color: #333;
}

.history-item p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.history-date {
    color: #999;
    font-size: 12px;
}

.history-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.history-status.success {
    background: #d4edda;
    color: #155724;
}

.history-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-nav ul {
        flex-wrap: wrap;
    }
    
    .nav-item {
        padding: 0.75rem 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .tab-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .export-btn {
        width: 100%;
        min-width: auto;
        justify-content: center;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .setting-item {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .setting-item input {
        width: 100%;
    }
}

/* User Management Styles */
.users-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.users-filters {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 200px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.users-table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.users-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.users-table tr:hover {
    background-color: #f8f9ff;
}

.users-table tr:last-child td {
    border-bottom: none;
}

.role-select {
    padding: 0.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: all 0.3s ease;
    min-width: 120px;
}

.role-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-small {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-save {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.btn-save:active {
    transform: translateY(0);
}

.btn-delete {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3);
}

.btn-delete:active {
    transform: translateY(0);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Bulk Actions */
.bulk-actions {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.bulk-actions-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.bulk-actions-content span {
    font-weight: 600;
    color: #495057;
}

.bulk-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Checkbox Styles */
.user-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#selectAllCheckbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Responsive Design for User Management */
@media (max-width: 768px) {
    .users-filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group select,
    .filter-group input {
        min-width: 100%;
    }
    
    .users-table {
        font-size: 0.8rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .role-select {
        min-width: 100px;
        font-size: 0.8rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-small {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }
    
    .bulk-actions-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bulk-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .btn-secondary {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Sync and Refresh Button Styles */
.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-success:active {
    transform: translateY(0);
}

.btn-success i {
    font-size: 0.9rem;
}

.refresh-user-courses-btn {
    background: linear-gradient(135deg, #17a2b8, #6f42c1);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
}

.refresh-user-courses-btn:hover {
    background: linear-gradient(135deg, #138496, #5a32a3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.refresh-user-courses-btn:active {
    transform: translateY(0);
}
/* Enhanced Playlist Preview Styles */
.scan-mode-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 0.75rem;
    border-radius: 20px;
    margin-left: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.playlist-preview {
    margin-top: 2rem;
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.playlist-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

.course-playlist {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
}

.course-playlist-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-playlist-header h5 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.course-playlist-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.95;
}

.course-playlist-info span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.playlist-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.playlist-video-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.playlist-video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.video-preview-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.video-preview-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-preview-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.video-preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playlist-video-item:hover .video-play-overlay {
    opacity: 1;
}

.play-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.play-button:hover {
    transform: scale(1.1);
    background: white;
}

.video-duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-index-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.4rem 0.7rem;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.playlist-video-info {
    padding: 1rem;
}

.playlist-video-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.playlist-video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

.video-module {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.video-status {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-status.ready {
    background: #d4edda;
    color: #155724;
}

.video-status.processing {
    background: #fff3cd;
    color: #856404;
}

/* Video Preview Modal */
.video-preview-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.video-preview-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-preview-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: auto;
    animation: modalSlideIn 0.3s ease-out;
}

.video-preview-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-preview-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.video-preview-close:hover {
    opacity: 1;
}

.video-preview-player {
    padding: 2rem;
    background: #000;
}

.video-preview-player video {
    width: 100%;
    max-height: 600px;
    border-radius: 10px;
}

.video-preview-details {
    padding: 2rem;
}

.video-detail-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.video-detail-label {
    font-weight: 600;
    color: #667eea;
    min-width: 120px;
}

.video-detail-value {
    color: #495057;
}

/* Playlist Course Card Styles */
.playlist-course {
    border-left: 4px solid #28a745 !important;
}

.playlist-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
}

.playlist-thumbnail {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #28a745, #20c997);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    position: relative;
}

.playlist-count {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.course-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.course-status.playlist {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

/* Playlist Preview Modal Styles */
.playlist-preview-modal {
    display: none;
    position: fixed;
    z-index: 1500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.playlist-preview-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-preview-content {
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    width: 800px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.playlist-preview-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.playlist-preview-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.playlist-preview-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.playlist-preview-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.playlist-preview-body {
    padding: 24px;
    max-height: 600px;
    overflow-y: auto;
}

.playlist-info {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.playlist-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.playlist-stats span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #495057;
}

.playlist-stats i {
    color: #667eea;
}

.playlist-description {
    margin: 0;
    color: #6c757d;
    line-height: 1.5;
}

.playlist-modules {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.playlist-module {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.module-header {
    padding: 16px 20px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
}

.module-header:hover {
    background: #e9ecef;
}

.module-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 12px;
}

.module-header i {
    transition: transform 0.3s;
    color: #667eea;
}

.module-video-count {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.module-videos {
    padding: 0;
}

.video-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background-color 0.3s;
}

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

.video-item:hover {
    background: #f8f9fa;
}

.video-thumbnail {
    width: 60px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.video-info {
    flex: 1;
}

.video-info h5 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.video-description {
    margin: 0 0 4px 0;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

.video-duration {
    font-size: 11px;
    color: #667eea;
    font-weight: 600;
}

/* Course Builder Modal Styles */
.course-builder-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.course-builder-content {
    background: white;
    width: 95%;
    max-width: 1400px;
    height: 95%;
    margin: auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.course-builder-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-builder-header h2 {
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.course-builder-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.course-builder-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.course-builder-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: #f8f9fa;
}

.course-builder-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.course-builder-section h3 {
    color: #667eea;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sections-container {
    margin-top: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.empty-state p {
    margin-top: 1rem;
    font-size: 1.1rem;
}

.course-section {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s;
}

.course-section.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.section-header {
    background: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.section-drag-handle {
    color: #adb5bd;
    cursor: grab;
    font-size: 1.2rem;
    padding: 0.25rem;
}

.section-drag-handle:active {
    cursor: grabbing;
}

.section-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.section-name-input {
    flex: 1;
    border: 2px solid transparent;
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s;
}

.section-name-input:focus {
    border-color: #667eea;
    background: #f8f9fa;
    outline: none;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: #e9ecef;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #495057;
}

.btn-icon:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

.btn-icon.btn-danger {
    background: #ffe5e5;
    color: #dc3545;
}

.btn-icon.btn-danger:hover {
    background: #ffcccc;
}

.section-body {
    padding: 1.5rem;
}

.topics-container {
    margin-top: 1rem;
}

.empty-topics {
    text-align: center;
    padding: 2rem;
    color: #adb5bd;
}

.empty-topics i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.course-topic {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.course-topic.dragging {
    opacity: 0.5;
}

.topic-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topic-drag-handle {
    color: #adb5bd;
    cursor: grab;
    padding: 0.25rem;
}

.topic-number {
    background: #667eea;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.topic-name-input {
    flex: 1;
    border: 1px solid #e9ecef;
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.3s;
}

.topic-name-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.topic-actions {
    display: flex;
    gap: 0.5rem;
}

.topic-body {
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid #e9ecef;
}

.topic-form {
    margin-top: 1rem;
}

.topic-description-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.3s;
}

.topic-description-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.video-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    background: #f8f9fa;
}

.upload-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    transition: all 0.3s;
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.video-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.video-preview video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

.video-info {
    text-align: center;
}

.video-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.video-size {
    color: #6c757d;
    font-size: 0.9rem;
}

.course-builder-footer {
    background: white;
    padding: 1.5rem 2rem;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info {
    color: #6c757d;
    font-size: 0.95rem;
}

.footer-info strong {
    color: #495057;
}

.footer-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Course Preview Styles */
.course-preview-container {
    margin-top: 1rem;
}

.preview-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.preview-header h2 {
    color: #495057;
    margin-bottom: 0.75rem;
}

.preview-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.preview-meta span {
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-meta i {
    color: #667eea;
}

.preview-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.preview-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-section-header h3 {
    color: #495057;
    font-size: 1.1rem;
    margin: 0;
}

.preview-count {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.preview-topics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-topic {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    display: flex;
    gap: 1rem;
}

.preview-topic-number {
    background: #667eea;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.preview-topic-info {
    flex: 1;
}

.preview-topic-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.preview-topic-desc {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.preview-video-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e7f3ff;
    color: #0066cc;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Topic Hint Badge */
.topic-hint-badge {
    animation: pulse 2s infinite;
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.topic-expand-hint {
    animation: slideDown 0.3s ease-out;
}

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

/* Make upload button more prominent */
.upload-button {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .course-builder-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .section-header,
    .topic-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .topic-hint-badge {
        order: 10;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .footer-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* User Analytics Styles */
.analytics-summary {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.summary-period {
    margin-bottom: 2rem;
}

.summary-period:last-child {
    margin-bottom: 0;
}

.summary-period h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analytics-filters {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.analytics-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.analytics-section h3 {
    color: #333;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analytics-table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.analytics-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.analytics-table tr:hover {
    background-color: #f8f9ff;
}

.analytics-table tr:last-child td {
    border-bottom: none;
}

.interaction-type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.interaction-type-badge.ai_chat {
    background: #e3f2fd;
    color: #1976d2;
}

.interaction-type-badge.course_view {
    background: #f3e5f5;
    color: #7b1fa2;
}

.question-preview {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screenshot-thumbnail {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.3s;
}

.screenshot-thumbnail:hover {
    transform: scale(1.1);
}

.no-screenshot {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

.analytics-action-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.analytics-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.no-data-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-data-message i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ddd;
}

.no-data-message h3 {
    margin: 0 0 10px 0;
    color: #333;
}

/* Analytics Detail Modal */
.analytics-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.analytics-detail-modal.show {
    opacity: 1;
    visibility: visible;
}

.analytics-detail-content {
    background: #fff;
    border-radius: 12px;
    max-width: 80%;
    max-height: 90%;
    overflow: hidden;
    position: relative;
    width: 800px;
}

.analytics-detail-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.analytics-detail-title {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.analytics-detail-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.analytics-detail-close:hover {
    opacity: 0.8;
}

.analytics-detail-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    color: #667eea;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.detail-value {
    color: #333;
    font-size: 14px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.detail-value.full-width {
    grid-column: 1 / -1;
}

.conversation-box {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.conversation-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.conversation-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.conversation-label {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.conversation-text {
    background: white;
    padding: 10px;
    border-radius: 6px;
    line-height: 1.5;
}

.screenshot-large {
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
}

/* Responsive Analytics Styles */
@media (max-width: 768px) {
    .analytics-filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .analytics-table {
        font-size: 0.8rem;
    }
    
    .analytics-table th,
    .analytics-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-detail-content {
        width: 95%;
        max-width: 95%;
    }
}

