/**
 * Tamil Drag and Drop Match - Stylesheet
 * Version: 1.0.0
 * Description: Styles for interactive drag-and-drop matching game
 */

/* ==========================================
   MAIN WRAPPER
   ========================================== */
.tamil-drag-match-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Error Message */
.tdm-error {
    background: #fee;
    border: 2px solid #f88;
    border-radius: 10px;
    padding: 15px;
    color: #c33;
    font-weight: 600;
}

/* ==========================================
   INSTRUCTIONS ACCORDION SECTION
   ========================================== */
.tdm-instructions-container {
    max-width: 900px;
    margin: 20px auto 40px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 20px;
}

.tdm-instruction-accordion {
    margin-bottom: 15px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.tdm-accordion-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.tdm-instruction-accordion[data-lang="tamil"] .tdm-accordion-header {
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8E53 100%);
}

.tdm-accordion-icon {
    font-size: 28px;
    font-weight: bold;
    color: white;
    margin-right: 15px;
    transition: transform 0.3s ease;
    min-width: 30px;
    text-align: center;
}

.tdm-accordion-header.active .tdm-accordion-icon {
    transform: rotate(45deg);
}

.tdm-accordion-title {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.tdm-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: #F7F9FC;
}

.tdm-accordion-content.active {
    max-height: 800px;
    padding: 25px;
}

.tdm-instruction-text {
    color: #2D3748;
    line-height: 1.8;
    font-size: 17px;
}

.tdm-instruction-text strong {
    color: #667eea;
    font-size: 18px;
}

.tdm-instruction-text ol {
    padding-left: 25px;
    margin: 15px 0;
}

.tdm-instruction-text li {
    margin-bottom: 15px;
    font-size: 16px;
    color: #4A5568;
}

/* ==========================================
   GAME AREA
   ========================================== */
.tdm-game-area {
    background: linear-gradient(135deg, #F0F4FF 0%, #E8F0FF 100%);
    border-radius: 20px;
    padding: 20px 15px;
    position: relative;
}

/* ==========================================
   PICTURES CONTAINER
   ========================================== */
.tdm-pictures-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.tdm-picture-item {
    flex: 0 1 200px;
    max-width: 220px;
}

.tdm-picture-box {
    background: white;
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    border: 3px solid #e0e0e0;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tdm-picture {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==========================================
   DROP ZONES
   ========================================== */
.tdm-drop-zone {
    background: white;
    border: 3px dashed #CBD5E0;
    border-radius: 12px;
    padding: 15px 10px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.tdm-drop-zone.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.05);
}

.tdm-drop-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #94A3B8;
    font-size: 14px;
}

.tdm-drop-icon {
    font-size: 28px;
    margin-bottom: 5px;
}

.tdm-drop-text {
    font-weight: 600;
    font-size: 13px;
}

.tdm-drop-zone.has-word .tdm-drop-placeholder {
    display: none;
}

/* Correct/Incorrect Feedback */
.tdm-feedback-icon {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 28px;
    animation: tdmFeedbackPop 0.5s ease;
}

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

.tdm-drop-zone.correct .tdm-feedback-icon {
    display: block;
}

.tdm-drop-zone.correct .tdm-feedback-icon::before {
    content: "✅";
}

.tdm-drop-zone.correct {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    border-style: solid;
}

.tdm-drop-zone.incorrect {
    animation: tdmShake 0.5s ease;
    border-color: #f44336;
}

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

/* ==========================================
   DRAGGABLE WORDS
   ========================================== */
.tdm-words-container {
    text-align: center;
    margin-bottom: 20px;
}

.tdm-words-label {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 15px;
}

.tdm-draggable-words {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tdm-word-card {
    background: white;
    border: 3px solid #667eea;
    border-radius: 12px;
    padding: 12px 20px;
    cursor: move;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.tdm-word-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.tdm-word-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.tdm-word-card.matched {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #ccc;
}

.tdm-drag-handle {
    color: #94A3B8;
    font-size: 16px;
    cursor: move;
}

.tdm-word-text {
    font-size: 26px;
    font-weight: 900;
    color: #2D3748;
}

.tdm-highlight {
    color: #FF1744;
}

/* Word in Drop Zone */
.tdm-drop-zone .tdm-word-card {
    cursor: default;
    margin: 0;
}

/* ==========================================
   CONTROLS
   ========================================== */
.tdm-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.tdm-progress {
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.tdm-progress-text {
    font-size: 16px;
    color: #4A5568;
}

.tdm-score {
    font-size: 20px;
    color: #667eea;
}

.tdm-reset-btn {
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8E53 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
    transition: all 0.3s ease;
}

.tdm-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 157, 0.4);
}

/* ==========================================
   SUCCESS MESSAGE
   ========================================== */
.tdm-success-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.tdm-success-message.show {
    display: flex;
    animation: tdmFadeIn 0.5s ease;
}

@keyframes tdmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tdm-success-content {
    background: white;
    padding: 50px;
    border-radius: 30px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: tdmSuccessPop 0.5s ease;
}

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

.tdm-success-icon {
    font-size: 100px;
    display: block;
    margin-bottom: 20px;
    animation: tdmSuccessSpin 0.8s ease;
}

@keyframes tdmSuccessSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tdm-success-content h3 {
    color: #667eea;
    font-size: 36px;
    margin-bottom: 15px;
}

.tdm-success-content p {
    font-size: 20px;
    color: #4A5568;
    margin-bottom: 30px;
}

.tdm-play-again-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.tdm-play-again-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
    .tdm-pictures-container {
        gap: 12px;
    }
    
    .tdm-picture-item {
        flex: 0 1 100%;
        max-width: 300px;
    }
    
    .tdm-picture-box {
        height: 140px;
    }
    
    .tdm-word-card {
        min-width: 100px;
        padding: 10px 16px;
    }
    
    .tdm-word-text {
        font-size: 22px;
    }
    
    .tdm-controls {
        justify-content: center;
    }
    
    .tdm-success-content {
        padding: 30px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .tdm-game-area {
        padding: 15px 10px;
    }
    
    .tdm-picture-box {
        height: 120px;
        padding: 10px;
    }
    
    .tdm-word-card {
        min-width: 90px;
        padding: 10px 14px;
    }
    
    .tdm-word-text {
        font-size: 20px;
    }
    
    .tdm-drop-zone {
        padding: 12px 8px;
        min-height: 60px;
    }
    
    .tdm-drop-icon {
        font-size: 24px;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */
.tdm-word-card:focus {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

.tdm-reset-btn:focus,
.tdm-play-again-btn:focus {
    outline: 3px solid #FF6B9D;
    outline-offset: 3px;
}
