/* Blog-specific styles for DocTransform */

/* Blog Hero Section */
.blog-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #218838 100%);
    position: relative;
    overflow: hidden;
}

.blog-hero::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 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

/* Blog Header */
.blog-header {
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

/* Blog Content Styling */
.blog-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #212529 !important;
    background-color: #ffffff !important;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #1a1a1a !important;
}

.blog-content h1 { font-size: 2.5rem; }
.blog-content h2 { font-size: 2rem; }
.blog-content h3 { font-size: 1.6rem; }
.blog-content h4 { font-size: 1.3rem; }

.blog-content p {
    margin-bottom: 1.5rem;
    color: #495057 !important;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.blog-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.blog-content code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #e83e8c;
}

.blog-content pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin: 2rem 0;
    overflow-x: auto;
}

.blog-content pre code {
    background: transparent;
    padding: 0;
    color: #333;
}

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

.blog-content li {
    margin-bottom: 0.5rem;
    color: #495057 !important;
}

.blog-content table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.blog-content table th,
.blog-content table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.blog-content table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.blog-content table tr:nth-child(even) {
    background: #f8f9fa;
}

/* Article Cards */
.article-card {
    transition: all 0.3s ease;
    border: none !important;
    border-radius: 12px;
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.article-card .card-img-top {
    transition: transform 0.3s ease;
}

.article-card:hover .card-img-top {
    transform: scale(1.05);
}

/* Social Sharing */
.social-sharing .btn {
    border-radius: 25px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.social-sharing .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Article Navigation */
.article-navigation {
    border-top: 2px solid #e9ecef;
    border-bottom: 2px solid #e9ecef;
}

.nav-article a {
    text-decoration: none;
    color: #495057;
    transition: color 0.3s ease;
}

.nav-article a:hover {
    color: var(--primary-color);
}

/* Related Articles */
.related-articles .card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.related-articles .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Tags */
.badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.badge:hover {
    transform: scale(1.05);
    text-decoration: none;
}

/* Admin Styles */
.admin-stats .card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-start) 0%, var(--color-end) 100%);
}

.admin-stats .card.bg-primary {
    --color-start: #007bff;
    --color-end: #0056b3;
}

.admin-stats .card.bg-success {
    --color-start: #28a745;
    --color-end: #1e7e34;
}

.admin-stats .card.bg-warning {
    --color-start: #ffc107;
    --color-end: #d39e00;
}

.admin-stats .card.bg-info {
    --color-start: #17a2b8;
    --color-end: #117a8b;
}

/* Form Styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Content Editor */
#content {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Pagination */
.pagination .page-link {
    border-radius: 25px;
    margin: 0 2px;
    border: none;
    color: var(--primary-color);
    background: transparent;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .blog-hero .display-4 {
        font-size: 2rem;
    }
    
    .blog-content {
        font-size: 1rem;
        padding: 1rem !important;
    }
    
    .blog-content h1 { font-size: 2rem; }
    .blog-content h2 { font-size: 1.7rem; }
    .blog-content h3 { font-size: 1.4rem; }
    .blog-content h4 { font-size: 1.2rem; }
    
    .social-sharing {
        text-align: center;
    }
    
    .social-sharing .btn {
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .article-navigation .nav-article {
        text-align: center !important;
        margin-bottom: 1rem;
    }
    
    /* Blog cards mobile optimization */
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .card-text {
        font-size: 0.9rem;
    }
    
    /* Blog hero mobile optimization */
    .blog-hero {
        padding: 2rem 0 !important;
    }
    
    .blog-hero .lead {
        font-size: 1rem;
    }
    
    /* Mobile navigation fixes */
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
}

/* Ensure strong contrast for readability */
.blog-content strong,
.blog-content b {
    color: #1a1a1a;
    font-weight: 700;
}

.blog-content em,
.blog-content i {
    color: #343a40;
    font-style: italic;
}

/* Override any theme-based color issues */
.blog-content * {
    color: inherit;
}

/* Specific element contrast fixes */
.blog-content a {
    color: #007bff;
    text-decoration: underline;
}

.blog-content a:hover {
    color: #0056b3;
}

/* Loading animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeInUp 0.6s ease forwards;
}

.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.2s; }
.article-card:nth-child(4) { animation-delay: 0.3s; }

/* Print styles */
@media print {
    .blog-hero,
    .social-sharing,
    .article-navigation,
    .related-articles,
    nav,
    footer {
        display: none !important;
    }
    
    .blog-content {
        font-size: 12pt;
        line-height: 1.6;
    }
    
    .blog-content h1,
    .blog-content h2,
    .blog-content h3 {
        page-break-after: avoid;
    }
    
    .blog-content img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}