/* Explore Page Styles */

.explore-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

.explore-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.explore-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.explore-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0;
}

.view-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.5rem;
}

.view-tab {
    flex: 1;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.view-tab:hover {
    color: var(--text-main);
    background: var(--bg-surface-hover);
}

.view-tab.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.category-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-border);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.category-icon {
    font-size: 2.5rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.category-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.category-count {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.alphabet-letter {
    padding: 0.625rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    min-width: 45px;
    text-align: center;
}

.alphabet-letter:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.alphabet-letter.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    width: 100%;
    overflow: hidden;
}

.words-grid > * {
    min-width: 0;
    max-width: 100%;
}

.word-chip {
    padding: 0.625rem 0.75rem;
    background: white;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    text-align: center;
    max-width: 100%;
    width: 100%;
    white-space: normal;
    line-height: 1.4;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    min-width: 0;
    contain: layout style;
}

.word-chip-text {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: block;
    hyphens: auto;
    overflow: hidden;
    line-height: 1.3;
    box-sizing: border-box;
    /* Force breaking for very long words */
    overflow-wrap: break-word;
    word-break: break-all;
}

/* Adjust font size for very long words */
.word-chip[style*="color"] .word-chip-text {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

/* Ensure no overflow on any screen size */
@media (max-width: 768px) {
    .word-chip {
        font-size: 0.8125rem;
        padding: 0.5rem 0.625rem;
    }
    
    .word-chip-text {
        font-size: 0.8125rem;
    }
}

.word-chip:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.popular-word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.popular-word-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-primary);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.popular-word-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.popular-word-item:hover::before {
    transform: scaleY(1);
}

.popular-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 60px;
    text-align: center;
}

.popular-word-text {
    flex: 1;
    margin-left: 1rem;
}

.popular-word-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.popular-count {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.popular-word-item i {
    color: var(--text-light);
    font-size: 1.25rem;
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-outline-primary {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline-primary:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.pagination {
    gap: 0.5rem;
    display: flex;
    align-items: center;
}

.pagination .page-link {
    color: var(--text-main);
    border: 1.5px solid var(--border-light);
    padding: 0.625rem 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    min-width: 42px;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
    text-decoration: none;
}

.pagination .page-link:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pagination .page-item.active .page-link {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-surface-hover);
}

.pagination .page-link i {
    font-size: 0.875rem;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 768px) {
    .explore-header {
        padding: 1.5rem;
    }
    
    .explore-header h1 {
        font-size: 2rem;
    }
    
    .view-tabs {
        flex-direction: column;
    }
    
    .category-card {
        padding: 1.5rem;
    }
    
    .category-header {
        flex-direction: column;
        text-align: center;
    }
    
    .words-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .popular-word-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .popular-rank {
        min-width: auto;
    }
}

