/* Custom Theme Enhancements for Jiten Thakkar's Blog */

/* Base Color Variables - Modern Blue Theme (Default Light) */
:root[data-scheme="light"],
:root:not([data-scheme]) {
    --card-background: #ffffff !important;
    --body-background: #f8f9fa !important;
    --accent-color: #2563eb !important;
    --accent-color-darker: #1d4ed8 !important;
    --accent-color-text: #ffffff !important;
    --body-text-color: #374151 !important;
    --card-text-color-main: #374151 !important;
    --card-text-color-secondary: #6b7280 !important;
    --tag-background: #e0e7ff;
    --tag-color: #3730a3;
    --code-background: #f1f5f9;
    --code-color: #dc2626;
    --link-color: #2563eb;
    --link-hover-color: #1d4ed8;
    --sidebar-background: #1f2937;
    --sidebar-text: #f9fafb;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark Theme */
:root[data-scheme="dark"] {
    --card-background: #1f2937 !important;
    --body-background: #111827 !important;
    --accent-color: #3b82f6 !important;
    --accent-color-darker: #2563eb !important;
    --accent-color-text: #ffffff !important;
    --body-text-color: #e5e7eb !important;
    --card-text-color-main: #e5e7eb !important;
    --card-text-color-secondary: #d1d5db !important;
    --tag-background: #1e3a8a;
    --tag-color: #dbeafe;
    --code-background: #374151;
    --code-color: #fca5a5;
    --link-color: #60a5fa;
    --link-hover-color: #93c5fd;
    --sidebar-background: #0f172a;
    --sidebar-text: #f1f5f9;
}

/* Ocean Theme - Deep Blues and Teals */
:root[data-scheme="ocean"] {
    --card-background: #ffffff !important;
    --body-background: #e0f2fe !important;
    --accent-color: #0891b2 !important;
    --accent-color-darker: #0e7490 !important;
    --accent-color-text: #ffffff !important;
    --body-text-color: #134e4a !important;
    --card-text-color-main: #134e4a !important;
    --card-text-color-secondary: #14532d !important;
    --tag-background: #ccfbf1;
    --tag-color: #115e59;
    --code-background: #cffafe;
    --code-color: #be123c;
    --link-color: #0891b2;
    --link-hover-color: #0e7490;
    --sidebar-background: #0c4a6e;
    --sidebar-text: #ffffff;
    --box-shadow: 0 4px 6px -1px rgba(8, 145, 178, 0.1), 0 2px 4px -1px rgba(8, 145, 178, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(8, 145, 178, 0.15), 0 4px 6px -2px rgba(8, 145, 178, 0.08);
}

/* Remove the debug badge */

/* Forest Theme - Greens and Earth Tones */
:root[data-scheme="forest"] {
    --card-background: #ffffff !important;
    --body-background: #f0fdf4 !important;
    --accent-color: #16a34a !important;
    --accent-color-darker: #15803d !important;
    --accent-color-text: #ffffff !important;
    --body-text-color: #1e3a1e !important;
    --card-text-color-main: #1e3a1e !important;
    --card-text-color-secondary: #14532d !important;
    --tag-background: #dcfce7;
    --tag-color: #166534;
    --code-background: #f0fdf4;
    --code-color: #be123c;
    --link-color: #16a34a;
    --link-hover-color: #15803d;
    --sidebar-background: #14532d;
    --sidebar-text: #f0fdf4;
    --box-shadow: 0 4px 6px -1px rgba(22, 163, 74, 0.1), 0 2px 4px -1px rgba(22, 163, 74, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(22, 163, 74, 0.15), 0 4px 6px -2px rgba(22, 163, 74, 0.08);
}

/* Sunset Theme - Warm Oranges */
:root[data-scheme="sunset"] {
    --card-background: #ffffff !important;
    --body-background: #fff7ed !important;
    --accent-color: #ea580c !important;
    --accent-color-darker: #c2410c !important;
    --accent-color-text: #ffffff !important;
    --body-text-color: #431407 !important;
    --card-text-color-main: #431407 !important;
    --card-text-color-secondary: #7c2d12 !important;
    --tag-background: #fed7aa;
    --tag-color: #9a3412;
    --code-background: #ffedd5;
    --code-color: #be123c;
    --link-color: #ea580c;
    --link-hover-color: #c2410c;
    --sidebar-background: #7c2d12;
    --sidebar-text: #fff7ed;
    --box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.1), 0 2px 4px -1px rgba(234, 88, 12, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(234, 88, 12, 0.15), 0 4px 6px -2px rgba(234, 88, 12, 0.08);
}

/* Royal Theme - Purple and Gold */
:root[data-scheme="royal"] {
    --card-background: #ffffff !important;
    --body-background: #faf5ff !important;
    --accent-color: #9333ea !important;
    --accent-color-darker: #7e22ce !important;
    --accent-color-text: #ffffff !important;
    --body-text-color: #3b0764 !important;
    --card-text-color-main: #3b0764 !important;
    --card-text-color-secondary: #581c87 !important;
    --tag-background: #e9d5ff;
    --tag-color: #6b21a8;
    --code-background: #f3e8ff;
    --code-color: #be123c;
    --link-color: #9333ea;
    --link-hover-color: #7e22ce;
    --sidebar-background: #581c87;
    --sidebar-text: #faf5ff;
    --box-shadow: 0 4px 6px -1px rgba(147, 51, 234, 0.1), 0 2px 4px -1px rgba(147, 51, 234, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(147, 51, 234, 0.15), 0 4px 6px -2px rgba(147, 51, 234, 0.08);
}

/* Midnight Theme - Dark Blue/Black */
:root[data-scheme="midnight"] {
    --card-background: #1e293b !important;
    --body-background: #0f172a !important;
    --accent-color: #38bdf8 !important;
    --accent-color-darker: #0ea5e9 !important;
    --accent-color-text: #0f172a !important;
    --body-text-color: #e2e8f0 !important;
    --card-text-color-main: #e2e8f0 !important;
    --card-text-color-secondary: #cbd5e1 !important;
    --tag-background: #1e3a8a;
    --tag-color: #bfdbfe;
    --code-background: #334155;
    --code-color: #fca5a5;
    --link-color: #38bdf8;
    --link-hover-color: #7dd3fc;
    --sidebar-background: #020617;
    --sidebar-text: #f1f5f9;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* Rose Theme - Soft Pinks and Reds */
:root[data-scheme="rose"] {
    --card-background: #ffffff !important;
    --body-background: #fff1f2 !important;
    --accent-color: #e11d48 !important;
    --accent-color-darker: #be123c !important;
    --accent-color-text: #ffffff !important;
    --body-text-color: #4c0519 !important;
    --card-text-color-main: #4c0519 !important;
    --card-text-color-secondary: #881337 !important;
    --tag-background: #fecdd3;
    --tag-color: #9f1239;
    --code-background: #ffe4e6;
    --code-color: #be123c;
    --link-color: #e11d48;
    --link-hover-color: #be123c;
    --sidebar-background: #881337;
    --sidebar-text: #fff1f2;
    --box-shadow: 0 4px 6px -1px rgba(225, 29, 72, 0.1), 0 2px 4px -1px rgba(225, 29, 72, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(225, 29, 72, 0.15), 0 4px 6px -2px rgba(225, 29, 72, 0.08);
}

/* Typography Improvements */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.7;
    color: var(--body-text-color);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5rem;
}

/* Article Cards */
.article-list article {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.article-list article:hover {
    transform: translateY(-4px);
    box-shadow: var(--box-shadow-lg);
}

/* Featured Images */
.article-image img {
    border-radius: 12px 12px 0 0;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Tags */
.article-tags a,
.tag-cloud a {
    background: var(--tag-background);
    color: var(--tag-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.article-tags a:hover,
.tag-cloud a:hover {
    transform: scale(1.05);
    box-shadow: var(--box-shadow);
    text-decoration: none;
}

/* Code Blocks */
code {
    background: var(--code-background);
    color: var(--code-color);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
}

pre {
    background: var(--code-background);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    box-shadow: var(--box-shadow);
}

pre code {
    background: transparent;
    padding: 0;
}

/* Sidebar Enhancements */
.left-sidebar {
    background: var(--sidebar-background);
}

.sidebar header .site-name {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar header .site-description {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.9;
}

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

.article-content p {
    margin-bottom: 1.5em;
}

.article-content img {
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    margin: 2rem 0;
}

.article-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin-left: 0;
    font-style: italic;
    color: var(--body-text-color);
    opacity: 0.9;
}

/* Buttons and Interactive Elements */
button,
.button,
input[type="submit"] {
    background: var(--accent-color);
    color: var(--accent-color-text);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover,
.button:hover,
input[type="submit"]:hover {
    background: var(--accent-color-darker);
    transform: translateY(-1px);
    box-shadow: var(--box-shadow);
}

/* Search Box */
.search-form input {
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-form input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Widget Styling */
.widget {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--body-text-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--body-text-color);
    opacity: 0.8;
}

/* Reading Time and Metadata */
.article-time,
.article-category {
    color: var(--body-text-color);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Exclude animations and transforms from the global transition */
*:not(.no-transition) {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.2s ease;
}

/* Gallery Enhancements */
.article-content figure {
    margin: 2rem 0;
}

.article-content figcaption {
    text-align: center;
    font-style: italic;
    color: var(--body-text-color);
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

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

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

.article-list article {
    animation: fadeIn 0.5s ease;
}

/* Table of Contents Styling */
.table-of-contents {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.table-of-contents a {
    color: var(--body-text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.table-of-contents a:hover {
    color: var(--accent-color);
}

/* Social Icons */
.social-menu a {
    transition: transform 0.2s ease;
}

.social-menu a:hover {
    transform: scale(1.1);
}

/* ULTRA AGGRESSIVE FONT SIZE - 1.375rem (22px) for blog content */
.article-content,
.article-content p,
.article-content div:not(.highlight),
.article-content span,
article p,
article div {
    font-size: 1.375rem !important;
    line-height: 2 !important;
}

.article-content li,
.article-content ul li,
.article-content ol li {
    font-size: 1.375rem !important;
    line-height: 2 !important;
    margin-bottom: 0.75em !important;
}

.main-container .article-content p,
.s-content p,
article .s-content p {
    font-size: 1.375rem !important;
    line-height: 2 !important;
}

/* Caption fixes - make captions display properly */
figcaption strong,
.article-content figcaption strong,
figure figcaption strong {
    font-weight: normal !important;
}

figcaption,
.article-content figcaption,
figure figcaption {
    display: block !important;
    text-align: center !important;
    font-style: italic !important;
    font-size: 1rem !important;
    color: var(--card-text-color-secondary) !important;
    margin-top: 1rem !important;
    margin-bottom: 1.5rem !important;
    padding: 0 1rem !important;
    line-height: 1.6 !important;
    font-weight: normal !important;
}

/* Responsive images */
.article-content img,
figure img {
    max-width: 100% !important;
    height: auto !important;
    width: 100% !important;
}

/* Limit article content width for better readability */
.article-page .main-article {
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.article-content {
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Ensure article header and footer also respect max width */
.article-page .main-article .article-header .article-details,
.article-page .main-article .article-footer {
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Force text colors for all themes */
body, p, span, div, li, td, th, .article-content,
h1, h2, h3, h4, h5, h6,
.article-title, .article-subtitle {
    color: var(--body-text-color) !important;
}

a {
    color: var(--link-color) !important;
}

a:hover {
    color: var(--link-hover-color) !important;
}

/* Force sidebar text to be readable */
.left-sidebar,
.left-sidebar *,
.left-sidebar a,
.left-sidebar p,
.left-sidebar span,
.left-sidebar .site-name,
.left-sidebar .site-description,
.left-sidebar nav,
.left-sidebar nav a {
    color: var(--sidebar-text) !important;
}

.left-sidebar {
    background: var(--sidebar-background) !important;
}

/* Make social icons visible with white color */
.menu-social svg,
.menu-social a,
.menu-social a svg {
    stroke: #ffffff !important;
    color: #ffffff !important;
}

.menu-social li {
    display: inline-block;
}

.menu-social a:hover svg {
    stroke: var(--accent-color) !important;
    transform: scale(1.1);
    transition: all 0.2s ease;
}
