/* ==============================================
   Blog Specific Styles
   ============================================== */

/* Blog Container */
.blog-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

/* Blog List */
.blog-list {
    margin-top: 2rem;
}


/* Blog Post Content */
.blog-content {
    line-height: 1.8;
}

.blog-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: center;
}

.blog-content h2 {
    font-size: 2rem;
    color: var(--text-secondary);
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.blog-content h3 {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 1.5rem 0 1rem 0;
}

.blog-content p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    text-align: justify;
}

.blog-content ul,
.blog-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.blog-content blockquote {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--accent-blue);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-radius: 0 var(--radius-small) var(--radius-small) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.blog-content code {
    background: rgba(51, 65, 85, 0.8);
    color: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.blog-content pre {
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 1rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.blog-content pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
}

/* Code Example Container */
.code-example {
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    background: rgba(51, 65, 85, 0.5);
    overflow: hidden;
}

.code-header {
    background: rgba(51, 65, 85, 0.8);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #94a3b8;
}

.code-header span:first-child {
    font-weight: 500;
}

.copy-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.2s ease;
    line-height: 1;
}

.copy-btn:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

.code-example pre {
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

/* Syntax highlighting tokens */
.token.keyword { color: #c792ea; }
.token.function { color: #82aaff; }
.token.punctuation { color: #89ddff; }
.token.parameter { color: #ffcb6b; }
.token.string { color: #c3e88d; }
.token.property { color: #ffcb6b; }
.token.selector { color: #82aaff; }
.token.tag { color: #f07178; }
.token.attr-name { color: #ffcb6b; }
.token.attr-value { color: #c3e88d; }
.token.comment { color: #546e7a; font-style: italic; }
.token.number { color: #f78c6c; }

/* Comments Section */
.comments {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    border-radius: var(--radius-small);
}

.comments h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.comment-form label {
    color: var(--text-secondary);
    font-weight: 500;
}

.comment-form input,
.comment-form textarea {
    padding: 0.75rem;
    background: var(--primary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition-normal);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
    color: var(--text-muted);
}

.comment-form textarea {
    min-height: 100px;
    resize: vertical;
}

.comment-form button {
    width: fit-content;
    padding: 0.75rem 1.5rem;
    background: var(--accent-blue);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-small);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.comment-form button:hover {
    background: var(--accent-purple);
    transform: translateY(-1px);
}

.comment-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.note {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Comments Display */
.comments-list {
    margin-top: 2rem;
}

.comment-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.comment-author {
    font-weight: 600;
    color: var(--accent-blue);
}

.comment-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.comment-content {
    color: var(--text-light);
    line-height: 1.6;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ""; }
    40% { content: "."; }
    60% { content: ".."; }
    80%, 100% { content: "..."; }
}

/* Error state */
.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-small);
    padding: 1rem;
    color: #fca5a5;
    text-align: center;
    margin: 1rem 0;
}

/* Success state */
.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-small);
    padding: 1rem;
    color: #86efac;
    text-align: center;
    margin: 1rem 0;
}


/* Responsive Design for Blog */
@media (max-width: 768px) {
    .blog-container {
        padding: 80px 15px 40px;
    }
    
    .blog-content h1 {
        font-size: 2rem;
    }
    
    .blog-content h2 {
        font-size: 1.5rem;
    }
    
    .comments {
        padding: 1.5rem;
        margin-left: -5px;
        margin-right: -5px;
    }
    
    .comment-form {
        gap: 0.75rem;
    }
    
}

/* Article-specific styles (for individual blog posts) */
.article-header {
    padding: 3rem 0 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    margin-bottom: 3rem;
}

.article-category {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-blue);
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.article-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Special content boxes */
.highlight-box {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-medium);
    padding: 1.5rem;
    margin: 2rem 0;
}

.highlight-box h4 {
    color: var(--accent-green);
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-medium);
    padding: 1.5rem;
    margin: 2rem 0;
}

.warning-box h4 {
    color: var(--accent-orange);
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.code-block {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 1rem;
    margin: 1.5rem 0;
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
    font-size: 0.9rem;
    overflow-x: auto;
}

.checklist {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    padding: 2rem;
    margin: 2rem 0;
}

.checklist h4 {
    color: var(--accent-blue);
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.checklist-item::before {
    content: "✅";
    font-size: 1.1rem;
    margin-top: 2px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-blue);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stats-grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Related articles */
.related-articles {
    background: rgba(30, 41, 59, 0.3);
    border-radius: var(--radius-medium);
    padding: 2rem;
    margin-top: 3rem;
}

.related-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.related-card {
    background: rgba(51, 65, 85, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 1.5rem;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.related-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.related-card h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.related-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

@media (max-width: 480px) {
    .blog-content h1 {
        font-size: 1.75rem;
    }
    
    .blog-content p {
        text-align: left;
    }
    
    .comment-item {
        padding: 1rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}