/* Enhanced HSPT Sentence Builder Styles - Complete with Minimal Animations */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
}

/* Container */
.container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.vocab-info {
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 10px;
    margin-top: 10px;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

/* Connection Status */
.connection-status {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.status-indicator {
    font-size: 8px;
}

/* Instructions */
.instructions {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 10px;
    margin: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.instructions small {
    display: block;
    margin-top: 8px;
    font-style: italic;
    color: #6c757d;
}

/* Loading Indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: #6c757d;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Difficulty Selector */
.difficulty-selector {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-bottom: 2px solid #e9ecef;
}

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

.difficulty-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
    backdrop-filter: blur(10px);
}

.difficulty-btn.easy {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.difficulty-btn.medium {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #333;
}

.difficulty-btn.hard {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
}

.difficulty-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.difficulty-btn.active {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.word-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grammar-hint {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196f3;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    font-style: italic;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Score Display */
.score-display {
    text-align: center;
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.score-display h4 {
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score {
    font-size: 32px;
    font-weight: bold;
    background: linear-gradient(135deg, #007bff 0%, #6f42c1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 8px;
}

.session-stats {
    color: #6c757d;
    font-size: 12px;
}

.score-update {
    animation: scoreUpdate 0.6s ease-in-out;
}

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

/* Main Content */
.main-content {
    display: flex;
    padding: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

/* Word Bank */
.word-bank {
    flex: 1;
    min-width: 300px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
}

.word-bank::-webkit-scrollbar {
    width: 8px;
}

.word-bank::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.word-bank::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.word-bank::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.word-bank h3 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    font-size: 18px;
}

.word-bank-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: #6c757d;
    color: white;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 15px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-small.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    transform: scale(1.05);
}

/* Word Sections */
.word-section {
    margin-bottom: 25px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(5px);
}

.word-section:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.word-section.common {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40,167,69,0.05) 0%, rgba(255,255,255,0.9) 100%);
}

.word-section.hspt {
    border-color: #007bff;
    background: linear-gradient(135deg, rgba(0,123,255,0.05) 0%, rgba(255,255,255,0.9) 100%);
}

.word-section.grammar {
    border-color: #6c757d;
    background: linear-gradient(135deg, rgba(108,117,125,0.05) 0%, rgba(255,255,255,0.9) 100%);
}

.section-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.section-header h3 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 1.1rem;
}

.section-description {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.section-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-badge {
    background: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid #dee2e6;
    color: #495057;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.theme-badge {
    background: linear-gradient(135deg, #007bff 0%, #6f42c1 100%);
    color: white;
    border: none;
}

/* Word Categories */
.word-category {
    margin-bottom: 20px;
    background: rgba(255,255,255,0.7);
    border-radius: 10px;
    padding: 10px;
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
}

.word-category:hover {
    background: rgba(255,255,255,0.9);
}

.category-title {
    font-weight: bold;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.category-title:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Category colors */
.category-title.noun { 
    background: linear-gradient(135deg, #ffc1cc 0%, #ffb3ba 100%); 
    color: #8b0000; 
}
.category-title.verb { 
    background: linear-gradient(135deg, #add8e6 0%, #87ceeb 100%); 
    color: #000080; 
}
.category-title.adjective { 
    background: linear-gradient(135deg, #ffd4a3 0%, #ffb366 100%); 
    color: #cc5500; 
}
.category-title.article { 
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%); 
    color: #155724; 
}
.category-title.conjunction { 
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%); 
    color: #383d41; 
}
.category-title.preposition { 
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%); 
    color: #721c24; 
}
.category-title.adverb { 
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%); 
    color: #0c5460; 
}

.word-count-badge {
    background: rgba(0,0,0,0.2);
    color: inherit;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    padding: 12px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: rgba(255,255,255,0.5);
    transition: all 0.2s ease;
}

.word-list:hover {
    border-color: #007bff;
    background: rgba(255,255,255,0.8);
}

/* Word Items */
.word-item {
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    border: 1px solid rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
}

.word-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

/* Source-specific styling */
.word-item.common {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, rgba(40,167,69,0.1) 0%, #fff 100%);
}

.word-item.hspt {
    border-left: 4px solid #007bff;
    background: linear-gradient(135deg, rgba(0,123,255,0.1) 0%, #fff 100%);
}

.word-item.grammar {
    border-left: 4px solid #6c757d;
    background: linear-gradient(135deg, rgba(108,117,125,0.1) 0%, #fff 100%);
}

.word-item.selected {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(40,167,69,0.4);
}

/* Word type colors */
.word-item.noun { 
    background: linear-gradient(135deg, #ffb3ba 0%, #ff9aa2 100%); 
    color: #8b0000; 
}
.word-item.verb { 
    background: linear-gradient(135deg, #bae1ff 0%, #87ceeb 100%); 
    color: #000080; 
}
.word-item.adjective { 
    background: linear-gradient(135deg, #ffdfba 0%, #ffcc99 100%); 
    color: #cc5500; 
}
.word-item.article { 
    background: linear-gradient(135deg, #baffc9 0%, #90ee90 100%); 
    color: #155724; 
}
.word-item.conjunction { 
    background: linear-gradient(135deg, #d6d8db 0%, #ced4da 100%); 
    color: #383d41; 
}
.word-item.preposition { 
    background: linear-gradient(135deg, #f5c6cb 0%, #f8d7da 100%); 
    color: #721c24; 
}
.word-item.adverb { 
    background: linear-gradient(135deg, #bee5eb 0%, #a6e3f0 100%); 
    color: #0c5460; 
}

/* Sentence Area */
.sentence-area {
    flex: 1.5;
    min-width: 400px;
}

.sentence-template {
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    border: 3px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    min-height: 200px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.sentence-template h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

.template-description {
    font-style: italic;
    color: #6c757d;
    margin-bottom: 15px;
    text-align: center;
    padding: 10px;
    background: rgba(108, 117, 125, 0.1);
    border-radius: 8px;
}

.template-tips {
    background: rgba(23, 162, 184, 0.1);
    border-left: 4px solid #17a2b8;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.ai-template-indicator {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #007bff;
    margin-top: 10px;
}

.building-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    line-height: 1.8;
    padding: 20px;
    background: linear-gradient(135deg, rgba(248,249,250,0.8) 0%, rgba(233,236,239,0.8) 100%);
    border-radius: 10px;
    border: 2px dashed #dee2e6;
    min-height: 80px;
    transition: all 0.2s ease;
}

.building-area:hover {
    border-color: #007bff;
    background: linear-gradient(135deg, rgba(227,242,253,0.8) 0%, rgba(187,222,251,0.8) 100%);
}

.static-word {
    font-weight: 600;
    color: #495057;
    padding: 4px 8px;
    background: rgba(255,255,255,0.7);
    border-radius: 6px;
}

.drop-zone {
    min-width: 120px;
    min-height: 50px;
    border: 2px dashed #adb5bd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

/* Drop zone colors by type */
.drop-zone[data-type="article"] {
    background: linear-gradient(135deg, #baffc9 0%, #90ee90 100%);
    border-color: #155724;
}

.drop-zone[data-type="adjective"] {
    background: linear-gradient(135deg, #ffd4a3 0%, #ffcc99 100%);
    border-color: #cc5500;
}

.drop-zone[data-type="noun"] {
    background: linear-gradient(135deg, #ffc1cc 0%, #ffb3ba 100%);
    border-color: #8b0000;
}

.drop-zone[data-type="verb"] {
    background: linear-gradient(135deg, #add8e6 0%, #87ceeb 100%);
    border-color: #000080;
}

.drop-zone[data-type="adverb"] {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-color: #0c5460;
}

.drop-zone[data-type="conjunction"] {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    border-color: #383d41;
}

.drop-zone[data-type="preposition"] {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #721c24;
}

.drop-zone.filled {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-style: solid;
    box-shadow: 0 2px 8px rgba(40,167,69,0.3);
}

.drop-zone.next-to-fill {
    border-color: #007bff;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-style: solid;
    box-shadow: 0 0 12px rgba(0, 123, 255, 0.4);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 12px rgba(0, 123, 255, 0.4);
    }
    50% { 
        transform: scale(1.02); 
        box-shadow: 0 0 16px rgba(0, 123, 255, 0.6);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 12px rgba(0, 123, 255, 0.4);
    }
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Feedback */
#feedback {
    margin-top: 20px;
}

.feedback {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.feedback.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    color: #155724;
}

.feedback.info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.feedback.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeeba;
    color: #856404;
}

.feedback.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.feedback h4 {
    margin-bottom: 10px;
    font-size: 16px;
}

.feedback ul {
    margin: 10px 0 0 20px;
}

.feedback li {
    margin-bottom: 5px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.notification.success {
    border-left: 4px solid #28a745;
    color: #155724;
}

.notification.info {
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.notification.error {
    border-left: 4px solid #dc3545;
    color: #721c24;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Session Summary */
.session-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 15px;
    padding: 20px;
    margin: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.session-summary h3 {
    color: #495057;
    margin-bottom: 15px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    padding: 10px;
    background: #e9ecef;
    border-radius: 6px;
    text-align: center;
}

.stat-item strong {
    display: block;
    color: #495057;
    margin-bottom: 5px;
}

/* Error Display */
.error-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.error-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    margin: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.error-content h3 {
    color: #dc3545;
    margin-bottom: 15px;
}

.error-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #dc3545;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Stats Modal */
.stats-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.stats-section h4 {
    margin-bottom: 10px;
    color: #495057;
}

.stats-section ul {
    margin: 5px 0 0 20px;
}

.stats-section li {
    margin-bottom: 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        padding: 10px;
    }
    
    .word-bank,
    .sentence-area {
        min-width: auto;
        flex: none;
    }
    
    .difficulty-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .difficulty-btn {
        width: 200px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .word-bank-controls {
        flex-wrap: wrap;
    }
    
    .word-bank-controls .btn-small {
        flex: 1;
        min-width: 80px;
        margin: 2px;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .building-area {
        font-size: 16px;
        padding: 15px;
    }
    
    .drop-zone {
        min-width: 100px;
        min-height: 45px;
        font-size: 12px;
    }
    
    .word-item {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .header h1 {
        font-size: 1.5em;
    }
    
    .connection-status {
        position: relative;
        margin-top: 10px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 5px;
        border-radius: 15px;
    }
    
    body {
        padding: 5px;
    }
    
    .header {
        padding: 15px;
    }
    
    .instructions {
        margin: 15px;
        padding: 12px;
    }
    
    .difficulty-selector {
        padding: 15px;
    }
    
    .word-bank {
        max-height: 400px;
    }
    
    .sentence-template {
        padding: 15px;
        min-height: 150px;
    }
    
    .building-area {
        font-size: 14px;
        padding: 10px;
        gap: 8px;
    }
    
    .drop-zone {
        min-width: 80px;
        min-height: 40px;
        font-size: 11px;
    }
    
    .static-word {
        font-size: 14px;
    }
    
    .word-list {
        gap: 6px;
        padding: 8px;
    }
    
    .word-item {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .score {
        font-size: 24px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .header {
        background: #f8f9fa !important;
        color: black !important;
    }
    
    .btn,
    .controls,
    .word-bank-controls,
    .connection-status,
    .notification,
    .offline-indicator {
        display: none !important;
    }
    
    .word-bank {
        max-height: none;
        overflow: visible;
    }
    
    .main-content {
        flex-direction: column;
    }
}

/* Accessibility Improvements */
.btn:focus,
.word-item:focus,
.drop-zone:focus,
.difficulty-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .word-item {
        border: 2px solid #000;
        background: #fff;
        color: #000;
    }
    
    .word-item:hover {
        background: #000;
        color: #fff;
    }
    
    .drop-zone {
        border: 2px solid #000;
        background: #fff;
    }
    
    .btn {
        border: 2px solid #000;
        background: #fff;
        color: #000;
    }
    
    .btn:hover {
        background: #000;
        color: #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
        border: 4px solid #007bff;
    }
    
    .pulse,
    .score-update,
    .slideInRight {
        animation: none;
    }
}
