/* Dutch Word Order Tool - Scoped styles */

/* Mode Selection Controls */
.word-order-controls {
    background: #fff;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 980px;
    text-align: center;
}

.word-order-controls h2 {
    color: var(--primary-blue);
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.mode-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-button {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-blue);
    background: #fff;
    color: var(--primary-blue);
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.mode-button:hover {
    background: var(--primary-blue);
    color: #fff;
}

.mode-button.active {
    background: var(--primary-blue);
    color: #fff;
}

/* Word Order Framework */
.word-order-framework {
    background: #fff;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 980px;
}

.word-order-framework h2 {
    color: var(--primary-blue);
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.word-order-framework p {
    color: var(--medium-gray);
    margin: 0 0 1.5rem 0;
    font-style: italic;
    text-align: center;
}

.order-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}


/* Expanded Options - always visible to prevent jumping */
.expanded-options {
    background: #f8f9fa;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1rem;
    animation: slideIn 0.3s ease-out;
    min-height: 200px; /* Reduced height for fewer pronoun options */
}

.expanded-options h3 {
    color: var(--primary-blue);
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    text-align: center;
}

.word-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

.order-slot {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.9rem;
    border: 2px solid;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.order-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.order-slot:active {
    transform: translateY(0);
}


.order-slot.expanded {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.order-slot.subject { 
    background: #e3f2fd; 
    border-color: #2196f3; 
    color: #1976d2; 
}
.order-slot.verb { 
    background: #f3e5f5; 
    border-color: #9c27b0; 
    color: #7b1fa2; 
}
.order-slot.pronoun { 
    background: #fff8e1; 
    border-color: #ffc107; 
    color: #f57f17; 
}
.order-slot.deictic { 
    background: #f1f8e9; 
    border-color: #8bc34a; 
    color: #689f38; 
}
.order-slot.time { 
    background: #fce4ec; 
    border-color: #e91e63; 
    color: #c2185b; 
}
.order-slot.manner { 
    background: #e0f2f1; 
    border-color: #009688; 
    color: #00695c; 
}
.order-slot.place { 
    background: #f1f8e9; 
    border-color: #8bc34a; 
    color: #689f38; 
}
.order-slot.object { 
    background: #fff8e1; 
    border-color: #ffc107; 
    color: #f57f17; 
}
.order-slot.adverb { 
    background: #e8f5e8; 
    border-color: #4caf50; 
    color: #2e7d32; 
}
.order-slot.conjunction { 
    background: #fff3e0; 
    border-color: #ff9800; 
    color: #e65100; 
}
.order-slot.comma { 
    background: #f5f5f5; 
    border-color: #9e9e9e; 
    color: #424242; 
}
.order-slot.verb2 { 
    background: #f3e5f5; 
    border-color: #9c27b0; 
    color: #7b1fa2; 
}
.order-slot.subject2 { 
    background: #e3f2fd; 
    border-color: #2196f3; 
    color: #1976d2; 
}
.order-slot.rest { 
    background: #f5f5f5; 
    border-color: #9e9e9e; 
    color: #9e9e9e; 
}

/* Sentence Builder */
.sentence-builder {
    background: #fff;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 980px;
}

.sentence-builder h2 {
    color: var(--primary-blue);
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.sentence-container {
    background: #f8f9fa;
    border: 2px dashed var(--border-gray);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 1rem 0;
    min-height: 80px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sentence-container.drag-over {
    border-color: var(--primary-blue);
    background: #f0f6ff;
}

.sentence-slot {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 1.1rem;
    border: 2px solid;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.sentence-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sentence-slot.subject { 
    background: #e3f2fd; 
    border-color: #2196f3; 
    color: #1976d2; 
}
.sentence-slot.verb { 
    background: #f3e5f5; 
    border-color: #9c27b0; 
    color: #7b1fa2; 
}
.sentence-slot.pronoun { 
    background: #fff8e1; 
    border-color: #ffc107; 
    color: #f57f17; 
}
.sentence-slot.deictic { 
    background: #f1f8e9; 
    border-color: #8bc34a; 
    color: #689f38; 
}
.sentence-slot.time { 
    background: #fce4ec; 
    border-color: #e91e63; 
    color: #c2185b; 
}
.sentence-slot.manner { 
    background: #e0f2f1; 
    border-color: #009688; 
    color: #00695c; 
}
.sentence-slot.place { 
    background: #f1f8e9; 
    border-color: #8bc34a; 
    color: #689f38; 
}
.sentence-slot.object { 
    background: #fff8e1; 
    border-color: #ffc107; 
    color: #f57f17; 
}
.sentence-slot.adverb { 
    background: #e8f5e8; 
    border-color: #4caf50; 
    color: #2e7d32; 
}
.sentence-slot.conjunction { 
    background: #fff3e0; 
    border-color: #ff9800; 
    color: #e65100; 
}
.sentence-slot.comma { 
    background: #f5f5f5; 
    border-color: #9e9e9e; 
    color: #424242; 
}
.sentence-slot.verb2 { 
    background: #f3e5f5; 
    border-color: #9c27b0; 
    color: #7b1fa2; 
}
.sentence-slot.subject2 { 
    background: #e3f2fd; 
    border-color: #2196f3; 
    color: #1976d2; 
}
.sentence-slot.rest { 
    background: #f5f5f5; 
    border-color: #9e9e9e; 
    color: #9e9e9e; 
}

.sentence-slot.empty {
    background: #f8f9fa;
    border: 2px dashed var(--border-gray);
    color: #6c757d;
    min-width: 60px;
    text-align: center;
}

.sentence-slot.empty:hover {
    border-color: var(--primary-blue);
    background: #f0f6ff;
}

.sentence-slot.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Progress Indicator */
.progress-indicator {
    background: #f8f9fa;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.progress-indicator p {
    margin: 0;
    color: var(--medium-gray);
    font-style: italic;
}

/* Translation Controls */
.translation-controls {
    margin-top: 1rem;
    text-align: center;
}

.google-translate-button {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-blue);
    background: #fff;
    color: var(--primary-blue);
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.google-translate-button:hover {
    background: var(--primary-blue);
    color: #fff;
}

.translation-display {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-gray);
}

.translation-display p {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

/* Word Categories */
.word-categories {
    background: #fff;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 980px;
}

.word-categories h2 {
    color: var(--primary-blue);
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    text-align: center;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.category-section {
    background: #f8f9fa;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: all 0.3s ease;
}

.category-section:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-header {
    color: var(--primary-blue);
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-header::after {
    content: "▼";
    transition: transform 0.3s ease;
}

.category-section.expanded .category-header::after {
    transform: rotate(180deg);
}

.category-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.category-section:not(.expanded) .category-content {
    max-height: 0;
    opacity: 0;
}

.category-section.expanded .category-content {
    max-height: 500px;
    opacity: 1;
}

.selected-word {
    padding: 0.5rem;
    background: #fff;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    margin-bottom: 0.5rem;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.word-option {
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    cursor: grab;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    user-select: none;
}

.word-option:hover {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.word-option:active {
    cursor: grabbing;
    transform: scale(0.95);
}

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

/* Drag and Drop Visual Feedback */
.drop-zone {
    border: 2px dashed var(--primary-blue) !important;
    background: #f0f6ff !important;
}

.drop-zone.valid {
    border-color: var(--success-green) !important;
    background: #e8f5e8 !important;
}

.drop-zone.invalid {
    border-color: var(--accent-red) !important;
    background: #ffebee !important;
}

/* Enhanced Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes wordMove {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(74, 144, 226, 0.1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.sentence-slot.animating {
    animation: wordMove 0.5s ease-in-out;
}

.sentence-slot.pulse {
    animation: pulse 1s infinite;
}

.sentence-container.drag-active {
    background: #f0f6ff;
    border-color: var(--primary-blue);
}

.sentence-slot.drag-over {
    background: #e3f2fd !important;
    border-color: var(--primary-blue) !important;
    transform: scale(1.05);
}

/* Smooth transitions for mode changes */
.sentence-container {
    transition: all 0.3s ease;
}

.sentence-slot {
    transition: all 0.3s ease;
}

/* Enhanced hover effects */
.word-option:hover {
    animation: bounce 0.6s ease-in-out;
}

.category-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .mode-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .mode-button {
        width: 100%;
        max-width: 200px;
    }
    
    /* Dutch Word Order - horizontal on mobile */
    .order-display {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
        justify-content: center;
        overflow-x: auto;
        padding: 0.5rem;
    }
    
    .order-slot {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Build Your Sentence - horizontal on mobile */
    .sentence-container {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
        justify-content: center;
        overflow-x: auto;
        padding: 0.5rem;
    }
    
    .sentence-slot {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    /* Word options grid - horizontal on mobile */
    .word-options-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        justify-content: center;
        overflow-x: auto;
        padding: 0.5rem;
    }
    
    .word-option {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .word-options {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .word-order-controls,
    .word-order-framework,
    .sentence-builder,
    .word-categories {
        margin: 1rem auto;
        padding: 1rem;
    }
    
    .sentence-slot {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
    }
    
    .word-option {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Focus styles for accessibility */
.mode-button:focus,
.google-translate-button:focus,
.category-header:focus,
.word-option:focus,
.sentence-slot:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sentence-slot,
    .word-option,
    .order-slot {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sentence-slot,
    .word-option,
    .category-content,
    .mode-button,
    .google-translate-button {
        transition: none;
    }
    
    .sentence-slot.animating {
        animation: none;
    }
}

/* Translation Controls */
.translation-controls {
    margin-top: 20px;
    text-align: center;
}

.translation-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.google-translate-button, .reset-button {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    min-width: 150px;
    flex-shrink: 0;
}

.google-translate-button:hover {
    background-color: #357abd;
}

.reset-button {
    background-color: #dc3545;
}

.reset-button:hover {
    background-color: #c82333;
}

.translation-display {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    font-style: italic;
    color: #666;
}

.translation-display p {
    margin: 0;
    font-size: 16px;
}

/* Center section headers */
.word-order-framework h2,
.sentence-builder h2 {
    text-align: center;
}

/* Style explanation text */
.mode-explanation {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    font-style: italic;
    color: #6c757d;
    text-align: center;
}

/* Style back to resources button like words.html */
.words-back-to-resources { 
    text-align: center !important; 
    margin: 4rem 0 2rem 0 !important; 
    width: 100% !important;
}
.back-to-resources {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0.6rem 1rem !important;
    background-color: #fff !important;
    color: var(--primary-blue) !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    border: 2px solid var(--primary-blue) !important;
    transition: all 0.3s ease !important;
}
.back-to-resources:hover { 
    background-color: var(--primary-blue) !important; 
    color: #fff !important; 
    border-color: var(--primary-blue) !important;
}
.back-to-resources:hover svg {
    fill: #fff !important;
}
.back-to-resources:hover * {
    color: #fff !important;
}
.words-back-to-resources .back-to-resources:hover {
    color: #fff !important;
}
.words-back-to-resources .back-to-resources:hover svg {
    fill: #fff !important;
}
.back-to-resources:visited { color: var(--primary-blue) !important; }

/* Inburgeringsexamen tip */
.inburgering-tip {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    color: #155724;
    text-align: center;
    font-weight: 500;
}

/* SEO Section - copied from words.css */
.seo-explanation-section {
    margin: 3rem auto 2rem auto;
    max-width: 980px;
    background: #fff;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    padding: 2rem;
}

.seo-explanation-section h2 {
    color: var(--primary-blue);
    margin: 0 0 1rem 0;
}

.seo-explanation-section h3 {
    color: #333;
    margin: 1.5rem 0 0.75rem 0;
}

.seo-explanation-section p,
.seo-explanation-section li {
    color: #444;
    line-height: 1.7;
}

.seo-explanation-section ul {
    padding-left: 1.2rem;
}

.seo-explanation-section .homepage-note {
    margin-top: 1.25rem;
}
