/* ===== BLOG PAGE & SINGLE POST STYLES ===== */
/* Professional, responsive, with animations and dark/light mode support */

:root {
    --text-secondary: #aaa;
    --card-bg-dark: rgba(0, 0, 0, 0.3);
    --card-bg-light: rgba(245, 245, 250, 0.8);
    --border-glow: #0ff;
    --border-glow-light: #0066ff;
}

body.light {
    --text-secondary: #555;
    --border-glow: #0066ff;
}

/* Blog Container */
.blog-container {
    max-width: 1200px;
    margin: 100px auto;
    padding: 0 30px;
    position: relative;
    z-index: 2;
    overflow-x: visible;
}

.blog-header {
    margin-bottom: 50px;
    text-align: center;
}

.blog-header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.blog-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 10px;
}

.header-line {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #0f0, #0ff);
    margin: 20px auto 0;
    animation: expandWidth 1.5s ease forwards;
}

@keyframes expandWidth {
    from { width: 0; opacity: 0; }
    to { width: 80px; opacity: 1; }
}

/* Category Filters */
.category-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--border-glow);
    color: var(--border-glow);
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--border-glow);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

body.light .filter-btn.active {
    color: #fff;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

/* Blog Card */
.blog-card {
    background: var(--card-bg-dark);
    backdrop-filter: blur(10px);
    border: 2px solid #0ff;
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s;
    animation: borderPulse 4s infinite;
    position: relative;
    overflow: hidden;
}

body.light .blog-card {
    background: var(--card-bg-light);
}

@keyframes borderPulse {
    0% { border-color: #0ff; box-shadow: 0 0 10px rgba(0,255,255,0.2); }
    50% { border-color: #f0f; box-shadow: 0 0 20px rgba(255,0,255,0.3); }
    100% { border-color: #0ff; box-shadow: 0 0 10px rgba(0,255,255,0.2); }
}

body.light .blog-card {
    animation: borderPulseLight 4s infinite;
}

@keyframes borderPulseLight {
    0% { border-color: #0066ff; box-shadow: 0 0 10px rgba(0,102,255,0.2); }
    50% { border-color: #ff00ff; box-shadow: 0 0 20px rgba(255,0,255,0.2); }
    100% { border-color: #0066ff; box-shadow: 0 0 10px rgba(0,102,255,0.2); }
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.05), transparent);
    transition: left 0.5s ease;
}

.blog-card:hover::before {
    left: 100%;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 255, 255, 0.25);
}

/* Blog Image */
.blog-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 18px;
    transition: transform 0.3s;
}

.blog-card:hover .blog-image {
    transform: scale(1.02);
}

/* Blog Meta */
.blog-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    color: #888;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.blog-meta i {
    margin-right: 5px;
}

.category-badge {
    background: rgba(0, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: 20px;
    color: #0ff;
    font-size: 0.75rem;
    font-weight: 500;
}

body.light .category-badge {
    background: rgba(0, 102, 255, 0.1);
    color: #0066ff;
}

/* Blog Title */
.blog-card h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.blog-card h2 a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.blog-card h2 a:hover {
    color: #0ff;
}

body.light .blog-card h2 a {
    color: #1a1a1a;
}

body.light .blog-card h2 a:hover {
    color: #0066ff;
}

/* Blog Excerpt */
.blog-excerpt {
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

body.light .blog-excerpt {
    color: #2a2a2a;
}

/* Read More Button */
.read-more {
    color: #0ff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.9rem;
}

.read-more:hover {
    gap: 12px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

body.light .read-more {
    color: #0066ff;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: #0ff;
    font-size: 1.2rem;
    grid-column: 1/-1;
}

.loading-spinner::before {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0,255,255,0.3);
    border-top-color: #0ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 12px;
}

body.light .loading-spinner {
    color: #0066ff;
}

body.light .loading-spinner::before {
    border-color: rgba(0,102,255,0.3);
    border-top-color: #0066ff;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    border: 2px dashed rgba(0, 255, 255, 0.3);
    border-radius: 20px;
    grid-column: 1/-1;
}

.empty-state i {
    font-size: 4rem;
    color: rgba(0, 255, 255, 0.3);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #0ff;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    color: #888;
}

body.light .empty-state {
    border-color: rgba(0, 102, 255, 0.3);
}

body.light .empty-state i {
    color: rgba(0, 102, 255, 0.3);
}

body.light .empty-state h3 {
    color: #0066ff;
}

/* ===== SINGLE POST STYLES ===== */
.post-container {
    max-width: 900px;
    margin: 100px auto;
    padding: 0 30px;
    position: relative;
    z-index: 2;
}

.back-link {
    color: #0ff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    transition: gap 0.3s;
    font-weight: 500;
}

.back-link:hover {
    gap: 12px;
    text-decoration: underline;
}

body.light .back-link {
    color: #0066ff;
}

.post-card {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid #0ff;
    border-radius: 20px;
    padding: 50px;
    animation: borderPulse 4s infinite;
}

body.light .post-card {
    background: rgba(255, 255, 255, 0.7);
}

.post-header h1 {
    font-size: 2.5rem;
    color: #0ff;
    margin-bottom: 20px;
    line-height: 1.3;
}

.post-meta {
    color: #888;
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.post-content {
    line-height: 1.8;
    color: #ccc;
}

.post-content h2 {
    color: #0ff;
    font-size: 1.8rem;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

.post-content h3 {
    color: #0ff;
    font-size: 1.3rem;
    margin: 30px 0 15px;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content ul, .post-content ol {
    margin: 15px 0 20px 25px;
}

.post-content li {
    margin: 8px 0;
}

.post-content code {
    background: rgba(0, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #0ff;
}

.cli {
    background: #0a0a0a;
    border: 1px solid #0ff;
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
    overflow-x: auto;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
}

.cli pre {
    margin: 0;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.note-box {
    background: rgba(0, 255, 255, 0.1);
    border-left: 4px solid #0ff;
    padding: 20px;
    margin: 30px 0;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.note-box i {
    color: #0ff;
    font-size: 1.2rem;
    margin-top: 2px;
}

.note-box strong {
    color: #0ff;
}

body.light .post-content {
    color: #2a2a2a;
}

body.light .post-content h2,
body.light .post-content h3 {
    color: #0066ff;
}

body.light .cli {
    background: #1a1a1a;
}

/* Reading Progress Bar */
#reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #0ff, #f0f);
    z-index: 10000;
    transition: width 0.1s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-container, .post-container {
        margin: 60px auto;
        padding: 0 20px;
    }
    
    .blog-header h1 {
        font-size: 2.2rem;
    }
    
    .blog-subtitle {
        font-size: 1rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-filters {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 6px 15px;
        font-size: 0.8rem;
    }
    
    .post-card {
        padding: 25px;
    }
    
    .post-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .blog-header h1 {
        font-size: 1.8rem;
    }
    
    .blog-card, .post-card {
        padding: 20px;
    }
    
    .blog-card h2 {
        font-size: 1.2rem;
    }
    
    .blog-excerpt {
        font-size: 0.85rem;
    }
    
    .post-header h1 {
        font-size: 1.5rem;
    }
    
    .cli pre {
        font-size: 0.75rem;
    }
}

/* Extra small screens (<= 360px) */
@media (max-width: 360px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    .blog-card {
        padding: 15px;
    }
}