/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

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

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: #7f8c8d;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close:hover {
    color: #e74c3c;
}

/* Quiz Styles */
.quiz-container {
    padding: 1rem 0;
}

.quiz-question {
    margin-bottom: 2rem;
}

.quiz-question h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.quiz-question p {
    color: #5a6c7d;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    color: #2c3e50;
}

.quiz-option:hover {
    border-color: #3498db;
    background: #e8f4fd;
}

.quiz-option.selected {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.quiz-progress {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.quiz-nav-buttons {
    display: flex;
    gap: 1rem;
}

.quiz-completion {
    text-align: center;
    padding: 2rem;
}

.quiz-completion h3 {
    color: #27ae60;
    margin-bottom: 1rem;
}

.quiz-completion p {
    color: #5a6c7d;
    font-style: italic;
    margin-bottom: 1.5rem;
}

/* Pattern Matching Quiz */
.pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.pattern-cell {
    width: 50px;
    height: 50px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pattern-cell:hover {
    border-color: #3498db;
    background: #e8f4fd;
}

.pattern-cell.selected {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.pattern-cell.filled {
    background: #34495e;
    color: white;
    border-color: #34495e;
}

/* Slider Quiz */
.slider-container {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.slider-question {
    margin-bottom: 1rem;
    font-weight: 500;
    color: #2c3e50;
}

.slider-wrapper {
    position: relative;
    margin: 1rem 0;
}

.quiz-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.quiz-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.quiz-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.slider-value {
    text-align: center;
    margin-top: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

/* Popup Styles */
.popup {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.popup.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popupFadeIn 0.4s ease-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-content h3 {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.popup-content p {
    color: #5a6c7d;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Breadcrumb */
.breadcrumb {
    background: #f8f9fa;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.breadcrumb-nav {
    font-size: 0.9rem;
}

.breadcrumb-nav a {
    color: #6c757d;
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    color: #3498db;
}

.breadcrumb-nav span {
    color: #6c757d;
    margin: 0 0.5rem;
}

.breadcrumb-nav .current {
    color: #2c3e50;
    font-weight: 500;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-info {
    background: #e8f4fd;
    border-color: #3498db;
    color: #2980b9;
}

.alert-warning {
    background: #fff3cd;
    border-color: #f39c12;
    color: #d68910;
}

.alert-danger {
    background: #f8d7da;
    border-color: #e74c3c;
    color: #c0392b;
}

.alert-success {
    background: #d4edda;
    border-color: #27ae60;
    color: #196f3d;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .popup-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .quiz-options {
        gap: 0.5rem;
    }
    
    .quiz-option {
        padding: 0.75rem;
    }
    
    .quiz-nav-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pattern-grid {
        max-width: 180px;
    }
    
    .pattern-cell {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}