/* Knowledge Base Styles */
.kb-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header Styles */
.kb-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.kb-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.back-link:hover {
    opacity: 0.8;
}

.kb-header h1 {
    color: white;
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.admin-controls {
    display: flex;
    gap: 0.5rem;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

/* Navigation Tabs */
.kb-tabs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 0;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Main Content */
.kb-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
    background: white;
    border-radius: 16px 16px 0 0;
    min-height: 70vh;
}

.tab-content {
    display: none;
    padding: 2rem 0;
}

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

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

.stats-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem;
    border-radius: 12px;
}

.stat-info h3 {
    margin: 0 0 0.5rem 0;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-card h3 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.chart-placeholder {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
}

.content-distribution {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.category {
    min-width: 80px;
    font-size: 0.9rem;
    color: #4a5568;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.percentage {
    min-width: 40px;
    text-align: right;
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

/* AI Assistant Styles */
.ai-assistant-container {
    max-width: 800px;
    margin: 0 auto;
}

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

.assistant-header h2 {
    color: #2d3748;
    margin: 0 0 0.5rem 0;
}

.assistant-header p {
    color: #718096;
    margin: 0;
}

.chat-container {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message-content {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex: 1;
}

.message-content p {
    margin: 0;
    color: #2d3748;
    line-height: 1.6;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#chat-input:focus {
    border-color: #667eea;
}

#send-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

#send-btn:hover {
    background: #5a67d8;
}

.quick-questions h3 {
    color: #2d3748;
    margin: 0 0 1rem 0;
}

.question-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.question-tag {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.question-tag:hover {
    background: #667eea;
    color: white;
}

/* Content Header Styles */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.content-header h2 {
    color: #2d3748;
    margin: 0;
}

.content-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.content-controls .btn-primary {
    background: linear-gradient(135deg, #00b3ff, #0080ff);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-controls .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 179, 255, 0.3);
}

.content-controls .btn-primary i {
    font-size: 0.9rem;
}

.content-controls input,
.content-controls select {
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.content-controls input:focus,
.content-controls select:focus {
    border-color: #667eea;
}

.add-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.add-btn:hover {
    background: #38a169;
}

/* Articles and Videos Grid */
.articles-grid,
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.article-card,
.video-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.article-card:hover,
.video-card:hover {
    transform: translateY(-2px);
}

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

.category-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

.category-badge.theory { background: #667eea; }
.category-badge.technology { background: #48bb78; }
.category-badge.application { background: #ed8936; }
.category-badge.research { background: #9f7aea; }

.read-time {
    color: #a0aec0;
    font-size: 0.8rem;
}

.article-card h3,
.video-card h3 {
    color: #2d3748;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.article-card p,
.video-card p {
    color: #718096;
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    background: #e2e8f0;
    color: #4a5568;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
}

.read-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.read-btn:hover {
    background: #5a67d8;
}

/* Access Logs Styles */
.log-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.access-logs-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    color: #4a5568;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.logs-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #2d3748;
}

.logs-table tr:hover {
    background: #f8f9fa;
}

/* Content Editor Modal */
.editor-modal {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.editor-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.editor-tabs {
    display: flex;
    border-bottom: 2px solid #333;
    margin-bottom: 1rem;
}

.editor-tab-btn {
    background: none;
    border: none;
    color: #ccc;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.editor-tab-btn.active {
    color: #00b3ff;
    border-bottom-color: #00b3ff;
}

.editor-tab-btn:hover {
    color: #fff;
}

.editor-tab-content {
    display: none;
}

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

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

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

.form-group label {
    color: #fff;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.8rem;
    color: #fff;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00b3ff;
    box-shadow: 0 0 0 2px rgba(0, 179, 255, 0.2);
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.toolbar-btn:hover {
    background: rgba(0, 179, 255, 0.2);
    border-color: #00b3ff;
}

.editor-container {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
}

#content-editor {
    width: 100%;
    min-height: 400px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    padding: 1rem;
    color: #fff;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
}

.content-preview {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    min-height: 400px;
    color: #fff;
    line-height: 1.6;
}

.editor-controls {
    display: flex;
    gap: 1rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    justify-content: flex-end;
}

.preview-btn,
.fullscreen-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-btn:hover,
.fullscreen-btn:hover {
    background: rgba(0, 179, 255, 0.2);
    border-color: #00b3ff;
}

/* Upload Areas */
.upload-section {
    margin-bottom: 2rem;
}

.upload-section h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: #00b3ff;
    background: rgba(0, 179, 255, 0.05);
}

.upload-area.dragover {
    border-color: #00b3ff;
    background: rgba(0, 179, 255, 0.1);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: #ccc;
    margin: 0;
}

.upload-hint {
    font-size: 0.8rem;
    color: #999 !important;
}

.image-preview {
    position: relative;
    max-width: 300px;
    margin: 1rem auto;
}

.image-preview img {
    width: 100%;
    border-radius: 6px;
}

.image-preview .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
}

.images-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.documents-list {
    margin-top: 1rem;
}

.document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
}

.document-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.document-icon {
    font-size: 1.2rem;
}

.document-name {
    color: #fff;
    font-weight: 500;
}

.document-size {
    color: #999;
    font-size: 0.8rem;
}

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

.document-actions button {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.document-actions button:hover {
    border-color: #00b3ff;
    color: #00b3ff;
}

.document-actions .delete-btn:hover {
    border-color: #ff4757;
    color: #ff4757;
}

/* Editor Actions */
.editor-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary,
.btn-secondary,
.btn-cancel {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #00b3ff, #0080ff);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 179, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-cancel {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.btn-cancel:hover {
    background: rgba(255, 71, 87, 0.2);
}

/* Video Editor Styles */
.video-preview {
    position: relative;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

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

.video-preview .video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 20px 15px 15px;
    font-size: 14px;
}

.video-preview .video-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
}

.video-preview .video-controls button {
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.video-preview .video-controls button:hover {
    background: rgba(0,0,0,0.9);
}

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

/* Video Upload Area Styles */
#video-file-upload-area .upload-placeholder {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#video-thumbnail-upload-area .upload-placeholder {
    min-height: 150px;
}

/* Video Editor Form Styles */
#video-editor-form .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

#video-editor-form .form-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

#video-editor-form .form-group input[type="datetime-local"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
}

#video-editor-form .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
}

#video-editor-form .form-group input[type="url"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
}

/* Video Card Enhancements */
.content-card .video-thumbnail {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.content-card .video-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.content-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.content-card .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.content-card:hover .play-button {
    background: rgba(0,0,0,0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.content-card .duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Search Highlight */
mark {
    background: #ffd700;
    color: #1a202c;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
    font-size: 16px;
    background: #2d3748;
    border-radius: 8px;
    margin: 20px 0;
}

/* Video Grid Responsive */
@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .content-card .video-thumbnail img {
        height: 180px;
    }
    
    .video-preview video {
        max-height: 200px;
    }
    
    #video-file-upload-area .upload-placeholder {
        min-height: 150px;
    }
    
    #video-thumbnail-upload-area .upload-placeholder {
        min-height: 120px;
    }
}

@media (max-width: 480px) {
    .content-card .video-thumbnail img {
        height: 160px;
    }
    
    .content-card .play-button {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .video-preview video {
        max-height: 150px;
    }
}
    .editor-modal {
        width: 98%;
        margin: 1%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .editor-toolbar {
        gap: 0.3rem;
    }
    
    .toolbar-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .editor-actions {
        flex-direction: column;
    }
    
    .images-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
.modal {
    display: none;
    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: 5% auto;
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.admin-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #a0aec0;
    transition: color 0.3s ease;
}

.close:hover {
    color: #2d3748;
}

.modal h2 {
    color: #2d3748;
    margin: 0 0 1.5rem 0;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.login-btn:hover {
    background: #5a67d8;
}

/* Admin Panel Styles */
.admin-modal {
    max-width: 1000px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.admin-tabs {
    display: flex;
    border-bottom: 2px solid #2d3748;
    margin-bottom: 20px;
}

.admin-tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    color: #a0aec0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.admin-tab-btn:hover {
    color: #4299e1;
}

.admin-tab-btn.active {
    color: #4299e1;
    border-bottom-color: #4299e1;
}

.admin-tab-content {
    display: none;
}

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

.admin-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #2d3748;
    border-radius: 8px;
}

.admin-add-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.admin-add-btn:hover {
    background: #38a169;
}

.admin-delete-btn {
    background: #f56565;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.admin-delete-btn:hover {
    background: #e53e3e;
}

.admin-list {
    max-height: 400px;
    overflow-y: auto;
}

.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #2d3748;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #4a5568;
}

.admin-item-info h4 {
    margin: 0 0 8px 0;
    color: #e2e8f0;
    font-size: 16px;
}

.admin-item-info p {
    margin: 4px 0;
    color: #a0aec0;
    font-size: 14px;
}

.admin-item-actions {
    display: flex;
    gap: 8px;
}

.admin-edit-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.admin-edit-btn:hover {
    background: #3182ce;
}

.settings-form {
    background: #2d3748;
    padding: 24px;
    border-radius: 8px;
}

.settings-form h3 {
    margin: 0 0 20px 0;
    color: #e2e8f0;
    font-size: 18px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #4a5568;
}

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

.setting-item label {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
}

.setting-item input {
    background: #4a5568;
    border: 1px solid #718096;
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.setting-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.setting-item input:focus {
    border-color: #4299e1;
}

.save-settings-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
    margin-top: 20px;
}

.save-settings-btn:hover {
    background: #3182ce;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kb-nav {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .kb-tabs {
        padding: 1rem 1rem 0;
        justify-content: flex-start;
    }

    .kb-main {
        padding: 0 1rem 2rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .content-header {
        flex-direction: column;
        align-items: stretch;
    }

    .content-controls {
        justify-content: stretch;
    }

    .content-controls input,
    .content-controls select {
        flex: 1;
    }

    .articles-grid,
    .videos-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }

    .admin-toolbar {
        flex-direction: column;
    }

    .setting-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .kb-header h1 {
        font-size: 1.5rem;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .stats-card {
        padding: 1rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .chart-card {
        padding: 1rem;
    }

    .modal-content {
        padding: 1.5rem;
    }
}

/* Animation and Transitions */
.content-card {
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tab-content.active {
    animation: slideInRight 0.4s ease-out;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #4a5568;
    border-radius: 50%;
    border-top-color: #4299e1;
    animation: spin 1s ease-in-out infinite;
}

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

/* Button Hover Effects */
.btn-primary:hover {
    background: linear-gradient(135deg, #3182ce, #2b77cb);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 153, 225, 0.4);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

/* Search Input Focus Effect */
.search-input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Video Thumbnail Hover Effect */
.video-thumbnail:hover .play-button {
    transform: scale(1.2);
    background: rgba(66, 153, 225, 0.9);
}

.play-button {
    transition: all 0.3s ease;
}

/* Modal Animation */
.modal {
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    animation: slideInDown 0.4s ease-out;
}

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

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

/* Pulse Animation for New Content */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 153, 225, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(66, 153, 225, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(66, 153, 225, 0);
    }
}