/* Enhanced Test Builder Styles */
.tutor-skill-test-builder {
    background: #f9f9f9;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    background: #f8f9fa !important;
    color: #333 !important;
    padding: 20px 0 !important;
    border-radius: 0 !important;
    position: sticky !important;
    top: 32px !important;
    z-index: 100 !important;
}

.page-header-content {
    background: white !important;
    padding: 30px !important;
    margin: 0 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.page-header .header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-header .header-icon {
    font-size: 48px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.page-header .header-text h1 {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 600;
}

.page-header .header-text p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

.page-header .header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Test Builder Container */
.test-builder-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    max-width: 1700px;
    margin: 0 auto;
}

/* Sidebar */
.test-details-sidebar {
    border-radius: 15px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.section-icon {
    font-size: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group .required {
    color: #e74c3c;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fafbfc;
}

/* Override checkbox width to auto */
.form-group input[type="checkbox"] {
    width: auto;
    padding: 0;
    margin-right: 8px;
    transform: scale(1.2);
}

/* Checkbox container styling */
.form-group .checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: 100%;
}

.form-group .checkbox-container label {
    margin-bottom: 0;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.form-group .checkbox-container input[type="checkbox"] {
    flex-shrink: 0;
    margin: 0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-row.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Statistics */
.stats-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #333;
    font-size: 18px;
}

/* Main Content */
.test-questions-main {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.questions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.questions-header .header-left h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
    color: #333;
}

.questions-count {
    color: #666;
    font-size: 14px;
}

.questions-actions {
    display: flex;
    gap: 15px;
}

/* Empty State */
.empty-questions-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-questions-state .empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-questions-state h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #333;
}

.empty-questions-state p {
    margin: 0 0 30px 0;
    font-size: 16px;
    line-height: 1.6;
}

/* Question Items */
.question-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.question-item:hover {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
}

.question-header {
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.question-number {
    background: rgba(255,255,255,0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.question-type-badge {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-type-badge.multiple-choice {
    background: rgba(52, 152, 219, 0.2);
}

.question-type-badge.true-false {
    background: rgba(46, 204, 113, 0.2);
}

.question-type-badge.fill-blank {
    background: rgba(155, 89, 182, 0.2);
}

.question-actions {
    display: flex;
    gap: 8px;
}

.question-actions .button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.question-actions .button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* Question Content */
.question-content {
    padding: 25px;
}

.options-container {
    margin: 20px 0;
}

.options-container label {
    display: block;
    margin-bottom: 15px;
    font-weight: 500;
    color: #333;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.option-row input[type="radio"] {
    width: auto;
    margin: 0;
}

.option-row input[type="text"] {
    flex: 1;
    margin: 0;
}

.option-row .remove-option {
    background: #e74c3c;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.option-row .remove-option:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.add-option {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.add-option:hover {
    background: #229954;
    transform: translateY(-1px);
}

/* True/False Options */
.true-false-options {
    margin: 20px 0;
}

.true-false-options label {
    display: block;
    margin-bottom: 15px;
    font-weight: 500;
    color: #333;
}

.true-false-options .option-row {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.true-false-options .option-row label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

/* Question Settings */
.question-settings {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Modal Styles */
.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-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
}

.modal-title p {
    margin: 0;
    opacity: 0.9;
}

.close-modal {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
}

/* Question Type Selector */
.question-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.question-type-option {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.question-type-option:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.question-type-option .type-icon {
    font-size: 32px;
    margin-bottom: 15px;
}

.question-type-option h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.question-type-option p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Notifications */
.notification {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: notificationSlideIn 0.3s ease;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.notification.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.notification-icon {
    font-size: 18px;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .test-builder-container {
        grid-template-columns: 300px 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .test-builder-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .test-details-sidebar {
        position: static;
    }
    
    .page-header {
        padding: 20px;
        margin: -20px -20px 20px -20px;
    }
    
    .page-header .header-left {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .page-header .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .page-header .header-actions .button {
        width: 100%;
    }
    
    .form-row.two-columns {
        grid-template-columns: 1fr;
    }
    
    .questions-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .questions-actions {
        width: 100%;
    }
    
    .questions-actions .button {
        flex: 1;
    }
}

/* 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 #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
