/* Word Hunt Solver Styles */
.letter-input-section {
    text-align: center;
    margin: 20px 0;
}

.input-card {
    background: linear-gradient(135deg, #e9ecef 0%, #adb5bd 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.input-card h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.input-card h3 i {
    margin-right: 10px;
}

.quick-input {
    margin: 0 auto;
    max-width: 500px;
}

.quick-input p {
    color: #6c757d;
    margin-bottom: 10px;
}

.input-with-filter {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-input input.main-input {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding: 18px 25px;
    flex: 1;
    border: 3px solid transparent;
    border-radius: 15px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.quick-input input.main-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 5px 25px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.btn-filter-inline {
    background: white;
    color: #495057;
    padding: 12px 20px;
    border: 3px solid #e9ecef;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.btn-filter-inline:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(102, 126, 234, 0.2);
}

.btn-filter-inline i {
    margin: 0 3px;
}


/* Filters Section */
.filters-section {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 20px;
    margin-top: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-item {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
}

.filter-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.filter-item label {
    display: block;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
}

.filter-item label i {
    color: #667eea;
    margin-right: 6px;
}

.filter-item input,
.filter-item select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Word Hunt Grid */
.wordhunt-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    gap: 6px;
    max-width: 100%;
}

.wordhunt-row {
    display: flex;
    gap: 6px;
}

.wordhunt-cell {
    width: 55px;
    height: 55px;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    border: 3px solid #667eea;
    border-radius: 10px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wordhunt-cell:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.wordhunt-cell:hover {
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Responsive sizing for different grid sizes - LARGER on mobile */
@media (max-width: 768px) {
    .wordhunt-grid {
        width: calc(100% - 20px);
        margin: 20px 10px;
        padding: 0 5px;
    }

    .wordhunt-cell {
        width: calc((100vw - 60px) / 4 - 5px);
        height: calc((100vw - 60px) / 4 - 5px);
        max-width: 70px;
        max-height: 70px;
        font-size: 22px;
    }

    .wordhunt-row {
        gap: 5px;
        width: 100%;
        justify-content: center;
    }

    .wordhunt-controls {
        flex-wrap: wrap;
        max-width: 100%;
        margin: 20px auto;
        padding: 0 10px;
    }

    .btn-wordhunt {
        flex: 1 1 48%;
        min-width: 140px;
        padding: 18px 24px;
        font-size: 17px;
        margin: 5px;
    }
}

@media (max-width: 600px) {
    .wordhunt-grid {
        width: calc(100% - 16px);
        margin: 15px 8px;
    }

    .wordhunt-cell {
        width: calc((100vw - 50px) / 4 - 4px);
        height: calc((100vw - 50px) / 4 - 4px);
        max-width: 65px;
        max-height: 65px;
        font-size: 20px;
        border-width: 2px;
    }

    .wordhunt-row {
        gap: 4px;
    }

    .btn-wordhunt {
        flex: 1 1 48%;
        padding: 20px 24px;
        font-size: 18px;
        margin: 6px;
    }
}

@media (max-width: 480px) {
    .wordhunt-grid {
        width: calc(100% - 12px);
        margin: 15px 6px;
    }

    .wordhunt-cell {
        width: calc((100vw - 40px) / 4 - 3px);
        height: calc((100vw - 40px) / 4 - 3px);
        max-width: 60px;
        max-height: 60px;
        font-size: 18px;
        border-width: 2px;
    }

    .wordhunt-row {
        gap: 3px;
    }

    .btn-wordhunt {
        flex: 1 1 48%;
        padding: 22px 20px;
        font-size: 18px;
        font-weight: 600;
    }
}

@media (max-width: 400px) {
    .wordhunt-grid {
        width: calc(100% - 8px);
        margin: 10px 4px;
    }

    .wordhunt-cell {
        width: calc((100vw - 32px) / 4 - 2px);
        height: calc((100vw - 32px) / 4 - 2px);
        max-width: 55px;
        max-height: 55px;
        font-size: 16px;
        border-width: 2px;
    }

    .wordhunt-row {
        gap: 2px;
    }

    .btn-wordhunt {
        flex: 1 1 48%;
        padding: 20px 18px;
        font-size: 17px;
        font-weight: 600;
    }
}

/* Special sizing for larger grids on mobile - viewport based */
@media (max-width: 768px) {
    .wordhunt-grid[data-size="5"] .wordhunt-cell {
        width: calc((100vw - 60px) / 5 - 5px);
        height: calc((100vw - 60px) / 5 - 5px);
        max-width: 55px;
        max-height: 55px;
        font-size: 20px;
    }

    .wordhunt-grid[data-size="6"] .wordhunt-cell {
        width: calc((100vw - 60px) / 6 - 5px);
        height: calc((100vw - 60px) / 6 - 5px);
        max-width: 48px;
        max-height: 48px;
        font-size: 18px;
    }

    .wordhunt-grid[data-size="7"] .wordhunt-cell {
        width: calc((100vw - 60px) / 7 - 5px);
        height: calc((100vw - 60px) / 7 - 5px);
        max-width: 44px;
        max-height: 44px;
        font-size: 16px;
    }
}

@media (max-width: 600px) {
    .wordhunt-grid[data-size="5"] .wordhunt-cell {
        width: calc((100vw - 50px) / 5 - 4px);
        height: calc((100vw - 50px) / 5 - 4px);
        max-width: 52px;
        max-height: 52px;
        font-size: 18px;
    }

    .wordhunt-grid[data-size="6"] .wordhunt-cell {
        width: calc((100vw - 50px) / 6 - 4px);
        height: calc((100vw - 50px) / 6 - 4px);
        max-width: 45px;
        max-height: 45px;
        font-size: 16px;
    }

    .wordhunt-grid[data-size="7"] .wordhunt-cell {
        width: calc((100vw - 50px) / 7 - 4px);
        height: calc((100vw - 50px) / 7 - 4px);
        max-width: 40px;
        max-height: 40px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .wordhunt-grid[data-size="5"] .wordhunt-cell {
        width: calc((100vw - 40px) / 5 - 3px);
        height: calc((100vw - 40px) / 5 - 3px);
        max-width: 48px;
        max-height: 48px;
        font-size: 16px;
    }

    .wordhunt-grid[data-size="6"] .wordhunt-cell {
        width: calc((100vw - 40px) / 6 - 3px);
        height: calc((100vw - 40px) / 6 - 3px);
        max-width: 42px;
        max-height: 42px;
        font-size: 15px;
    }

    .wordhunt-grid[data-size="7"] .wordhunt-cell {
        width: calc((100vw - 40px) / 7 - 3px);
        height: calc((100vw - 40px) / 7 - 3px);
        max-width: 38px;
        max-height: 38px;
        font-size: 13px;
    }
}

@media (max-width: 400px) {
    .wordhunt-grid[data-size="5"] .wordhunt-cell {
        width: calc((100vw - 32px) / 5 - 2px);
        height: calc((100vw - 32px) / 5 - 2px);
        max-width: 44px;
        max-height: 44px;
        font-size: 15px;
    }

    .wordhunt-grid[data-size="6"] .wordhunt-cell {
        width: calc((100vw - 32px) / 6 - 2px);
        height: calc((100vw - 32px) / 6 - 2px);
        max-width: 38px;
        max-height: 38px;
        font-size: 14px;
    }

    .wordhunt-grid[data-size="7"] .wordhunt-cell {
        width: calc((100vw - 32px) / 7 - 2px);
        height: calc((100vw - 32px) / 7 - 2px);
        max-width: 34px;
        max-height: 34px;
        font-size: 12px;
    }
}

/* Control Buttons */
.wordhunt-controls {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-wordhunt {
    padding: 14px 30px;
    font-size: 16px;
    border-radius: 30px;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 140px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-wordhunt i {
    margin-right: 8px;
}

.btn-wordhunt:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.btn-find {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    padding: 16px 40px;
}

.btn-find:hover {
    background: linear-gradient(135deg, #5568d8 0%, #6a4290 100%);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-clear {
    background: #dc3545;
    color: white;
}

.btn-clear:hover {
    background: #c82333;
}

.btn-random {
    background: #28a745;
    color: white;
}

.btn-random:hover {
    background: #218838;
}





/* Jump Navigation */
.jump-to-nav {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* Inline Jump Navigation (after controls) */
.jump-to-nav-inline {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.jump-to-nav-inline h4 {
    color: #495057;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.jump-to-nav-inline h4 i {
    color: #667eea;
    margin-right: 6px;
}

.jump-to-nav h4 {
    color: #495057;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.jump-to-nav h4 i {
    color: #667eea;
    margin-right: 8px;
}

.jump-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.jump-btn {
    background: white;
    color: #495057;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.jump-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

/* Results Display */
.results-stats {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 30px;
    border-radius: 20px;
    margin: 30px 0;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.results-stats h3 {
    color: #495057;
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
}

.results-stats h3 i {
    color: #667eea;
    margin-right: 10px;
}

.results-stats .row {
    margin-top: 20px;
}

.results-stats .col-xs-3 {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.results-stats .col-xs-3:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.results-stats h4 {
    color: #667eea;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.results-stats p {
    color: #6c757d;
    margin: 10px 0 0 0;
    font-weight: 500;
}

.word-length-group {
    margin: 25px 0;
    background: white;
    border: none;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.word-length-group:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.word-length-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.word-length-header h3 {
    color: #495057;
    font-weight: 600;
    margin: 0;
}

.word-length-header h3 i {
    color: #667eea;
    margin-right: 10px;
}

.badge-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    overflow: hidden;
}

.word-item {
    background: linear-gradient(135deg, #f6f8fa 0%, #e9ecef 100%);
    padding: 12px 18px;
    border-radius: 25px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-decoration: none;
    color: #495057;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    word-break: break-word;
}

a.word-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    white-space: normal;
    z-index: 10;
    position: relative;
}


/* Example Letters */
.example-letters {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.example-letters h5 {
    font-family: monospace;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 3px;
    margin: 0;
    color: #0366d6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .filter-item {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .quick-input {
        max-width: 100%;
    }
    
    .quick-input input {
        font-size: 18px;
        letter-spacing: 2px;
        padding: 12px;
    }
    
    .example-letters h5 {
        font-size: 16px;
        letter-spacing: 2px;
    }
    
    .btn-wordhunt {
        min-width: auto;
        padding: 6px 8px;
        font-size: 10px;
        flex: 1;
    }
    
    /* Show icons only for Clear and Random on mobile */
    .btn-find {
        font-size: 11px;
    }
    
    .btn-clear .btn-text,
    .btn-random .btn-text {
        display: none;
    }
    
    .btn-clear i,
    .btn-random i {
        display: inline;
        margin: 0;
    }
    
    .wordhunt-controls {
        gap: 3px;
        display: flex;
        justify-content: space-between;
    }
    
    .word-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 5px;
    }
    
    .word-item {
        padding: 8px 10px;
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    
    .jump-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .jump-to-nav h4 {
        font-size: 16px;
    }
    
    /* Stats on mobile - single column */
    .results-stats .col-xs-12 {
        margin-bottom: 15px;
        padding: 10px;
        background: white;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    .results-stats h4 {
        font-size: 28px;
        margin: 0;
    }
    
    .results-stats p {
        font-size: 14px;
        margin: 5px 0 0 0;
    }
    
    /* Reduce padding on input card on mobile */
    .input-card {
        padding: 15px;
    }
    
    .input-card h3 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    /* Inline filter button on mobile */
    .input-with-filter {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-filter-inline {
        width: 100%;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .filter-text {
        display: inline;
    }
    
    @media (max-width: 360px) {
        .filter-text {
            display: none;
        }
    }
}

/* Loading Animation */
.loading-spinner {
    display: none;
    text-align: center;
    margin: 30px 0;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.loading-spinner p {
    margin-top: 15px;
    color: #667eea;
    font-weight: 600;
    font-size: 18px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Word Length Specific Styles */
.word-length-group[id*="words-10"] .word-list,
.word-length-group[id*="words-11"] .word-list,
.word-length-group[id*="words-12"] .word-list,
.word-length-group[id*="words-13"] .word-list,
.word-length-group[id*="words-14"] .word-list,
.word-length-group[id*="words-15"] .word-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.word-length-group[id*="words-7"] .word-list,
.word-length-group[id*="words-8"] .word-list,
.word-length-group[id*="words-9"] .word-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* Additional Styling */
.light-box {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.light-box h2 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 20px;
}

.light-box h3 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 15px;
}

.light-box.featured {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.word-length-group {
    animation: fadeInUp 0.5s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .results-stats .col-xs-3 {
        width: calc(50% - 10px);
        display: inline-block;
    }
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    z-index: 1000;
}

.tutorial-content {
    background: white;
    max-width: 600px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 10px;
    position: relative;
}

.tutorial-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.tutorial-close:hover {
    color: #000;
}