/* Main Container */
.wordle-solver-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wordle-solver-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.wordle-solver-header h2 {
    color: #2c3e50;
    margin: 0;
}

.theme-toggle {
    background: none;
    border: 2px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

/* Grid Layout */
.solver-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #2c3e50;
}

/* Position Boxes */
.position-boxes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.position-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.position-group label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.correct-letter {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    border: 3px solid #27ae60;
    border-radius: 8px;
    background: #d5f4e6;
}

/* Misplaced Letters */
.misplaced-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#misplaced-input,
#excluded-letters {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #f39c12;
    border-radius: 6px;
    font-size: 1rem;
    text-transform: uppercase;
}

.btn-small {
    padding: 0.75rem 1.5rem;
    background: #f39c12;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.letters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.letter-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fef9e7;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 2px solid #f39c12;
}

.letter-tag .remove-letter {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-weight: bold;
}

.positions-selector {
    background: #fef9e7;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.position-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pos-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #f39c12;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.pos-btn.active {
    background: #f39c12;
    color: white;
}

/* Solve Button */
.solve-section {
    text-align: center;
    margin: 2rem 0;
}

.solve-btn {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.solve-btn:hover {
    background: #2980b9;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Tabs */
.results-tabs {
    display: flex;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: bold;
    color: #6c757d;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-pane {
    display: none;
    min-height: 200px;
}

.tab-pane.active {
    display: block;
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    padding: 1rem 0;
}

.word-item {
    padding: 0.75rem;
    background: white;
    border: 2px solid #3498db;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.word-item:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-style: italic;
}

/* Analysis */
.frequency-chart {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.freq-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e3f2fd;
    border-radius: 4px;
}

.position-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.position-stat {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.position-stat h5 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    text-align: center;
}

.position-letters {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Instructions */
.instructions {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #e3f2fd;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.instructions h3 {
    margin-top: 0;
    color: #2c3e50;
}

.instructions ol {
    padding-left: 1.5rem;
}

.instructions li {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* Dark Theme */
.wordle-solver-container.dark-theme {
    background: #2c3e50;
    color: #ecf0f1;
}

.dark-theme .section {
    background: #34495e;
    border-color: #4a6278;
    color: #ecf0f1;
}

.dark-theme .correct-letter {
    background: #1a252f;
    color: #ecf0f1;
}

.dark-theme .word-item {
    background: #34495e;
    color: #ecf0f1;
}

.dark-theme .instructions {
    background: #1a252f;
    border-left-color: #3498db;
}

/* Responsive */
@media (max-width: 768px) {
    .solver-grid {
        grid-template-columns: 1fr;
    }
    
    .position-boxes {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .position-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .position-boxes {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .position-stats {
        grid-template-columns: 1fr;
    }
    
    .results-tabs {
        flex-direction: column;
    }
}