/* Post A-Z Navigator Styles */
.post-navigator {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 50%, rgba(241, 245, 249, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(59, 130, 246, 0.08),
        0 8px 32px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.post-navigator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(59, 130, 246, 0.3) 20%, 
        rgba(59, 130, 246, 0.6) 50%, 
        rgba(59, 130, 246, 0.3) 80%, 
        transparent 100%
    );
}

.alphabet-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

.alphabet-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(59, 130, 246, 0.2) 20%, 
        rgba(59, 130, 246, 0.4) 50%, 
        rgba(59, 130, 246, 0.2) 80%, 
        transparent 100%
    );
    transition: all 0.3s ease;
}

.post-navigator:hover .alphabet-nav::after {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(59, 130, 246, 0.3) 20%, 
        rgba(59, 130, 246, 0.6) 50%, 
        rgba(59, 130, 246, 0.3) 80%, 
        transparent 100%
    );
}

.alphabet-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #64748b;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    animation: buttonFadeIn 0.5s ease-out forwards;
}

@keyframes buttonFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.alphabet-btn:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.3);
}

.alphabet-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

.alphabet-btn.active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    border-color: #059669;
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.4);
    transform: scale(1.1);
    position: relative;
    z-index: 10;
}

.alphabet-btn.active::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #10b981, #059669);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(5, 150, 105, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0);
    }
}

.alphabet-btn.disabled {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.4;
    box-shadow: none;
}

.alphabet-btn.disabled:hover {
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #cbd5e1;
}

.alphabet-btn.all-btn {
    width: auto;
    min-width: 60px;
    padding: 0 16px;
    border-radius: 25px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 14px;
    font-weight: 700;
    grid-column: span 2;
    justify-self: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.alphabet-btn.all-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(5, 150, 105, 0.4);
}

.alphabet-btn.all-btn.active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #047857;
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.5);
    transform: scale(1.05);
}

.posts-container {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.posts-container::-webkit-scrollbar {
    width: 8px;
}

.posts-container::-webkit-scrollbar-track {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 4px;
}

.posts-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 4px;
    border: 2px solid transparent;
}

.posts-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 5px;
    position: relative;
}

.post-link {
    display: block;
    color: #1e40af;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: underline;
}

.post-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.6s ease;
}

.post-link:hover::before {
    left: 100%;
}

.post-link:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.05) 100%);
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
    color: #1e40af;
    /* border:2px solid yellow; */
}

.post-link:active {
    transform: translateY(0);
}

/* Smart highlighting - first letter red for selected character */
.post-link.selected-letter::first-letter {
    color: #dc2626;
    font-weight: 700;
    font-size: 1.1em;
    text-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
}

/* Enhanced highlighting for matched lines */
.post-link.selected-letter {
    border: 2px solid #3b82f6;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    padding: 8px 12px;
    margin: 2px 0;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
}

.post-link.selected-letter:hover {
    border-color: #1d4ed8;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.2) 100%);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.letter-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 50%);
    color: white;
    padding: 4px;
    margin: -20px -20px 16px -20px;
    font-size: 16px;
    font-weight: 700;
    text-align: left;
    border-radius: 10px;
    padding-right: 20px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    width:100%;
    text-align: center;
    position: sticky;
    top:-10px;
    z-index: 20;
}

.no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-style: italic;
}

.loading-posts {
    text-align: center;
    padding: 40px 20px;
    color: #3b82f6;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .alphabet-nav {
        grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
        gap: 6px;
        padding: 16px;
    }
    
    .alphabet-btn {
        width: 35px;
        height: 35px;
        font-size: 13px;
        border-radius: 50%;
    }
    
    .alphabet-btn.all-btn {
        min-width: 50px;
        padding: 0 12px;
        font-size: 12px;
        grid-column: span 2;
    }
    
    .posts-container {
        height: 350px;
        padding: 8px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    
    .post-link {
        padding: 5px 16px;
        font-size: 14px;
    }
    
    .letter-header {
        font-size: 14px;
        padding:4px;
        margin: 0px -16px 12px 0px;
    }
}

@media (max-width: 480px) {
    .alphabet-nav {
        grid-template-columns: repeat(auto-fit, minmax(32px, 1fr));
        gap: 4px;
        padding: 12px;
    }
    
    .alphabet-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .alphabet-btn.all-btn {
        min-width: 45px;
        font-size: 11px;
        grid-column: span 3;
    }
    
    .posts-container {
        height: 300px;
    }
}
