/* Lesson Question Manager Styles */
.lesson-question-manager {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

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

.manager-header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.manager-header p {
    color: #6c757d;
    font-size: 1.1rem;
}

.selection-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.section-title {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

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

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

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

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

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

.form-group select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
}

.id-range-selector {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.id-range-row {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.id-range-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

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

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

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

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
}

.btn-outline {
    background: transparent;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.questions-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

.questions-count {
    background: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.questions-list {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #e9ecef;
    border-radius: 8px;
}

.question-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.question-item:hover {
    background-color: #f8f9fa;
    border-left-color: #667eea;
}

.question-item.selected {
    background-color: #e8f5e8;
    border-left-color: #28a745;
}

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

.question-checkbox {
    margin-right: 1rem;
    transform: scale(1.2);
    cursor: pointer;
}

.question-content {
    flex: 1;
}

.question-id {
    font-weight: 600;
    color: #667eea;
    margin-right: 0.5rem;
    background: #f0f4ff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.question-text {
    color: #495057;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.question-meta {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.question-meta span {
    background: #f8f9fa;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.question-meta .btn {
    margin-left: auto;
    flex-shrink: 0;
}

.question-item.current-lesson {
    background: #e8f4fd;
    border-left-color: #17a2b8;
    cursor: default;
}

.question-item.current-lesson:hover {
    background: #d1ecf1;
}

.question-item.current-lesson .question-id {
    background: #17a2b8;
    color: white;
}

.selected-questions-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.selected-questions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.selected-questions-list {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

.selected-question-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.selected-question-item:last-child {
    margin-bottom: 0;
}

.selected-question-info {
    display: flex;
    align-items: center;
}

.selected-question-id {
    font-weight: 600;
    color: #28a745;
    margin-right: 0.5rem;
}

.remove-question-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.no-selection {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.no-selection p {
    font-size: 1.1rem;
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.status-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Question Detail Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: right;
    border-radius: 0 0 12px 12px;
}

/* Question Detail Content */
.question-detail {
    line-height: 1.6;
}

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

.question-detail-id {
    background: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.question-detail-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.question-detail-meta span {
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #495057;
    border: 1px solid #e9ecef;
}

.question-detail-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.question-detail-image {
    margin: 1.5rem 0;
    text-align: center;
}

.question-detail-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.question-detail-options {
    margin: 1.5rem 0;
}

.question-detail-options h4 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.option-item.correct {
    background: #d4edda;
    border-color: #28a745;
}

.option-item.correct .option-letter {
    background: #28a745;
    color: white;
}

.option-letter {
    background: #6c757d;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    font-size: 1rem;
}

.question-detail-explanation {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #e8f4fd;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
}

.question-detail-explanation h4 {
    color: #0c5460;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.question-detail-explanation p {
    margin: 0;
    color: #0c5460;
}

.question-detail-tags {
    margin: 1.5rem 0;
}

.question-detail-tags h4 {
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    background: #667eea;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .question-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .question-detail-meta {
        justify-content: flex-start;
    }
}
