/* styles.css */
/* Anagrammeur - Styles CSS */

.anagrammeur-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.anagrammeur-header {
    text-align: center;
    margin-bottom: 30px;
}

.anagrammeur-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.2em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.anagrammeur-header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

.error-message {
    background-color: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.anagrammeur-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border-top: 4px solid #667eea;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.input-wrapper {
    position: relative;
}

#letters-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e8f4fd;
    border-radius: 8px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

#letters-input:focus {
    outline: none;
    border-color: #667eea;
}

.char-counter {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 14px;
    color: #666;
    background: white;
    padding: 0 5px;
}

.filters-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.filters-section h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-item label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
}

.filter-item input,
.filter-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

.search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-top: 4px solid #667eea;
}

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

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

.results-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-top: 4px solid #667eea;
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 15px;
}

.results-info {
    font-weight: 600;
    color: #495057;
    font-size: 16px;
}

.sort-controls {
    display: flex;
    gap: 10px;
}

.sort-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sort-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.sort-btn.active {
    background: #667eea;
}

.results-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.result-item:hover {
    background: #e3f2fd;
    border-color: #667eea;
    transform: translateX(5px);
}

.word {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.details {
    display: flex;
    gap: 15px;
    align-items: center;
}

.score {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.length {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.remaining {
    background: #ffc107;
    color: #212529;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .anagrammeur-container {
        padding: 15px;
    }
    
    .anagrammeur-form {
        padding: 20px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sort-controls {
        width: 100%;
        justify-content: center;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .details {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .search-btn {
        font-size: 16px;
        padding: 14px 30px;
    }
}

@media (max-width: 480px) {
    .anagrammeur-header h2 {
        font-size: 1.8em;
    }
    
    .details {
        gap: 8px;
    }
    
    .score, .length, .remaining {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .word {
        font-size: 16px;
    }
}