/* ============================================
   Blog Page Styles - Mergen.ai
   ============================================ */

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #8B5CF6, #06B6D4);
    --secondary-gradient: linear-gradient(135deg, #f0a500, #ff8c00);
    --dark-bg: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 12px;
    background: #09142f;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.3);
}

.nav-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.brand-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.back-link:hover {
    color: var(--text-primary);
    border-color: #8B5CF6;
    background: var(--card-bg);
}

/* ============================================
   Blog Hero Section
   ============================================ */
.blog-hero {
    padding: 140px 20px 60px;
    text-align: center;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.1) 0%, transparent 100%);
}

.blog-title {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: -0.02em;
}

.blog-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Category Filter
   ============================================ */
.category-filter {
    padding: 30px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 80px;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.filter-tab:hover {
    color: var(--text-primary);
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.1);
}

.filter-tab.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.3);
}

/* ============================================
   Blog Posts Grid
   ============================================ */
.blog-posts {
    padding: 60px 20px 100px;
    min-height: 50vh;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.post-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
}

.post-card:hover {
    transform: translateY(-10px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.2);
}

.post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-image::after {
    content: '📝';
    font-size: 3rem;
    opacity: 0.5;
}

.post-content {
    padding: 25px;
}

.post-category {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 20px;
    margin-bottom: 15px;
}

.post-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ============================================
   Article Modal
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: #0f0f0f;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: sticky;
    top: 20px;
    float: right;
    margin: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8B5CF6;
    transform: rotate(90deg);
}

/* ============================================
   Article Content
   ============================================ */
.article-full {
    padding: 40px 50px;
    padding-top: 0;
}

.article-full h2 {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    line-height: 1.3;
}

.article-full .article-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.article-full h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 30px 0 15px;
}

.article-full p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.article-full ul {
    margin: 20px 0;
    padding-left: 25px;
}

.article-full li {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 10px;
}

.article-full li::marker {
    color: #8B5CF6;
}

/* ============================================
   Comments Section
   ============================================ */
.comments-section {
    padding: 40px 50px;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 25px;
}

.comments-list {
    margin-bottom: 30px;
}

.comment {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.comment:hover {
    border-color: rgba(139, 92, 246, 0.3);
}

.comment.own-comment {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.comment-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.comment-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.no-comments,
.loading-comments,
.error-comments {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.error-comments {
    color: #ef4444;
}

/* ============================================
   Comment Form
   ============================================ */
.comment-form h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.comment-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    resize: vertical;
    transition: all 0.3s ease;
}

.comment-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.comment-form textarea:focus {
    outline: none;
    border-color: #8B5CF6;
    background: rgba(255, 255, 255, 0.05);
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.char-counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.char-counter.warning {
    color: #f59e0b;
}

.submit-btn {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.3);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .nav-container {
        padding: 15px 20px;
    }

    .nav-logo {
        width: 35px;
        height: 35px;
    }

    .brand-text {
        font-size: 1.2rem;
    }

    .back-link {
        padding: 8px 16px;
        font-size: 14px;
    }

    .blog-hero {
        padding: 120px 20px 40px;
    }

    .blog-title {
        font-size: 2.5rem;
    }

    .blog-subtitle {
        font-size: 1rem;
    }

    .category-filter {
        top: 70px;
        padding: 20px;
    }

    .filter-tabs {
        gap: 8px;
    }

    .filter-tab {
        padding: 10px 18px;
        font-size: 13px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .post-content {
        padding: 20px;
    }

    .post-title {
        font-size: 1.2rem;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 16px;
    }

    .article-full {
        padding: 30px 25px;
    }

    .article-full h2 {
        font-size: 1.6rem;
    }

    .article-full h3 {
        font-size: 1.2rem;
    }

    .article-full p,
    .article-full li {
        font-size: 0.95rem;
    }

    .comments-section {
        padding: 30px 25px;
    }

    .modal-close {
        width: 38px;
        height: 38px;
        margin: 15px;
    }

    .form-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .submit-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .blog-title {
        font-size: 2rem;
    }

    .filter-tab {
        padding: 8px 14px;
        font-size: 12px;
    }

    .post-image {
        height: 160px;
    }

    .article-full {
        padding: 25px 20px;
    }

    .comments-section {
        padding: 25px 20px;
    }
}
