/* Sentence Builder Specific Styles */
/* Uses CSS variables from main styles.css for consistency */

/* Main Container */
.sentence-builder-container {
    flex: 1;
}

/* Header Section */
.sentence-header {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sentence-progress {
    display: flex;
    gap: 20px;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.level-badge-small {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
}

/* Exercise Card */
.exercise-card {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    animation: slideIn 0.4s ease;
}

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

.english-prompt {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.exercise-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
    font-style: italic;
}

/* Drop Zone Area */
.drop-zone-container {
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    min-height: 120px;
}

.drop-zone-label {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.drop-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    padding: 15px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    transition: var(--transition);
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(66, 153, 225, 0.1);
    transform: scale(1.02);
}

.drop-zone.correct {
    border-color: var(--success);
    background: rgba(72, 187, 120, 0.1);
    animation: successPulse 0.6s ease;
}

.drop-zone.incorrect {
    border-color: var(--danger);
    background: rgba(245, 101, 101, 0.1);
    animation: shake 0.5s ease;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Word Bank */
.word-bank-container {
    margin: 30px 0;
}

.word-bank-label {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    min-height: 80px;
}

.word-bank.empty {
    opacity: 0.5;
}

/* Word Cards */
.word-card {
    background: var(--bg-secondary);
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: grab;
    user-select: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
}

.word-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.word-card:active {
    cursor: grabbing;
}

.word-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.word-card.placed {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

.word-card.correct {
    background: var(--success);
    color: white;
    border-color: var(--success);
    animation: bounceIn 0.5s ease;
}

.word-card.incorrect {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    animation: shake 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Placeholder slots in drop zone */
.word-placeholder {
    min-width: 80px;
    height: 45px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.word-placeholder.drop-target {
    border-color: var(--primary);
    background: rgba(66, 153, 225, 0.1);
}

/* Action Buttons */
.sentence-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
    transform: translateY(-2px);
}

/* Feedback Section */
.feedback-section {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    animation: fadeIn 0.3s ease;
    display: none;
}

.feedback-section.show {
    display: block;
}

.feedback-section.success {
    background: rgba(72, 187, 120, 0.15);
    border: 2px solid var(--success);
}

.feedback-section.error {
    background: rgba(245, 101, 101, 0.15);
    border: 2px solid var(--danger);
}

.feedback-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.feedback-message {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feedback-detail {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.correct-answer {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
    margin: 15px 0;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.pronunciation-guide {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
    margin-top: 8px;
}

/* Audio Button */
.audio-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.audio-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Stats Display */
.stats-mini {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.stat-mini {
    background: var(--bg-secondary);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-mini-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-mini-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Keyboard Hints */
.keyboard-hints {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 20px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 8px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sentence-builder-container {
        padding: 10px;
    }

    .exercise-card {
        padding: 20px;
    }

    .english-prompt {
        font-size: 1.2rem;
    }

    .word-card {
        padding: 10px 16px;
        font-size: 1rem;
    }

    .sentence-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .sentence-header {
        flex-direction: column;
        gap: 15px;
    }

    .word-bank,
    .drop-zone {
        padding: 10px;
    }

    .stats-mini {
        gap: 10px;
    }

    .stat-mini {
        flex: 1;
        min-width: 100px;
    }
}

/* Touch-friendly enhancements for mobile */
@media (hover: none) and (pointer: coarse) {
    .word-card {
        min-height: 44px;
        min-width: 44px;
        font-size: 1rem;
    }

    .btn {
        min-height: 44px;
    }

    .word-card:active {
        transform: scale(0.95);
    }
}

/* Accessibility */
.word-card:focus,
.btn:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Success Celebration Animation */
@keyframes celebrate {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-5deg); }
    50% { transform: scale(1.1) rotate(5deg); }
    75% { transform: scale(1.2) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.celebrate {
    animation: celebrate 0.6s ease;
}

/* Confetti effect (optional visual enhancement) */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--primary);
    animation: confetti-fall 3s linear forwards;
    pointer-events: none;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}
