/* Specific styles for subjects management page */

#sessionToken {
    font-size: 0.8em;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subjects-container {
    margin-top: 20px;
}

.subjects-container h3 {
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Animation for verification status */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.verifying {
    animation: pulse 1.5s infinite;
    color: var(--text-light);
}

/* Loading indicator */
.loading-indicator {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-light);
}

.loading-indicator i {
    font-size: 36px;
    margin-bottom: 15px;
    color: var(--primary);
}

.loading-indicator p {
    font-size: 16px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    background-color: var(--gray);
    border-radius: 10px;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--primary);
    opacity: 0.6;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text);
}

.empty-state p {
    margin-bottom: 20px;
}

/* Error message */
.error-message {
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 79, 79, 0.1);
    color: #e53935;
    border-radius: 8px;
    margin-top: 20px;
}

.error-message i {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Subject Management Layout */
.subject-management-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.subject-list-section {
    flex: 1;
    max-width: 33%;
}

.question-section {
    flex: 2;
}

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h3 {
    margin: 0;
    font-size: 20px;
}

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

/* CSV import button and info icon */
.csv-info-icon {
    margin-left: 5px;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s;
}

.csv-info-icon:hover {
    color: var(--primary);
}

/* CSV Import Modal */
.csv-import-modal {
    width: 90%;
    max-width: 600px;
}

.progress-container {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--gray);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-inner {
    height: 100%;
    width: 0;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: var(--text);
    text-align: center;
}

.progress-details {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--gray);
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    background-color: #f9f9f9;
}

.success-item, .error-item, .question-item-pending {
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.success-item {
    background-color: rgba(76, 175, 80, 0.1);
    color: #43a047;
}

.error-item {
    background-color: rgba(244, 67, 54, 0.1);
    color: #e53935;
}

.question-item-pending {
    background-color: rgba(33, 150, 243, 0.05);
    color: #1976d2;
}

.success-item i, .error-item i, .question-item-pending i {
    margin-right: 8px;
    font-size: 16px;
    min-width: 16px;
}

/* Add slide-in animation for question items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* Small button variant */
.btn.small {
    padding: 8px 15px;
    font-size: 14px;
}

/* Subject List */
.subject-list {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    max-height: 600px;
    overflow-y: auto;
}

.subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--gray);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.subject-item:hover {
    background-color: rgba(107, 70, 255, 0.05);
}

.subject-item.selected {
    background-color: rgba(107, 70, 255, 0.1);
    border-left: 4px solid var(--primary);
}

.subject-info {
    flex: 1;
    min-width: 0; /* For text truncation */
}

.subject-name {
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subject-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-light);
}

.subject-meta i {
    margin-right: 3px;
}

.subject-actions {
    display: flex;
    gap: 8px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.subject-item:hover .subject-actions {
    opacity: 1;
}

.edit-subject-btn, .delete-subject-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-subject-btn:hover {
    background-color: rgba(107, 70, 255, 0.1);
    color: var(--primary);
}

.delete-subject-btn:hover {
    background-color: rgba(255, 79, 79, 0.1);
    color: #e53935;
}

/* Question List */
.question-list {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 15px;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.question-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    border-bottom: 1px solid var(--gray);
    transition: all 0.2s ease;
    border-radius: 8px;
    margin-bottom: 10px;
}

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

.question-item:hover {
    background-color: var(--gray);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.question-content {
    flex: 1;
    margin-right: 15px;
    min-width: 0; /* For text truncation */
}

.question-text {
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.5;
}

.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--text-light);
}

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

.edit-question-btn, .delete-question-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-question-btn:hover {
    background-color: rgba(107, 70, 255, 0.1);
    color: var(--primary);
}

.delete-question-btn:hover {
    background-color: rgba(255, 79, 79, 0.1);
    color: #e53935;
}

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

.modal {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--gray);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background-color: var(--gray);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--gray);
    display: flex;
    justify-content: flex-end;
}

/* Question edit modal styles */
.question-text-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--gray);
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    min-height: 100px;
    resize: vertical;
}

.question-text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(107, 70, 255, 0.2);
}

.answers-section {
    margin-top: 20px;
}

.answers-section h4 {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.answers-list {
    margin-bottom: 15px;
}

.answer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--gray);
    background-color: white;
    transition: all 0.2s ease;
}

.answer-item:hover {
    background-color: var(--gray);
}

.answer-input-group {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 15px;
}

.answer-text-input {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--gray);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

.answer-text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(107, 70, 255, 0.2);
}

.answer-correct-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.answer-correct-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.delete-answer-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-light);
}

.delete-answer-btn:hover {
    background-color: rgba(255, 79, 79, 0.1);
    color: #e53935;
}

/* Subject edit modal styles */
.subject-name-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--gray);
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
}

.subject-name-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(107, 70, 255, 0.2);
}

.subject-name-input:disabled {
    background-color: var(--gray);
    cursor: not-allowed;
    opacity: 0.8;
}

/* Toggle switch for visibility */
.visibility-toggle {
    margin-top: 20px;
}

.toggle-container {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.visibility-checkbox {
    height: 0;
    width: 0;
    visibility: hidden;
    position: absolute;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    width: 60px;
    height: 30px;
    background: var(--gray);
    border-radius: 30px;
    position: relative;
    transition: background-color 0.2s;
}

.visibility-checkbox:checked + .toggle-label {
    background: var(--primary);
}

.toggle-label .toggle-inner {
    width: 100%;
    height: 100%;
    border-radius: 30px;
}

.toggle-label .toggle-switch {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 24px;
    transition: 0.2s;
    background: white;
    box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2);
}

.visibility-checkbox:checked + .toggle-label .toggle-switch {
    left: calc(100% - 3px);
    transform: translateX(-100%);
}

.visibility-text {
    margin-left: 15px;
    font-weight: 500;
}

.visibility-description {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
}

.not-owner-message {
    margin-top: 20px;
    padding: 12px;
    background-color: rgba(255, 193, 7, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #ff9800;
}

.not-owner-message i {
    margin-right: 10px;
    font-size: 18px;
}

/* Disabled toggle for non-owners */
.visibility-checkbox:disabled + .toggle-label {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button enhancements */
.btn.primary {
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: none;
    font-weight: 500;
}

.btn.primary:hover {
    background: linear-gradient(45deg, var(--primary-dark), var(--primary));
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(107, 70, 255, 0.3);
}

.btn.secondary {
    color: var(--primary);
    border: 2px solid var(--primary);
    background: transparent;
    font-weight: 500;
    box-shadow: none;
}

.btn.secondary:hover {
    background-color: rgba(107, 70, 255, 0.1);
    color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(107, 70, 255, 0.2);
}

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

/* Add hidden class for save buttons */
.hidden {
    display: none;
}

/* Responsive styles */
@media (max-width: 992px) {
    .subject-management-layout {
        flex-direction: column;
    }
    
    .subject-list-section {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .question-item {
        flex-direction: column;
    }
    
    .question-actions {
        align-self: flex-end;
        margin-top: 10px;
    }
    
    .answer-input-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .answer-text-input {
        width: 100%;
    }
}
