/* KnowledgeBase Question Generator - Public Styles */

.kb-qg-teacher-interface {
    max-width: 1000px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e1e4e8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.kb-qg-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #4a6cf7;
}

.kb-qg-header h2 {
    color: #2d3748;
    margin: 0 0 10px 0;
    font-size: 28px;
}

.kb-qg-subtitle {
    color: #718096;
    font-size: 16px;
    margin: 0;
}

/* Tabs */
.kb-qg-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 5px;
}

.kb-qg-tab {
    padding: 12px 24px;
    background: #f7fafc;
    border: none;
    border-radius: 6px 6px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s;
}

.kb-qg-tab:hover {
    background: #edf2f7;
    color: #2d3748;
}

.kb-qg-tab.active {
    background: #4a6cf7;
    color: white;
    font-weight: 600;
}

/* Tab Content */
.kb-qg-tab-content {
    display: none;
}

.kb-qg-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* User Section */
.kb-qg-user-section {
    background: #f0f7ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #d1e9ff;
}

.kb-qg-user-section h3 {
    margin-top: 0;
    color: #2d3748;
    font-size: 18px;
}

/* Form Styles */
.kb-qg-form-group {
    margin-bottom: 20px;
}

.kb-qg-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

.kb-qg-form-group input[type="text"],
.kb-qg-form-group input[type="email"],
.kb-qg-form-group select,
.kb-qg-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.kb-qg-form-group input:focus,
.kb-qg-form-group select:focus,
.kb-qg-form-group textarea:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.kb-qg-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.kb-qg-help-text {
    font-size: 12px;
    color: #718096;
    margin-top: 5px;
    font-style: italic;
}

/* Upload Methods */
.kb-qg-upload-methods {
    display: flex;
    gap: 30px;
    margin: 20px 0;
    align-items: center;
}

.kb-qg-method-option {
    flex: 1;
}

.kb-qg-method-option h4 {
    margin-top: 0;
    color: #2d3748;
    font-size: 16px;
    margin-bottom: 10px;
}

.kb-qg-or {
    font-weight: 600;
    color: #718096;
}

/* File Upload */
.kb-qg-file-upload {
    margin-top: 10px;
}

.kb-qg-file-upload input[type="file"] {
    display: none;
}

.kb-qg-upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.kb-qg-upload-area:hover {
    border-color: #4a6cf7;
    background: #f8faff;
}

.kb-qg-file-info {
    margin-top: 10px;
}

.kb-qg-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-top: 5px;
}

/* Buttons */
.kb-qg-button {
    padding: 12px 24px;
    background: #4a6cf7;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.kb-qg-button:hover {
    background: #3a5ce5;
    transform: translateY(-1px);
}

.kb-qg-button:active {
    transform: translateY(0);
}

.kb-qg-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.kb-qg-button-small {
    padding: 8px 16px;
    font-size: 12px;
}

.kb-qg-button-primary {
    background: linear-gradient(135deg, #4a6cf7, #6a8aff);
    font-size: 16px;
    padding: 14px 32px;
}

/* Spinner */
.kb-qg-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading State */
.kb-qg-loading {
    text-align: center;
    padding: 40px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.kb-qg-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #4a6cf7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 20px;
}

/* Messages */
.kb-qg-success,
.kb-qg-error,
.kb-qg-info {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid;
}

.kb-qg-success {
    background: #f0fff4;
    border-color: #48bb78;
    color: #22543d;
}

.kb-qg-error {
    background: #fff5f5;
    border-color: #f56565;
    color: #742a2a;
}

.kb-qg-info {
    background: #ebf8ff;
    border-color: #4299e1;
    color: #2a4365;
}

/* Questions Display */
.kb-qg-questions-list {
    margin-top: 30px;
}

.kb-qg-question-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.kb-qg-question-item:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.kb-qg-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.kb-qg-question-header h5 {
    margin: 0;
    color: #2d3748;
    font-size: 16px;
}

.kb-qg-copy-btn {
    padding: 6px 12px;
    background: #edf2f7;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    color: #4a5568;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.kb-qg-copy-btn:hover {
    background: #e2e8f0;
}

.kb-qg-question-content {
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 14px;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.kb-qg-options {
    margin: 15px 0;
}

.kb-qg-option {
    padding: 10px 15px;
    margin: 5px 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
}

.kb-qg-answer,
.kb-qg-solution {
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
}

.kb-qg-answer {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #22543d;
}

.kb-qg-solution {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2a4365;
}

.kb-qg-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* KnowledgeBase Cards */
.kb-qg-kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kb-qg-kb-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.kb-qg-kb-card:hover {
    border-color: #4a6cf7;
    box-shadow: 0 4px 12px rgba(74, 108, 247, 0.1);
}

.kb-qg-kb-card h3 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 18px;
}

.kb-qg-kb-subject {
    display: inline-block;
    background: #e6f7ff;
    color: #1890ff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.kb-qg-kb-description {
    color: #718096;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.kb-qg-kb-meta {
    display: flex;
    justify-content: space-between;
    color: #a0aec0;
    font-size: 12px;
    border-top: 1px solid #f7fafc;
    padding-top: 10px;
}

/* LaTeX Content */
.kb-qg-latex-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.kb-qg-latex-content .katex-display {
    margin: 1em 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    overflow-x: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .kb-qg-teacher-interface {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .kb-qg-tabs {
        flex-direction: column;
    }
    
    .kb-qg-tab {
        border-radius: 6px;
        margin-bottom: 5px;
    }
    
    .kb-qg-upload-methods {
        flex-direction: column;
        gap: 20px;
    }
    
    .kb-qg-or {
        text-align: center;
    }
    
    .kb-qg-actions {
        flex-direction: column;
    }
    
    .kb-qg-button {
        width: 100%;
        justify-content: center;
    }
}

