* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 400;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.content-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Теория */
.theory-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.theory-content h3 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.theory-card {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
}

.theory-card h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.theory-card p {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #555;
}

.formula {
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 15px;
    color: white;
}

.math {
    font-size: 1.5rem;
    font-weight: 500;
    font-family: 'Times New Roman', serif;
}

.examples h5 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.example {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.example .math {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.example .result {
    color: #28a745;
    font-weight: 500;
}

/* Визуальное представление */
.visual-example {
    margin-top: 20px;
}

.array-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 30px !important;
    width: 100% !important;
}

.array-row {
    text-align: center !important;
    background: white !important;
    padding: 20px !important;
    border-radius: 15px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    width: 100% !important;
    overflow: hidden !important;
}

.array-row h5 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.dots-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 15px 0 !important;
    align-items: center !important;
    width: 100% !important;
}

.dot-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin-bottom: 8px !important;
}

.dot-row:last-child {
    margin-bottom: 0 !important;
}

.dot {
    font-size: 1.5rem !important;
    color: #667eea !important;
    animation: pulse 2s infinite !important;
    display: inline-block !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.explanation {
    background: #e3f2fd;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    border-left: 4px solid #2196f3;
}

.explanation p {
    margin: 0;
    color: #1565c0;
    font-size: 0.95rem;
    line-height: 1.5;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.array-row p {
    color: #666;
    font-style: italic;
}

/* Практика */
.practice-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.practice-content h3 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.practice-card {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
}

.practice-card h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.practice-card p {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #555;
}

.interactive-multiplier {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 500;
    color: #333;
}

.input-group input {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary, .btn-secondary, .btn-success {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.result-display {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.calculation {
    text-align: center;
}

.calc-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.equals {
    font-weight: bold;
    color: #667eea;
}

.conclusion {
    margin-top: 15px;
    padding: 10px;
    background: #d4edda;
    border-radius: 8px;
    color: #155724;
    font-weight: 500;
}

.visual-result {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.visual-result h5 {
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

.visual-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 15px;
}

.visual-side {
    text-align: center;
    background: #f8f9ff;
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #e0e0e0;
}

.visual-side h6 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1rem;
}

/* Создание примеров */
.examples-creator {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.example-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.ex-num {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
}

.ex-num:focus {
    outline: none;
    border-color: #667eea;
}

.multiply {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.ex-result {
    font-weight: bold;
    color: #333;
    min-width: 30px;
}

/* Тест */
.test-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.test-content h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.test-content > p {
    color: #666;
    margin-bottom: 25px;
}

.test-intro {
    text-align: center;
    padding: 40px 20px;
}

.test-intro h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.test-intro p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(135deg, #667eea, #764ba2);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.question-container {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
}

.question-text {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.6;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.option.selected {
    border-color: #667eea;
    background: #e3f2fd;
}

.option.correct {
    border-color: #28a745;
    background: #d4edda;
}

.option.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
}

.option input[type="radio"] {
    margin: 0;
}

.option label {
    cursor: pointer;
    flex: 1;
    font-size: 1rem;
}

.test-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.test-results {
    text-align: center;
    padding: 30px;
}

.score-display {
    margin-bottom: 30px;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.score-display p {
    font-size: 1.2rem;
    color: #333;
    font-weight: 500;
}

.detailed-results {
    text-align: left;
    max-width: 600px;
    margin: 0 auto 25px;
}

.question-result {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.question-result.correct {
    border-left: 4px solid #28a745;
}

.question-result.incorrect {
    border-left: 4px solid #dc3545;
}

.question-result h5 {
    margin-bottom: 8px;
    color: #333;
}

.question-result p {
    color: #666;
    font-size: 0.9rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header h2 {
        font-size: 1.5rem;
    }
    
    .navigation {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .theory-content,
    .practice-content,
    .test-content {
        padding: 20px;
    }
    
    .interactive-multiplier {
        flex-direction: column;
        align-items: stretch;
    }
    
    .example-grid {
        grid-template-columns: 1fr;
    }
    
    .array-container {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .dots-grid {
        gap: 6px !important;
    }
    
    .dot-row {
        gap: 6px !important;
    }
    
    .dot {
        font-size: 1.2rem !important;
    }
    
    .test-navigation {
        flex-direction: column;
    }
    
    .test-navigation button {
        width: 100%;
    }
    
    .visual-comparison {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .visual-side {
        padding: 10px;
    }
} 