/* ================================================================
   Interactive Tutors Practice Sets - Main Styles
   ================================================================ */

.practice-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.practice-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-radius: 1rem;
    color: white;
}

.practice-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
}

.practice-header .description {
    font-size: 1.125rem;
    opacity: 0.95;
}

/* Level Selection */
.level-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .level-selection {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .practice-header h1 {
        font-size: 1.75rem;
    }
    
    .practice-header .description {
        font-size: 1rem;
    }
    
    .question-text {
        font-size: 1rem !important;
        line-height: 1.5;
        padding: 0 0.5rem;
    }
    
    .practice-area {
        padding: 1.5rem 1rem;
    }
    
    .answer-input {
        width: 100%;
        max-width: 250px;
        font-size: 1.25rem;
    }
    
    .submit-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .stats-bar {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
}

.level-btn {
    padding: 1.25rem 1rem;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-weight: 600;
    color: #374151;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.level-btn:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.level-btn.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border-color: #059669;
}

.level-btn.completed {
    background: #10b981;
    color: white;
    border-color: #059669;
    position: relative;
}

.level-btn.completed::after {
    content: '✓';
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    font-size: 1.25rem;
}

.level-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.level-number {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.25rem;
}

.level-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.level-description {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    opacity: 0.85;
    line-height: 1.4;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.level-btn.active .level-description {
    border-top-color: rgba(255,255,255,0.3);
    opacity: 0.95;
}

/* Practice Area */
.practice-area {
    background: white;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.practice-area.hidden {
    display: none;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.practice-area-grid .stats-bar {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.timer {
    color: #059669;
}

.timer.warning {
    color: #f59e0b;
    animation: pulse 1s infinite;
}

.timer.danger {
    color: #ef4444;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Question Display */
.question-display {
    text-align: center;
    margin: 3rem 0;
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2rem;
    line-height: 1.6;
    white-space: pre-line;
}

/* Matrix Tables */
.question-text table.adjacency-matrix {
    font-size: 0.9rem;
    max-width: 100%;
    overflow-x: auto;
    display: inline-table;
}

@media (max-width: 768px) {
    .question-text table.adjacency-matrix {
        font-size: 0.75rem;
    }
    
    .question-text table.adjacency-matrix th,
    .question-text table.adjacency-matrix td {
        padding: 0.25rem !important;
        min-width: 1.5rem !important;
    }
}

.question-number {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

/* Answer Input */
.answer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.answer-input {
    width: 200px;
    padding: 1rem;
    font-size: 1.5rem;
    text-align: center;
    border: 3px solid #e5e7eb;
    border-radius: 0.75rem;
    transition: all 0.3s;
    font-weight: 600;
}

.answer-input:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.answer-input.correct {
    border-color: #10b981;
    background: #f0fdf4;
}

.answer-input.incorrect {
    border-color: #ef4444;
    background: #fef2f2;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.submit-btn {
    padding: 1rem 3rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feedback */
.feedback-message {
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.feedback-message.correct {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

.feedback-message.incorrect {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

/* Hint Button */
.hint-section {
    margin-top: 2rem;
    text-align: center;
}

.hint-btn {
    padding: 0.75rem 1.5rem;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.hint-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.hint-display {
    margin-top: 1rem;
    padding: 1rem;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 0.5rem;
    color: #92400e;
    font-style: italic;
}

/* Progress Bar */
.progress-container {
    margin: 2rem 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 1.5rem;
    background: #e5e7eb;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #059669 0%, #10b981 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Completion Screen */
.completion-screen {
    text-align: center;
    padding: 3rem 2rem;
}

.completion-screen.hidden {
    display: none;
}

.completion-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

.completion-screen h2 {
    font-size: 2.5rem;
    color: #1f2937;
    margin-bottom: 1rem;
}

.score-display {
    font-size: 1.5rem;
    color: #059669;
    font-weight: 700;
    margin: 2rem 0;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.summary-stat {
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 0.75rem;
}

.summary-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    display: block;
}

.summary-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .practice-header h1 {
        font-size: 2rem;
    }
    
    .question-text {
        font-size: 2rem;
    }
    
    .level-selection {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .stats-bar {
        flex-direction: column;
        text-align: center;
    }
    
    .practice-area {
        padding: 1.5rem;
    }
}

/* ================================================================
   Grid Display Mode Styles
   ================================================================ */

.practice-area-grid {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.practice-area-grid.hidden {
    display: none;
}

.grid-level-desc {
    text-align: center;
    font-size: 1.125rem;
    color: #4b5563;
    margin: 1.5rem auto;
    padding: 1rem;
    background: #f0f9ff;
    border-radius: 0.5rem;
    border-left: 4px solid #059669;
    max-width: 1000px;
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem auto;
    max-width: 1000px;
}

.question-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s;
}

.question-card:hover {
    border-color: #059669;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.1);
}

.question-card.correct {
    background: #f0fdf4;
    border-color: #10b981;
}

.question-card.incorrect {
    background: #fef2f2;
    border-color: #ef4444;
}

.question-card-text {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: #1f2937;
    font-family: 'Georgia', serif;
}

.question-card-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.25rem;
    text-align: center;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.3s;
    font-weight: 600;
}

.question-card-input:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.question-card-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.question-card-feedback {
    margin-top: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    display: none;
}

.question-card.correct .question-card-feedback {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.question-card.incorrect .question-card-feedback {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

.grid-check-container {
    text-align: center;
    margin: 2rem 0;
}

.grid-results {
    margin: 2rem auto 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 1rem;
    border: 2px solid #059669;
    max-width: 1000px;
}

.grid-results.hidden {
    display: none;
}

.results-summary h3 {
    text-align: center;
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-stat {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.correct-stat .result-stat-value {
    color: #10b981;
}

.incorrect-stat .result-stat-value {
    color: #ef4444;
}

.score-stat .result-stat-value {
    color: #059669;
}

.result-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grid-action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .questions-grid {
        grid-template-columns: 1fr;
    }
    
    .practice-area-grid {
        padding: 1rem;
    }
}

