/* ========================================
   IDEAS BLOG - MODERN PROFESSIONAL DESIGN
   Inspired by Tailwind CSS and top tech blogs
   ======================================== */

/* ===== CSS VARIABLES ===== */
:root {
    /* Colors - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-muted: #64748b;
    
    /* Brand Colors */
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    
    /* Accent Colors */
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    
    /* Borders */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    /* Shadows */
    --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);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-tertiary: #94a3b8;
        --text-muted: #64748b;
        
        --border-light: #334155;
        --border-medium: #475569;
        
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    }
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-size: 16px;
    overflow-x: hidden;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 864px;
    margin: 0 auto;
    padding: 80px 24px;
}

.container-article {
    max-width: 768px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* ===== HEADER ===== */
header {
    margin-bottom: 64px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-light);
}

header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.04em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

header .description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
}

/* ===== NAVIGATION ===== */
nav {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

/* ===== POSTS GRID ===== */
.posts {
    display: grid;
    gap: 32px;
}

/* ===== POST CARD ===== */
.post {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 32px;
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.post:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.post:hover::before {
    transform: scaleX(1);
}

.post-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-meta::before {
    content: '📅';
    font-size: 0.875rem;
}

.post h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

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

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

.post-summary {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 1rem;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-light);
}

.tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

/* ===== ARTICLE PAGE ===== */
.article {
    max-width: 768px;
    margin: 0 auto;
}

.home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    font-size: 0.9375rem;
}

.home-link:hover {
    color: var(--primary);
    transform: translateX(-4px);
}

.home-link::before {
    content: '←';
}

.article-header {
    margin-bottom: 48px;
}

.article-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.article-meta {
    font-size: 0.9375rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== ARTICLE CONTENT ===== */
.article-content {
    line-height: 1.85;
    font-size: 1.0625rem;
}

.article-content p {
    margin-bottom: 28px;
    color: var(--text-secondary);
}

.article-content h2 {
    font-size: 1.875rem;
    margin-top: 56px;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--text-primary);
}

.article-content h3 {
    font-size: 1.5rem;
    margin-top: 40px;
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
    color: var(--text-primary);
}

/* ===== LISTS ===== */
.article-content ul,
.article-content ol {
    margin-bottom: 28px;
    padding-left: 28px;
    color: var(--text-secondary);
}

.article-content li {
    margin-bottom: 10px;
    line-height: 1.75;
}

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

/* ===== CODE ===== */
.article-content code {
    background: var(--bg-tertiary);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Monaco, monospace;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.article-content pre {
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin-bottom: 28px;
    border: 1px solid var(--border-light);
}

.article-content pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 0.9375em;
    line-height: 1.6;
}

/* ===== TABLES ===== */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 28px;
    font-size: 0.9375em;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.article-content table thead {
    background: var(--primary-gradient);
}

.article-content table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-content table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.article-content table tr:last-child td {
    border-bottom: none;
}

.article-content table tbody tr:hover {
    background: var(--bg-secondary);
}

/* ===== LINKS ===== */
.article-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}

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

/* ===== BLOCKQUOTES ===== */
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 24px;
    margin: 32px 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    font-style: italic;
    color: var(--text-primary);
    font-size: 1.125rem;
    line-height: 1.75;
}

.article-content blockquote p {
    margin-bottom: 0;
}

/* ===== HORIZONTAL RULE ===== */
.article-content hr {
    border: none;
    height: 2px;
    background: var(--border-light);
    margin: 56px 0;
    position: relative;
}

.article-content hr::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.1;
}

/* ===== AFFILIATE DISCLOSURE ===== */
.affiliate-disclosure {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 40px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.affiliate-disclosure strong {
    color: var(--accent-green);
    font-weight: 600;
}

/* ===== QUICK RECOMMENDATION CARDS ===== */
.quick-recommendation {
    margin-bottom: 48px;
}

.quick-recommendation h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.recommendation-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    transition: all var(--transition-base);
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.recommendation-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.recommendation-card p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

/* ===== CTA BUTTON ===== */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-gradient);
    color: white;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: white;
}

.cta-button::after {
    content: '→';
    transition: transform var(--transition-fast);
}

.cta-button:hover::after {
    transform: translateX(4px);
}

/* ===== COMPARISON TABLE ===== */
.comparison-table {
    margin-bottom: 48px;
}

.comparison-table h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* ===== BOOK/COURSE REVIEWS ===== */
.book-review,
.course-review {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 32px;
}

.book-review h3,
.course-review h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.book-review p,
.course-review p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.book-review h4,
.course-review h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.book-review ul,
.course-review ul {
    margin-bottom: 16px;
}

.book-review li,
.course-review li {
    margin-bottom: 8px;
}

.book-review li strong::before {
    content: '✓ ';
    color: var(--accent-green);
    font-weight: bold;
}

.book-review li strong.no::before {
    content: '✗ ';
    color: var(--accent-red);
}

/* ===== HOW TO CHOOSE ===== */
.how-to-choose {
    margin-bottom: 48px;
}

.how-to-choose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.reader-level {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.reader-level h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.reader-level ol {
    margin-bottom: 0;
}

/* ===== FAQ ===== */
.faq {
    margin-bottom: 48px;
}

.faq h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 12px;
}

.faq-item h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.faq-item p {
    margin-bottom: 0;
    color: var(--text-secondary);
}

/* ===== ARCHIVE ===== */
.archive-section {
    margin-bottom: 48px;
}

.archive-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8125rem;
}

.archive-list {
    list-style: none;
}

.archive-item {
    margin-bottom: 12px;
}

.archive-item a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.archive-item a:hover {
    color: var(--primary);
}

.archive-date {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-left: 12px;
    font-weight: 400;
}

/* ===== FOOTER ===== */
footer {
    margin-top: 80px;
    padding-top: 32px;
    padding-bottom: 48px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

footer p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 8px;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

footer a:hover {
    color: var(--primary);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        padding: 48px 20px;
    }
    
    .container-article {
        padding: 40px 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header .description {
        font-size: 1rem;
    }
    
    .post {
        padding: 24px;
    }
    
    .post h2 {
        font-size: 1.25rem;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.25rem;
    }
    
    .article-content table {
        font-size: 0.8125em;
    }
    
    .book-review,
    .course-review {
        padding: 24px;
    }
    
    nav {
        flex-wrap: wrap;
        gap: 16px;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }
    
    header {
        margin-bottom: 40px;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .container {
        padding: 32px 16px;
    }
    
    .post {
        padding: 20px;
    }
    
    .article-content blockquote {
        font-size: 1rem;
        padding: 20px;
    }
    
    .recommendation-card {
        padding: 20px;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-success {
    background: var(--accent-green);
    color: white;
}

.badge-purple {
    background: var(--accent-purple);
    color: white;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post,
.article-content section {
    animation: fadeIn var(--transition-slow) ease-out;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== SELECTION ===== */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}

/* ===== FOCUS ===== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== PRINT ===== */
@media print {
    .post,
    .recommendation-card,
    .book-review,
    .course-review,
    .faq-item {
        break-inside: avoid;
    }
}
