/* Letter Quest Solver - Consistent Theme Styling */

:root {
    --primary-color: #fa5c5c;
    --secondary-color: #e74c3c;
    --accent-color: #ff6b6b;
    --dark-color: #2c3e50;
    --light-gray: #f8f9fa;
    --border-color: #e9ecef;
    --text-gray: #6c757d;
    --success-color: #27ae60;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
}

body {
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    color: var(--dark-color);
}

/* Main Container */
.solver-container {
    min-height: calc(100vh - 60px);
    padding-top: 60px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Header Section */
.solver-header {
    background: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0 1rem;
}

.solver-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.solver-header .lead {
    color: var(--text-gray);
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* Stats Cards */
.solver-stats {
    margin-top: 1.5rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 0 0.5rem;
    min-width: 100px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: 500;
    margin: 0;
}

/* Solver Card */
.solver-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: none;
    overflow: hidden;
    margin-top: 2rem;
}

.solver-card .card-header {
    background: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 0;
}

.solver-card .card-header h3 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.solver-card .card-body {
    padding: 2rem;
}

/* Input Section */
.input-section .form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

.input-section .form-control {
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.input-section .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-section .btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 0.75rem;
    font-weight: 600;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
}

.input-section .btn-primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Board Preview */
.board-preview {
    text-align: center;
}

.board-preview h5 {
    color: var(--dark-color);
    font-weight: 600;
}

.boggle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    max-width: 300px;
    margin: 0 auto;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 1rem;
    border: 2px solid var(--border-color);
}

.grid-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    transition: all 0.3s ease;
    min-height: 50px;
}

.grid-cell.filled {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Quick Actions */
.quick-actions h6 {
    color: var(--dark-color);
    font-weight: 600;
}

.quick-actions .btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.quick-actions .btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-gray);
}

.quick-actions .btn-outline-secondary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-top: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h3 {
    color: var(--dark-color);
    font-weight: 600;
    margin: 0;
}

.results-controls .btn-check:checked + .btn-outline-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.results-controls .btn-outline-primary {
    border-radius: 0.5rem;
    font-weight: 500;
}

/* Loading State */
#loadingState {
    color: var(--text-gray);
}

#loadingState .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Words Grid */
.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.word-card {
    background: var(--light-gray);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.word-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.word-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.word-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-gray);
}

.word-length {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.75rem;
}

.word-score {
    font-weight: 600;
    color: var(--accent-color);
}

/* Word Length Categories */
.word-card.length-3 { border-left: 4px solid #10b981; }
.word-card.length-4 { border-left: 4px solid #3b82f6; }
.word-card.length-5 { border-left: 4px solid #8b5cf6; }
.word-card.length-6 { border-left: 4px solid #f59e0b; }
.word-card.length-7 { border-left: 4px solid #ef4444; }
.word-card.length-8-plus { border-left: 4px solid #ec4899; }

/* Responsive Design */
@media (max-width: 768px) {
    .solver-header h1 {
        font-size: 2rem;
    }
    
    .solver-stats .row {
        justify-content: center;
    }
    
    .stat-card {
        margin-bottom: 1rem;
        min-width: 100px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .solver-card .card-body {
        padding: 1.5rem;
    }
    
    .boggle-grid {
        max-width: 250px;
        gap: 0.25rem;
    }
    
    .grid-cell {
        font-size: 1.2rem;
        min-height: 40px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .words-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .word-card {
        padding: 0.75rem;
    }
    
    .word-text {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control {
        border-radius: 0.75rem !important;
        margin-bottom: 0.5rem;
    }
    
    .input-group .btn {
        border-radius: 0.75rem !important;
    }
    
    .quick-actions .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .quick-actions .btn {
        width: 100%;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Error States */
.form-control.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Success States */
.form-control.is-valid {
    border-color: var(--success-color);
}

.valid-feedback {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}