/* ===========================
   PREMIUM ARTICLE STYLES v2.0
   Professional Design for AdSense Approval
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* CSS Custom Properties */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* Base Reset & Typography */
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.8;
    color: var(--gray-800);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
}

/* Premium Header */
.site-header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo img {
    height: 40px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
}

.search-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-bar input {
    padding: 0.6rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    width: 200px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: inherit;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.theme-toggle,
.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(20deg);
}

.mobile-menu-toggle {
    display: none;
}

/* Premium Article Container */
.article-container {
    background: #fff;
    margin: 2.5rem auto;
    padding: 3.5rem 4rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 900px;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

.article-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

/* Breadcrumb */
.article-breadcrumb {
    color: var(--gray-500);
    margin-bottom: 2rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* Category Badge */
.article-category-badge {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Premium Title */
.article-header h1 {
    font-size: 2.75rem;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    color: var(--gray-900);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Meta Info */
.article-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--gray-500);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Author Box */
.author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 2.5rem;
    border: 1px solid var(--gray-200);
}

.author-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    object-fit: cover;
}

.author-name {
    font-weight: 600;
    color: var(--gray-900);
}

.author-name strong {
    color: var(--primary);
}

.author-title {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* Intro Text */
.intro-text {
    font-size: 1.2rem;
    line-height: 1.9;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 2.5rem;
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

/* Article Content */
.article-content {
    font-size: 1.1rem;
    line-height: 1.9;
}

.article-content p {
    margin-bottom: 1.75rem;
    color: var(--gray-700);
}

.article-content h2 {
    font-size: 1.875rem;
    margin: 3.5rem 0 1.5rem;
    color: var(--gray-900);
    font-weight: 700;
    position: relative;
    padding-left: 1rem;
    border-left: 4px solid var(--primary);
}

.article-content h3 {
    font-size: 1.375rem;
    margin: 2.5rem 0 1rem;
    color: var(--gray-800);
    font-weight: 600;
}

.article-content h4 {
    font-size: 1.125rem;
    margin: 2rem 0 1rem;
    color: var(--gray-700);
    font-weight: 600;
}

.article-content ul,
.article-content ol {
    margin: 1.75rem 0;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.article-content li::marker {
    color: var(--primary);
}

.article-content strong {
    color: var(--gray-900);
    font-weight: 600;
}

.article-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.article-content a:hover {
    border-bottom-color: var(--primary);
}

/* Blockquote */
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
    font-style: italic;
    color: var(--gray-600);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    position: relative;
}

.article-content blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: var(--primary-light);
    opacity: 0.3;
    font-family: Georgia, serif;
}

/* Premium Boxes */
.highlight-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin: 2.5rem 0;
    position: relative;
    overflow: hidden;
}

.highlight-box::before {
    content: '💡';
    position: absolute;
    top: -5px;
    right: 15px;
    font-size: 2rem;
    opacity: 0.2;
}

.highlight-box h4 {
    color: #1e40af;
    margin-top: 0;
    font-weight: 600;
}

.pro-tip {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid var(--success);
    padding: 1.5rem 1.75rem;
    margin: 2.5rem 0;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.pro-tip strong {
    color: #059669;
}

.warning-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid var(--warning);
    padding: 1.5rem 1.75rem;
    margin: 2.5rem 0;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.warning-box strong {
    color: #d97706;
}

/* Premium Table */
.table-wrapper {
    overflow-x: auto;
    margin: 2.5rem 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    color: var(--gray-900);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

tr:hover td {
    background: #fafafa;
}

/* Premium Tags */
.article-tags {
    display: flex;
    gap: 0.75rem;
    margin: 3.5rem 0;
    flex-wrap: wrap;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

.tag {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: var(--primary-dark);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Premium FAQ */
.faq-section {
    margin: 3.5rem 0;
    padding: 2.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
}

.faq-section h2 {
    margin-top: 0;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    padding-left: 0;
}

.faq-section h2::before {
    content: '❓';
    font-size: 1.5rem;
}

.faq-item {
    margin-bottom: 1.75rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.faq-answer {
    color: var(--gray-600);
    line-height: 1.8;
}

/* Premium Related Posts */
.related-posts {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 2px solid var(--gray-200);
}

.related-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    padding-left: 0;
}

.related-posts h2::before {
    content: '📚';
}

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

.related-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.3s ease;
    background: white;
}

.related-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.related-card h4 {
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.related-card a {
    color: var(--gray-900);
    text-decoration: none;
}

.related-card a:hover {
    color: var(--primary);
}

.related-card p {
    color: var(--gray-500);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Premium Footer */
.site-footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
}

.footer-content a {
    color: #93c5fd;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-content a:hover {
    color: white;
}

.footer-links {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gray-400);
}

.footer-links a:hover {
    color: #fff;
}

/* Premium TOC */
.toc-container,
.table-of-contents {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    margin: 2.5rem 0;
    position: relative;
}

.toc-container::before,
.table-of-contents::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.toc-container h3,
.table-of-contents h3 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 700;
}

.toc-container ul,
.table-of-contents ul,
.table-of-contents ol {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-container > ul > li,
.table-of-contents li {
    margin-bottom: 0.6rem;
}

.toc-container a,
.table-of-contents a {
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    padding: 0.25rem 0;
}

.toc-container a:hover,
.table-of-contents a:hover {
    color: var(--primary);
    transform: translateX(4px);
}

/* Premium Code Blocks */
.article-content pre {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 2rem 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.article-content pre::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 16px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 20px 0 0 #f59e0b, 40px 0 0 #22c55e;
}

.article-content code {
    background: var(--gray-100);
    color: #e11d48;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875em;
}

.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    padding-top: 1rem;
    display: block;
}

/* Premium Images */
.article-content img {
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 2.5rem auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: block;
    transition: transform 0.3s ease;
}

.article-content img:hover {
    transform: scale(1.02);
}

.image-caption {
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
    font-size: 0.9rem;
}

/* Premium Checklist */
.checklist {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--gray-200);
}

.checklist h4 {
    margin-bottom: 1.25rem;
    color: var(--gray-900);
}

.checklist ul {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    position: relative;
    padding: 0.5rem 0.5rem 0.5rem 2.25rem;
    margin-bottom: 0.875rem;
    background: white;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.checklist li:hover {
    background: #fafafa;
}

.checklist li::before {
    content: "☐";
    position: absolute;
    left: 0.75rem;
    color: var(--primary);
    font-size: 1.1rem;
}

/* External Link Indicator */
a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.75em;
    opacity: 0.7;
}

/* Ad Placement Areas (AdSense Ready) */
.ad-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin: 2.5rem 0;
    text-align: center;
    min-height: 100px;
}

.ad-container::before {
    content: 'Advertisement';
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 9999;
    transition: width 0.1s;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5);
}

.scroll-top:active {
    transform: translateY(-2px) scale(1);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Article Summary Box */
.article-summary-box {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-left: 4px solid var(--warning);
    padding: 2rem;
    border-radius: var(--radius-md);
    margin: 2rem 0;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

.article-summary-box h3 {
    color: #92400E;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-summary-box p {
    color: #78350F;
    margin-bottom: 1rem;
}

.article-summary-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-summary-box li {
    color: #78350F;
    padding: 0.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.article-summary-box li::before {
    content: '✓';
    color: var(--success);
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .search-bar input {
        width: 120px;
    }
    
    .article-container {
        padding: 2rem 1.5rem;
        margin: 1rem auto;
        border-radius: 0;
    }
    
    .article-header h1 {
        font-size: 1.875rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.25rem;
    }
    
    .toc-container,
    .table-of-contents {
        padding: 1.5rem;
    }
    
    .faq-section {
        padding: 1.5rem;
    }
    
    .article-category-badge {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
    }
    
    .author-info {
        padding: 1rem;
    }
    
    .intro-text {
        padding: 1.25rem;
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .article-header h1 {
        font-size: 1.5rem;
    }
    
    .article-container {
        padding: 1.25rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .article-content pre {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .scroll-top,
    .ad-container,
    .reading-progress {
        display: none;
    }
    
    .article-container {
        box-shadow: none;
        margin: 0;
        padding: 1rem;
    }
    
    .article-content h2,
    .article-content h3 {
        break-after: avoid;
    }
    
    .article-category-badge,
    .author-info,
    .toc-container,
    .table-of-contents {
        break-inside: avoid;
    }
}
