/* Blog Styles */

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

.blog-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 1000"><defs><radialGradient id="blog-bg" cx="50%" cy="50%"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.05"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="100" fill="url(%23blog-bg)"/><circle cx="800" cy="300" r="150" fill="url(%23blog-bg)"/><circle cx="400" cy="700" r="120" fill="url(%23blog-bg)"/></svg>');
    opacity: 0.4;
}

.blog-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.05) 100%);
    z-index: 1;
}

.blog-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
    color: white !important;
}

.blog-subtitle {
    font-size: 1.25rem;
    margin-bottom: 0;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
    color: white !important;
}

/* Category Filter */
.category-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-btn {
    background: var(--background-white);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Blog Content */
.blog-content {
    padding: 80px 0;
    background: var(--background-light);
}

/* Blog Posts Carousel Container */
#blog-posts {
    /* Let Bootstrap carousel handle the layout */
}

/* Blog Post Cards - Inside carousel */
.blog-post-card {
    background: var(--background-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    height: fit-content;
}

.blog-post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.post-category-badge {
    margin-bottom: 1rem;
}

.post-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-content {
    padding: 3rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.post-date,
.post-read-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-tag {
    background: var(--background-light);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.post-tag:hover {
    background: var(--primary-color);
    color: white;
}

/* Loading Spinner */
.loading-spinner {
    padding: 3rem 0;
    color: var(--text-secondary);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

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

/* No Posts Message */
.no-posts {
    padding: 3rem 0;
    color: var(--text-secondary);
}

.no-posts i {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Article Header */
.article-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.article-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 1000"><defs><radialGradient id="article-bg" cx="50%" cy="50%"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.05"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="150" cy="150" r="80" fill="url(%23article-bg)"/><circle cx="850" cy="200" r="120" fill="url(%23article-bg)"/><circle cx="300" cy="800" r="100" fill="url(%23article-bg)"/></svg>');
    opacity: 0.4;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.category-badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge.blockchain {
    background: #7c3aed;
}

.category-badge.cloud-architecture {
    background: #3b82f6;
}

.category-badge.application-security {
    background: #ef4444;
}

.category-badge.ai-engineering {
    background: #8b5cf6;
}

.category-badge.mobile-development {
    background: #10b981;
}

.article-date,
.reading-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.article-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.article-excerpt {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: white !important;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.article-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
}

.author-details .author-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.author-details .author-role {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Article Content */
.article-content {
    padding: 80px 0;
    background: var(--background-white);
}

.article-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.article-body h1 { font-size: 2rem; }
.article-body h2 { font-size: 1.75rem; }
.article-body h3 { font-size: 1.5rem; }
.article-body h4 { font-size: 1.25rem; }

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: var(--radius-md);
}

.article-body code {
    background: var(--background-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.article-body pre {
    background: #1e1e1e;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 2rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

.article-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* Mermaid Diagrams */
.mermaid {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--background-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* Article Tags */
.article-tags {
    margin: 3rem 0 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.article-tags h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tags-list .post-tag {
    background: var(--background-light);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-fast);
    text-decoration: none;
    display: inline-block;
}

.tags-list .post-tag:hover {
    background: var(--primary-color);
    color: white;
}

/* Social Sharing */
.social-share {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.social-share h4 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-normal);
    border: 2px solid transparent;
}

.share-btn.twitter {
    background: #1da1f2;
    color: white;
}

.share-btn.twitter:hover {
    background: #0d95e8;
    transform: translateY(-2px);
}

.share-btn.linkedin {
    background: #0077b5;
    color: white;
}

.share-btn.linkedin:hover {
    background: #005885;
    transform: translateY(-2px);
}

.share-btn.facebook {
    background: #1877f2;
    color: white;
}

.share-btn.facebook:hover {
    background: #166fe5;
    transform: translateY(-2px);
}

/* Related Articles */
.related-articles {
    margin: 3rem 0;
}

.related-articles h4 {
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.related-card {
    background: var(--background-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.related-card .post-image {
    height: 180px;
}

.related-card .post-content {
    padding: 1.5rem;
}

.related-card .post-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.related-card .post-meta {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Custom Carousel Controls */
#blog-posts-carousel .carousel-control-prev,
#blog-posts-carousel .carousel-control-next {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

#blog-posts-carousel .carousel-control-prev {
    left: -20px;
}

#blog-posts-carousel .carousel-control-next {
    right: -20px;
}

#blog-posts-carousel .carousel-control-prev:hover,
#blog-posts-carousel .carousel-control-next:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    border-color: var(--primary-color);
}

#blog-posts-carousel .carousel-control-prev-icon,
#blog-posts-carousel .carousel-control-next-icon {
    width: 24px;
    height: 24px;
    background-size: 24px 24px;
    filter: invert(1);
}

#blog-posts-carousel .carousel-control-prev:hover .carousel-control-prev-icon {
    filter: invert(0);
}

#blog-posts-carousel .carousel-control-next:hover .carousel-control-next-icon {
    filter: invert(0);
}

/* Enhanced Carousel Indicators */
#blog-posts-carousel .carousel-indicators {
    margin-bottom: -30px;
}

#blog-posts-carousel .carousel-indicators button {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50%;
    margin: 0 6px;
    background-color: var(--text-secondary) !important;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

#blog-posts-carousel .carousel-indicators button.active {
    background-color: var(--primary-color) !important;
    opacity: 1;
    border-color: var(--primary-color);
    transform: scale(1.2);
}

#blog-posts-carousel .carousel-indicators button:hover:not(.active) {
    opacity: 0.8;
    transform: scale(1.1);
    border-color: var(--text-secondary);
}

/* Newsletter Section */
.newsletter-section {
    padding: 80px 0;
    background: var(--background-light);
    text-align: center;
}

.newsletter-section h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.newsletter-section p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form {
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form .input-group {
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.newsletter-form .form-control {
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

.newsletter-form .form-control:focus {
    box-shadow: none;
}

.newsletter-form .btn {
    padding: 1rem 2rem;
    font-weight: 600;
    border: none;
    border-radius: 0;
}

/* Blog Posts Grid Responsive Breakpoints */
@media (max-width: 768px) {
    .blog-title,
    .article-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .category-filter {
        gap: 0.5rem;
    }

    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .post-content {
        padding: 1.5rem;
    }

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

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .article-author {
        margin-top: 1rem;
    }

    .share-buttons {
        justify-content: center;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-form .input-group {
        flex-direction: column;
    }

    .newsletter-form .btn {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
}

@media (max-width: 576px) {
    .blog-header,
    .article-header {
        padding: 100px 0 60px;
    }

    .blog-content,
    .article-content {
        padding: 60px 0;
    }

    .post-image {
        height: 200px;
    }

    .article-body {
        font-size: 1rem;
    }

    .share-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .social-share,
    .newsletter-section {
        display: none !important;
    }

    .article-content {
        padding: 0;
    }

    .article-body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .article-body pre {
        background: #f5f5f5;
        color: #000;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}
