/* ==================== СӘЙКЕСТЕНДІРУ ТАПСЫРМАЛАРЫ ==================== */
.matching-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #fff3e0 0%, #f3e5f5 100%);
    padding: 40px 20px;
}

.matching-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ==================== СОЗДАНИЕ ==================== */
.matching-creator {
    background: white;
    border-radius: 25px;
    padding: 50px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
}

.creator-header {
    text-align: center;
    margin-bottom: 50px;
}

.creator-header i {
    font-size: 4rem;
    color: #43a047;
    margin-bottom: 20px;
}

.creator-title {
    font-size: 3rem;
    background: linear-gradient(135deg, #43a047 0%, #8e24aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin-bottom: 15px;
}

.creator-description {
    font-size: 1.3rem;
    color: #666;
}

.generate-form {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 50px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.form-group label i {
    color: #43a047;
    font-size: 1.2rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #43a047;
    box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.btn-generate {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #43a047 0%, #8e24aa 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
}

.btn-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(67, 160, 71, 0.3);
}

.btn-generate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loading-spinner {
    position: absolute;
    right: 20px;
}

/* ==================== СПИСОК ЗАДАНИЙ ==================== */
.tasks-list {
    margin-top: 50px;
}

.list-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.task-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
}

.task-card:hover {
    border-color: #43a047;
    box-shadow: 0 10px 30px rgba(67, 160, 71, 0.1);
    transform: translateY(-5px);
}

.task-header {
    margin-bottom: 20px;
}

.task-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.task-meta {
    display: flex;
    gap: 15px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.pairs-count {
    background: #43a047;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.task-date i {
    margin-right: 5px;
    color: #43a047;
}

.task-actions {
    display: flex;
    gap: 10px;
}

.btn-play,
.btn-edit,
.btn-delete-task {
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-play {
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    color: white;
    flex: 1;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 160, 71, 0.3);
}

.btn-edit {
    background: #00acc1;
    color: white;
}

.btn-edit:hover {
    background: #0097a7;
    transform: translateY(-2px);
}

.btn-delete-task {
    background: #dc3545;
    color: white;
}

.btn-delete-task:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.no-tasks {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    grid-column: 1 / -1;
}

.no-tasks i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.no-tasks p {
    font-size: 1.3rem;
}

/* ==================== РЕДАКТИРОВАНИЕ ==================== */
.matching-editor {
    background: white;
    border-radius: 25px;
    padding: 50px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
}

.editor-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.editor-header .btn-back {
    position: absolute;
    left: 0;
    top: 0;
    padding: 12px 20px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.editor-header .btn-back:hover {
    background: #5a6268;
}

.editor-title {
    font-size: 2.5rem;
    color: #2c3e50;
}

.pairs-editor {
    margin-bottom: 30px;
}

.pair-row {
    display: grid;
    grid-template-columns: 2fr auto 2fr auto;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.term-input,
.definition-input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.term-input:focus,
.definition-input:focus {
    outline: none;
    border-color: #43a047;
    box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
}

.pair-arrow {
    font-size: 1.5rem;
    color: #43a047;
    font-weight: 700;
}

.btn-remove-pair {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove-pair:hover {
    background: #c82333;
    transform: scale(1.1);
}

.btn-add-pair {
    width: 100%;
    padding: 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.btn-add-pair:hover {
    background: #218838;
    transform: translateY(-2px);
}

.form-actions {
    display: flex;
    gap: 15px;
}

.btn-save-task {
    flex: 1;
    padding: 18px;
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-save-task:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(67, 160, 71, 0.3);
}

.btn-cancel-edit {
    padding: 18px 30px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.btn-cancel-edit:hover {
    background: #5a6268;
}

/* ==================== ИГРА ==================== */
.matching-game {
    background: white;
    border-radius: 25px;
    padding: 50px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
}

.game-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.game-header .btn-back {
    position: absolute;
    left: 0;
    top: 0;
    padding: 12px 20px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.game-header .btn-back:hover {
    background: #5a6268;
}

.game-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.game-progress {
    font-size: 1.5rem;
    color: #7f8c8d;
}

.correct-count {
    color: #28a745;
    font-weight: 900;
}

.matching-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.terms-column,
.definitions-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.term-item,
.definition-item {
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    color: #2c3e50;
    position: relative;
}

.term-item:hover,
.definition-item:hover {
    border-color: #43a047;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(67, 160, 71, 0.2);
}

.term-item.selected,
.definition-item.selected {
    border-color: #43a047;
    background: #e8f5e9;
    box-shadow: 0 5px 20px rgba(67, 160, 71, 0.3);
}

.term-item.matched,
.definition-item.matched {
    border-color: #28a745;
    background: #d4edda;
    cursor: default;
}

.term-item.matched:hover,
.definition-item.matched:hover {
    transform: none;
}

.term-item.wrong,
.definition-item.wrong {
    border-color: #dc3545;
    background: #f8d7da;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.game-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-check,
.btn-reset {
    padding: 18px 40px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: none;
}

.btn-check {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-check:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.btn-reset {
    background: #6c757d;
    color: white;
}

.btn-reset:hover {
    background: #5a6268;
    transform: translateY(-3px);
}

/* ==================== АДАПТИВНОСТЬ ==================== */
@media (max-width: 768px) {
    .matching-page {
        padding: 20px 10px;
    }
    
    .matching-creator,
    .matching-editor,
    .matching-game {
        padding: 30px 20px;
    }
    
    .creator-title,
    .editor-title,
    .game-title {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .tasks-grid {
        grid-template-columns: 1fr;
    }
    
    .matching-board {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .pair-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .pair-arrow {
        text-align: center;
    }
    
    .btn-remove-pair {
        width: 100%;
        border-radius: 8px;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .editor-header .btn-back,
    .game-header .btn-back {
        position: static;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .creator-title,
    .editor-title,
    .game-title {
        font-size: 1.8rem;
    }
    
    .task-actions {
        flex-direction: column;
    }
}
