/*
 * RChina AI Blog System - Custom Styles
 * AI-themed design with modern, clean aesthetics
 */

/* ============================================
   Color Scheme
   ============================================ */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #0dcaf0;
    --accent-cyan: #17a2b8;
    --bg-light: #f8f9fa;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
}

/* ============================================
   Global Styles
   ============================================ */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-dark);
    background-color: #fff;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ============================================
   Hero Banner
   ============================================ */
.hero-banner {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    position: relative;
    overflow: hidden;
}

.hero-banner::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 1200 120"><path d="M0,0 L1200,0 L1200,80 Q600,120 0,80 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
    opacity: 0.3;
}

.hero-banner .container {
    position: relative;
    z-index: 1;
}

/* ============================================
   Article Cards
   ============================================ */
.article-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.article-card .card-title a {
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.article-card .card-title a:hover {
    color: var(--primary-color);
}

/* ============================================
   Article Detail Page
   ============================================ */
.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
}

.article-meta {
    font-size: 0.9rem;
}

/* Markdown body styling */
.markdown-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #24292e;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.markdown-body h1 {
    font-size: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.3em;
}

.markdown-body h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

.markdown-body h3 {
    font-size: 1.25rem;
}

.markdown-body p {
    margin-bottom: 16px;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.markdown-body pre {
    background-color: #f6f8fa;
    border-radius: 6px;
    padding: 16px;
    overflow: auto;
    font-size: 14px;
    line-height: 1.45;
}

.markdown-body pre code {
    background-color: transparent;
    padding: 0;
    font-size: 100%;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: var(--text-muted);
    border-left: 0.25em solid var(--border-color);
    margin: 0 0 16px 0;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 2em;
    margin-bottom: 16px;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
}

.markdown-body table th,
.markdown-body table td {
    padding: 6px 13px;
    border: 1px solid var(--border-color);
}

.markdown-body table tr {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
}

.markdown-body table tr:nth-child(2n) {
    background-color: var(--bg-light);
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.markdown-body a {
    color: var(--primary-color);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

/* ============================================
   Tags & Badges
   ============================================ */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* ============================================
   Pagination
   ============================================ */
.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: var(--bg-light);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background-color: var(--bg-light);
    font-size: 0.9rem;
}

.footer a {
    color: #666;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0ab3d0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* ============================================
   Cards
   ============================================ */
.card {
    border-radius: 12px;
    overflow: hidden;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .article-title {
        font-size: 1.75rem;
    }
    
    .hero-banner h1 {
        font-size: 2rem;
    }
    
    .markdown-body {
        font-size: 1rem;
    }
}

/* ============================================
   Loading Animation
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card,
.card {
    animation: fadeIn 0.5s ease-out;
}

/* ============================================
   Utility Classes
   ============================================ */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
