/* DigitalFino - Global CSS Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Light Mode Default */
    --primary: #4f46e5;         /* Indigo 600 */
    --primary-hover: #4338ca;   /* Indigo 700 */
    --primary-light: #e0e7ff;   /* Indigo 100 */
    --secondary: #0ea5e9;       /* Sky 500 */
    --secondary-hover: #0284c7; /* Sky 600 */
    --accent: #f43f5e;          /* Rose 500 */
    
    --bg-body: #f8fafc;         /* Slate 50 */
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.8);
    
    --text-main: #0f172a;       /* Slate 900 */
    --text-muted: #64748b;      /* Slate 500 */
    --text-light: #94a3b8;      /* Slate 400 */
    --text-white: #ffffff;
    
    --border-color: #e2e8f0;    /* Slate 200 */
    --border-focus: #a5b4fc;    /* Indigo 300 */
    
    --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: 0.375rem;      /* 6px */
    --radius-md: 0.75rem;       /* 12px */
    --radius-lg: 1rem;         /* 16px */
    --radius-xl: 1.5rem;       /* 24px */
    
    --max-width: 1280px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --primary: #6366f1;         /* Indigo 500 */
    --primary-hover: #4f46e5;   /* Indigo 600 */
    --primary-light: #1e1b4b;   /* Indigo 950 */
    --secondary: #38bdf8;       /* Sky 400 */
    --secondary-hover: #0ea5e9; /* Sky 500 */
    
    --bg-body: #0b0f19;         /* Rich dark blue-grey */
    --bg-card: #151c2c;         /* Card slate-850 */
    --bg-header: rgba(11, 15, 25, 0.8);
    
    --text-main: #f8fafc;       /* Slate 50 */
    --text-muted: #94a3b8;      /* Slate 400 */
    --text-light: #64748b;      /* Slate 500 */
    
    --border-color: #222f47;    /* Dark border */
    --border-focus: #4f46e5;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --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.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
}

/* CSS Reset & General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

ul {
    list-style: none;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding {
    padding: 5rem 0;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 3rem 0;
    }
}

/* Sticky Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

.logo svg {
    stroke: url(#logo-grad);
    stroke-width: 2.5;
    fill: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle Switch */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    color: var(--text-muted);
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

.theme-toggle-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.theme-toggle-btn .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .sun-icon {
    display: block;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.mobile-menu-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
    stroke-width: 2;
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
    position: fixed;
    top: 4.5rem;
    left: 0;
    width: 100%;
    height: calc(100vh - 4.5rem);
    background: var(--bg-card);
    z-index: 90;
    padding: 2rem 1.5rem;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-nav-drawer.open {
    transform: translateX(0);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-nav-links a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
}

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

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .mobile-menu-btn {
        display: flex;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-size: 0.875rem;
}

.breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.breadcrumbs-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumbs-list a {
    color: var(--text-muted);
}

.breadcrumbs-list a:hover {
    color: var(--primary);
}

.breadcrumbs-list li::after {
    content: "/";
    color: var(--text-light);
}

.breadcrumbs-list li:last-child {
    color: var(--text-main);
    font-weight: 600;
}

.breadcrumbs-list li:last-child::after {
    display: none;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 6rem 0 4rem;
    text-align: center;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 40%),
                radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.05), transparent 40%);
    overflow: hidden;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

[data-theme="dark"] .hero-badge {
    background: rgba(99, 102, 241, 0.15);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.search-box-wrapper {
    position: relative;
    max-width: 580px;
    margin: 0 auto;
}

.search-box-wrapper svg {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 1.25rem 1.25rem 1.25rem 3.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-lg);
    font-size: 1.125rem;
    outline: none;
    transition: all var(--transition-fast);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

@media (max-width: 768px) {
    .hero {
        padding: 4rem 0 3rem;
    }
    .hero-title {
        font-size: 2.25rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

/* Category Grid & Tabs */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.category-tab {
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.category-tab:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.category-tab.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

/* Cards & Grid Styles */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

.tool-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-focus);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
    color: var(--primary);
    margin-bottom: 1.5rem;
    transition: all var(--transition-fast);
}

[data-theme="dark"] .tool-card-icon {
    background-color: rgba(99, 102, 241, 0.15);
}

.tool-card:hover .tool-card-icon {
    transform: scale(1.1);
}

.tool-card-icon svg {
    width: 1.75rem;
    height: 1.75rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.tool-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.tool-card-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.tool-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.tool-card-link svg {
    width: 1.125rem;
    height: 1.125rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform var(--transition-fast);
}

.tool-card:hover .tool-card-link svg {
    transform: translateX(4px);
}

/* Secondary Button style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-align: center;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Sidebar Layout */
.sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2.5rem;
    margin: 2.5rem auto;
}

@media (max-width: 1024px) {
    .sidebar-layout {
        grid-template-columns: 1fr;
    }
}

.main-content {
    min-width: 0; /* Prevents flex items from stretching past container */
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.sidebar-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-list-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

.sidebar-list-item svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Google AdSense Compliance Placeholders */
.ad-container {
    background-color: var(--bg-body);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 2rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ad-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.ad-slot {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(0, 0, 0, 0.02);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .ad-slot {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.03);
}

.ad-header-placement {
    margin: 1.5rem 0 0.5rem;
    min-height: 90px;
    width: 100%;
}

.ad-sidebar-placement {
    min-height: 280px;
    width: 100%;
}

.ad-content-placement {
    min-height: 120px;
    width: 100%;
}

.ad-footer-placement {
    min-height: 90px;
    width: 100%;
    margin-bottom: 0;
}

/* FAQ Accordion */
.faq-section {
    margin-top: 4rem;
}

.faq-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    text-align: left;
    font-size: 1.05rem;
}

.faq-question:hover {
    color: var(--primary);
}

.faq-answer {
    padding: 0 1.5rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.975rem;
    line-height: 1.6;
    display: none;
}

.faq-item.active {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-sm);
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-item svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform var(--transition-fast);
}

.faq-item.active svg {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Structured Article Content */
.rich-text-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    margin-top: 3rem;
    box-shadow: var(--shadow-sm);
    line-height: 1.75;
}

.rich-text-content h2 {
    font-size: 1.75rem;
    font-weight: 8500;
    margin: 2.5rem 0 1.25rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.rich-text-content h2:first-of-type {
    margin-top: 0;
}

.rich-text-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
}

.rich-text-content p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.rich-text-content ul, 
.rich-text-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.rich-text-content li {
    margin-bottom: 0.5rem;
}

.rich-text-content code {
    font-family: SFMono-Regular, Consolas, Monaco, monospace;
    font-size: 0.875rem;
    background-color: var(--bg-body);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.rich-text-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.rich-text-content th, 
.rich-text-content td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.rich-text-content th {
    background-color: var(--bg-body);
    font-weight: 700;
    color: var(--text-main);
}

.rich-text-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    background-color: var(--bg-body);
    margin: 2rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .rich-text-content {
        padding: 1.75rem;
    }
}

/* Footer Section */
.footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 5rem 0 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 4rem;
    margin-bottom: 4rem;
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1.5fr repeat(3, 1fr);
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 320px;
}

.footer-socials {
    display: flex;
    gap: 1rem;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.footer-social-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.footer-social-link svg {
    width: 1.125rem;
    height: 1.125rem;
    fill: currentColor;
}

.footer-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-legal-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

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

@media (max-width: 480px) {
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}
