/* Word Nut Answers Solver Styles */

/* Input Card Section */
.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;
}

/* Main container */
.wordnut-controls {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.btn-wordnut {
    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;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-wordnut i {
    margin-right: 8px;
}

.btn-wordnut: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;
}

/* Input styles */
.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);
}

.main-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 5px 25px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

/* Filter button */
.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;
}

/* Loading spinner */
.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); }
}


/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 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-fit, minmax(200px, max-content));
}

.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-fit, minmax(160px, max-content));
}

/* 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%);
}

/* Example cards */
.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;
}

/* Results stats */
.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,
.results-stats .col-xs-12 {
    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;
    text-align: center;
}

.results-stats .col-xs-3:hover,
.results-stats .col-xs-12: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 groups */
.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;
    animation: fadeInUp 0.5s 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-fit, minmax(120px, max-content));
    gap: 10px;
    justify-content: center;
}

.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;
    min-width: 80px;
    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;
    z-index: 10;
    position: relative;
}

/* 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);
}

/* Navigation header with sort buttons */
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.sort-buttons {
    display: flex;
    gap: 8px;
}

.sort-btn {
    background: white;
    color: #495057;
    padding: 6px 12px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    white-space: nowrap;
}

.sort-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

.sort-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.sort-btn i {
    margin-right: 4px;
}

/* 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;
    font-size: 16px;
    font-weight: 600;
}

.jump-to-nav-inline h4 i {
    color: #667eea;
    margin-right: 6px;
}

.jump-to-nav-inline .nav-header {
    margin-bottom: 10px;
}

.jump-to-nav h4 {
    color: #495057;
    margin: 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;
}

/* Filter 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: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.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;
}

.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);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .filter-row {
        gap: 10px;
    }
    
    .filter-item {
        padding: 12px;
    }
    
    .filter-item label {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .filter-item input,
    .filter-item select {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* Keep buttons in a row on mobile */
    .wordnut-controls {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 5px;
    }
    
    .btn-wordnut {
        min-width: auto;
        padding: 12px 15px;
        font-size: 14px;
        flex: 1;
    }
    
    .word-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .results-stats .col-xs-3 {
        width: calc(50% - 10px);
        display: inline-block;
    }
}

/* Quick solver buttons */
.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: white;
    border-radius: 20px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-outline-success {
    border: 2px solid #28a745;
    color: #28a745;
    background: white;
    border-radius: 20px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-outline-success:hover {
    background: #28a745;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-outline-danger {
    border: 2px solid #dc3545;
    color: #dc3545;
    background: white;
    border-radius: 20px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-outline-danger:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

/* Input wrapper */
.input-with-filter {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-input {
    margin: 0 auto;
    max-width: 500px;
}

.quick-input p {
    color: #6c757d;
    margin-bottom: 10px;
}

/* Hide button text on mobile */
@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;
    }
    
    /* Buttons on mobile */
    .wordnut-controls {
        gap: 4px;
        display: flex;
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    
    .btn-wordnut {
        min-width: auto;
        padding: 10px 8px;
        font-size: 12px;
        flex: 1;
    }
    
    /* Show icons only for Clear and Random on mobile */
    .btn-find {
        font-size: 13px;
        padding: 12px 15px;
    }
    
    .btn-clear .btn-text,
    .btn-random .btn-text {
        display: none;
    }
    
    .btn-clear i,
    .btn-random i {
        display: inline;
        margin: 0;
    }
    
    .word-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 5px;
    }
    
    .word-item {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 70px;
    }
    
    .jump-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .jump-to-nav h4 {
        font-size: 16px;
    }
    
    /* Sort buttons on mobile */
    .sort-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .nav-header {
        justify-content: center;
        text-align: center;
    }
    
    /* 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;
        }
        
        /* Even smaller screens - keep buttons horizontal */
        .wordnut-controls {
            gap: 3px;
        }
        
        .btn-wordnut {
            padding: 8px 5px;
            font-size: 11px;
        }
        
        .btn-find {
            font-size: 12px;
        }
    }
}

@media (max-width: 576px) {
    .wordnut-controls {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
    
    .btn-wordnut {
        width: auto !important;
        flex: 1;
    }
}

/* Chapters Section */
.chapter-search {
    margin: 20px 0 30px 0;
    max-width: 500px;
}

.chapter-search input {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.chapter-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.chapter-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    display: block;
}

.chapter-card:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

.chapter-number {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.chapter-levels {
    font-size: 14px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.chapter-count {
    font-size: 13px;
    opacity: 0.8;
}

.chapter-card:hover .chapter-levels,
.chapter-card:hover .chapter-count {
    opacity: 1;
    color: white;
}

@media (max-width: 768px) {
    .chapters-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .chapter-card {
        padding: 20px;
    }
    
    .chapter-number {
        font-size: 18px;
    }
}