/* Blog Article Styles - SEO Optimized Clean Design */

/* Background for blog pages */
body.blog-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Offset for fixed navigation when jumping to anchors */
[id] {
    scroll-margin-top: 80px;
}

/* Blog Post Header */
.blog-post-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: 140px 0 100px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.blog-post-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(255,255,255,0.1)"><polygon points="0,100 1000,0 1000,100"/></svg>');
    background-size: cover;
    opacity: 0.3;
}

/* Fixed Navigation Bar */
.blog-post-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 18px 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.blog-post-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 25px;
}

.back-link:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.language-switcher {
    display: flex;
    gap: 8px;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px;
    border-radius: 25px;
}

.lang-link {
    padding: 10px 18px;
    border-radius: 20px;
    text-decoration: none;
    color: #667eea;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.lang-link.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.lang-link:hover:not(.active) {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

/* Post Meta Information */
.blog-post-meta {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.post-category {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.post-date {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
    font-weight: 500;
}

.post-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Main Content Area */
.blog-post-content {
    padding: 0;
    background: transparent;
    position: relative;
    z-index: 1;
}

/* Content Container - Floating Card Style */
.blog-article {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    line-height: 1.7;
    color: #2d3748;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 60px 50px;
    border-radius: 25px;
    max-width: 1000px;
    margin: -80px auto 60px auto;
    position: relative;
    z-index: 10;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Headings - Clear Hierarchy for SEO */
.blog-article h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 20px 0;
    color: #1a1a1a;
    border-bottom: 3px solid #667eea;
    padding-bottom: 15px;
}

.blog-article h2 {
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 40px 0 20px 0;
    color: #2d2d2d;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border-left: 4px solid #667eea;
    border-radius: 8px;
}

.blog-article h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 30px 0 15px 0;
    color: #3d3d3d;
}

/* Article Metadata */
.blog-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
    color: #666;
    font-size: 0.95rem;
}

.blog-meta .author {
    font-weight: 500;
}

.blog-meta .date {
    color: #888;
}

.blog-meta .category {
    background: #f0f0f0;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
}

/* Paragraphs and Content */
.blog-article p {
    margin: 0 0 20px 0;
    font-size: 1.05rem;
}

.blog-article .lead {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
    font-weight: 400;
}

/* Lists */
.blog-article ul,
.blog-article ol {
    margin: 0 0 20px 0;
    padding-left: 30px;
    line-height: 1.8;
}

.blog-article li {
    margin-bottom: 12px;
    line-height: 1.8;
}

.blog-article ul li {
    list-style-type: disc;
}

.blog-article ol li {
    list-style-type: decimal;
}

.blog-article li ul,
.blog-article li ol {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Images with Captions */
.blog-article figure {
    margin: 30px 0;
    text-align: center;
}

.blog-article img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.blog-article figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Note/Memo Sections */
.blog-article .note,
.roblox-vscode-tutorial .note,
.tutorial-step .note,
span.note {
    display: block !important;
    background: #f8f9fa;
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 4px;
    font-size: 0.9em;
    color: #718096;
    font-style: italic;
    line-height: 1.6;
}

.blog-article .note strong,
.roblox-vscode-tutorial .note strong {
    color: #856404;
    display: inline;
    margin-right: 5px;
}

/* Code Sections */
.blog-article code {
    font-family: "SF Mono", Monaco, Consolas, "Courier New", monospace;
    font-size: 0.9em;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    color: #d63384;
}

.blog-article pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 25px 0;
}

.blog-article pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 0.95em;
}

/* Blockquotes */
.blog-article blockquote {
    border-left: 4px solid #667eea;
    padding-left: 20px;
    margin: 25px 0;
    font-style: italic;
    color: #555;
}

/* Tables */
.blog-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
}

.blog-article th,
.blog-article td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.blog-article th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Strong text - prevent overlapping */
.blog-article strong,
.roblox-vscode-tutorial strong {
    font-weight: 700;
    display: inline;
    line-height: inherit;
}

/* Links */
.blog-article a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.blog-article a:hover {
    border-bottom-color: #667eea;
}

/* Language Switcher */
.language-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    background: white;
    padding: 5px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.language-switch a {
    padding: 8px 16px;
    border-radius: 15px;
    text-decoration: none;
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.language-switch a:hover {
    background: #f0f0f0;
}

.language-switch a.active {
    background: #667eea;
    color: white;
}

/* AI-Optimized Elements */

/* Key Takeaways Box */
.key-takeaways {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.08), rgba(56, 178, 172, 0.08));
    border: 2px solid rgba(72, 187, 120, 0.3);
    border-left: 5px solid #48bb78;
    padding: 20px 25px;
    border-radius: 10px;
    margin: 30px 0;
}

.key-takeaways h2 {
    margin-top: 0;
    color: #2f855a;
    font-size: 1.3rem;
}

.key-takeaways ul {
    margin-bottom: 0;
}

.key-takeaways li {
    color: #2d3748;
    font-weight: 500;
}

/* Table of Contents */
.table-of-contents {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
}

.table-of-contents h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #2d3748;
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.table-of-contents ol {
    margin-bottom: 0;
    line-height: 2;
}

.table-of-contents ol li {
    margin-bottom: 8px;
}

.table-of-contents a {
    color: #667eea;
    text-decoration: none;
    display: inline-block;
}

.table-of-contents a:hover {
    text-decoration: underline;
}

/* Definition Lists */
.blog-article dl {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.blog-article dt {
    margin-bottom: 5px;
    color: #667eea;
}

.blog-article dd {
    margin-left: 0;
    margin-bottom: 15px;
    padding-left: 20px;
    border-left: 3px solid #e5e5e5;
}

/* Structured Lists */
.structured-list {
    background: rgba(102, 126, 234, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.structured-list h4 {
    margin-top: 0;
    color: #667eea;
}

/* Steps with Enhanced Styling */
.steps li {
    margin-bottom: 20px;
    padding-left: 10px;
    line-height: 1.8;
}

.steps li strong {
    color: #667eea;
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.steps li p {
    margin: 0;
    color: #4a5568;
    line-height: 1.8;
}

/* FAQ Section */
.faq-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e5e5e5;
}

.faq-item {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.faq-item h3 {
    margin-top: 0;
    color: #2d3748;
    font-size: 1.2rem;
}

.faq-item p {
    margin-bottom: 0;
}

/* Article Summary Section */
.article-summary {
    margin-bottom: 40px;
}

/* Article Conclusion */
.article-conclusion {
    margin-top: 50px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.summary-points {
    margin-top: 20px;
}

.summary-points h3 {
    font-size: 1.1rem;
    color: #667eea;
    margin-bottom: 15px;
}

/* Table Wrapper for Responsive Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.blog-article table caption {
    margin-bottom: 10px;
    font-weight: 600;
    color: #2d3748;
    text-align: left;
}

/* Code Block Enhancements */
.code-block {
    margin: 25px 0;
}

.inline-code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    color: #d63384;
    font-family: "SF Mono", Monaco, Consolas, monospace;
}

/* Breadcrumb Navigation */
.breadcrumb {
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb span {
    margin: 0 8px;
    color: #999;
}

/* Footer CTA Section */
.footer-cta {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(20px);
    padding: 60px 0;
    border-radius: 25px 25px 0 0;
    margin-top: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-cta .section-header {
    text-align: center;
}

.footer-cta .section-header h2 {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.footer-cta .section-header p {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 30px;
}

.btn-primary, .btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 35px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover, .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .blog-article {
        max-width: 95%;
        padding: 50px 40px;
        margin: -70px auto 50px auto;
    }

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

@media (max-width: 768px) {
    .blog-post-header {
        padding: 120px 0 80px 0;
    }

    .blog-article {
        padding: 40px 25px;
        margin: -60px 20px 40px 20px;
    }

    .blog-article h1 {
        font-size: 2rem;
    }

    .blog-article h2 {
        font-size: 1.5rem;
    }

    .blog-article h3 {
        font-size: 1.25rem;
    }

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

    .language-switcher {
        flex-direction: column;
        gap: 4px;
    }

    .lang-link {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .footer-cta {
        padding: 50px 0;
    }

    .footer-cta .section-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .blog-post-header {
        padding: 100px 0 60px 0;
    }

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

    .blog-article {
        padding: 30px 20px;
        margin: -50px 15px 30px 15px;
        border-radius: 15px;
    }

    .blog-article h1 {
        font-size: 1.75rem;
    }

    .blog-article h2 {
        font-size: 1.375rem;
        padding-left: 10px;
    }

    .blog-article h3 {
        font-size: 1.125rem;
    }

    .blog-article pre {
        padding: 15px;
        font-size: 0.85em;
    }

    .blog-post-nav .container {
        flex-direction: column;
        gap: 15px;
    }

    .language-switcher {
        flex-direction: row;
        gap: 8px;
    }

    .post-category {
        padding: 10px 25px;
        font-size: 0.8rem;
        margin-bottom: 20px;
    }

    .post-date {
        font-size: 1rem;
        margin-bottom: 25px;
    }
}

/* Tutorial Step Styling */
.tutorial-step {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.7);
    padding: 35px;
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.tutorial-step ol,
.tutorial-step ul {
    padding-left: 25px !important;
}

.tutorial-step ol li,
.tutorial-step ul li {
    margin-bottom: 18px !important;
    line-height: 1.9 !important;
    position: relative;
}

.tutorial-step ol li strong,
.tutorial-step ul li strong {
    line-height: 1.9 !important;
    display: inline !important;
    margin-right: 5px;
}

.tutorial-step li ul,
.tutorial-step li ol {
    margin-top: 12px !important;
    margin-bottom: 12px !important;
}

/* Roblox VSCode Tutorial Specific - Override any conflicts */
.roblox-vscode-tutorial {
    line-height: 1.7 !important;
}

.roblox-vscode-tutorial ol,
.roblox-vscode-tutorial ul,
.blog-article.roblox-vscode-tutorial ol,
.blog-article.roblox-vscode-tutorial ul {
    padding-left: 30px !important;
    margin: 20px 0 !important;
}

.roblox-vscode-tutorial ol > li,
.roblox-vscode-tutorial ul > li,
.blog-article.roblox-vscode-tutorial ol > li,
.blog-article.roblox-vscode-tutorial ul > li {
    margin-bottom: 18px !important;
    line-height: 1.8 !important;
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}

/* Ensure note spans after list items have proper spacing */
.roblox-vscode-tutorial li + .note,
.tutorial-step li + .note,
.blog-article li + .note {
    margin-top: 20px !important;
    display: block !important;
}

.roblox-vscode-tutorial ul ul,
.roblox-vscode-tutorial ol ul,
.blog-article.roblox-vscode-tutorial ul ul,
.blog-article.roblox-vscode-tutorial ol ul {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}

.roblox-vscode-tutorial li ul li,
.roblox-vscode-tutorial li ol li,
.blog-article.roblox-vscode-tutorial li ul li,
.blog-article.roblox-vscode-tutorial li ol li {
    margin-bottom: 8px !important;
}

/* Fix for table of contents in Roblox tutorial */
.roblox-vscode-tutorial .table-of-contents ol li,
.blog-article.roblox-vscode-tutorial .table-of-contents ol li {
    margin-bottom: 10px !important;
    line-height: 1.6 !important;
}

.roblox-vscode-tutorial .table-of-contents a,
.blog-article.roblox-vscode-tutorial .table-of-contents a {
    display: inline-block !important;
    padding: 2px 0 !important;
}

/* References Section */
.references {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e5e5e5;
}

.references h2 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 20px;
}

.references ul {
    list-style: none !important;
    padding-left: 0;
}

.references ul li {
    margin-bottom: 15px;
    padding-left: 0;
    line-height: 1.8;
    list-style-type: none !important;
}

.references ul li::before {
    content: none !important;
    display: none !important;
}

/* Print Styles */
@media print {
    .language-switch,
    .breadcrumb {
        display: none;
    }

    .blog-article {
        max-width: 100%;
        padding: 0;
    }

    .blog-article a {
        color: #333;
        border: none;
    }

    .blog-article img {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}