/* ==========================================================================
   Base Variables & Theming
   ========================================================================== */
:root {
    /* Light Mode */
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --nav-bg: #ffffff;
    --primary-color: #4361ee;
    --primary-hover: #3a53d0;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
    
    /* Blog specific text colors */
    --text-muted: #6b7280;
}

[data-theme="dark"] {
    /* Dark Mode */
    --bg-color: #121212;
    --text-color: #f8f9fa;
    --nav-bg: #1e1e1e;
    --primary-color: #4cc9f0;
    --primary-hover: #3ab0d3;
    --card-bg: #242424;
    --border-color: #333333;
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* ==========================================================================
   Reset & Global
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden; 
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
header {
    background-color: var(--nav-bg);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 100;
    transition: var(--transition);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap; 
}

.logo {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: bold;
    text-decoration: none;
    color: var(--text-color);
    white-space: nowrap;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2vw, 2rem);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition);
}

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

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%); 
    background-color: var(--card-bg);
    min-width: 180px;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    z-index: 10;
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: var(--bg-color);
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* Theme Toggle */
#theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    color: var(--text-color);
}

#theme-toggle:hover {
    background-color: var(--border-color);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    width: auto;
}

.primary-btn {
    background-color: var(--primary-color);
    color: #fff;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* ==========================================================================
   Blog Articles
   ========================================================================== */
.article-container {
    max-width: 720px;
    margin: 4rem auto 6rem;
    padding: 0 1.5rem;
    text-align: left;
}

.article-header {
    margin-bottom: 3.5rem;
    text-align: left;
}

.article-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-color, #111827);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color, #374151);
    word-wrap: break-word;
    text-align: left;
}

.article-content p {
    margin-top: 0;
    margin-bottom: 1.75rem;
}

.article-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-color, #111827);
    margin-top: 3.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    text-align: left;
    padding-left: 0.9rem;
    border-left: 4px solid var(--primary-color, #2563eb);
}

.article-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--primary-color, #2563eb);
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.article-content strong {
    font-weight: 600;
    color: var(--text-color, #111827);
}

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

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

/* Tool Promo Callout Box */
.tool-promo {
    background-color: var(--card-bg, #f9fafb);
    border-radius: 8px;
    padding: 2.5rem 2rem;
    text-align: left;
    margin: 3.5rem 0;
}

.tool-promo h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.tool-promo p {
    font-size: 1rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 1.5rem;
}

/* Table Styling for Comparisons */
.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.5rem 0;
    font-size: 1rem;
    text-align: left;
}

.article-table th, 
.article-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.article-table th {
    background-color: var(--card-bg, #f9fafb);
    color: var(--primary-color, #2563eb);
    font-weight: 600;
}

.article-table tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}


/* ==========================================================================
   HOMEPAGE SECTIONS (Kept intact for index.html compatibility)
   ========================================================================== */
.hero {
    text-align: center;
    padding: clamp(3rem, 10vw, 6rem) 5% clamp(2rem, 8vw, 4rem);
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    opacity: 0.8;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap; 
}

.secondary-btn {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.secondary-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.about-section, 
.tools-section, 
.articles-section, 
.faq-section {
    padding: clamp(2rem, 5vw, 4rem) 5%;
    max-width: 1000px;
    margin: 0 auto;
}

.about-section {
    max-width: 800px;
    text-align: center;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
    text-align: center;
}

.section-subtitle {
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0.8;
    font-size: 1.1rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.tool-card, 
.article-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tool-card:hover, 
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.tool-card {
    text-align: center;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.article-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.article-card p {
    opacity: 0.8;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1; 
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: auto;
}

.view-all-container {
    text-align: center;
    margin-top: 3rem;
}

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

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

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 1.5rem;
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 500px; 
    padding-bottom: 1.5rem;
    opacity: 1;
    transition: max-height 0.4s ease-in, opacity 0.4s ease-in;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.trust-footer {
    text-align: center;
    padding: 3rem 5% 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--card-bg);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 3vw, 2rem);
    margin-bottom: 1.5rem;
    flex-wrap: wrap; 
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.8;
    transition: var(--transition);
}

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

.footer-copy {
    opacity: 0.6;
    font-size: 0.9rem;
}

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

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* ==========================================================================
   Mobile-Specific Overrides (Media Queries)
   ========================================================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 5%;
    }
    
    .nav-links {
        order: 3; 
        width: 100%;
        margin-top: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    #theme-toggle {
        margin-left: auto; 
    }

    .dropdown-content {
        left: 0;
        transform: none;
    }
}

@media (max-width: 640px) {
    .article-header h1 {
        font-size: 1.95rem;
    }
    
    .article-content {
        font-size: 1.05rem;
        line-height: 1.7;
    }
    
    .article-content h2 {
        font-size: 1.25rem;
        margin-top: 2.5rem;
        padding-left: 0.75rem;
    }
    
    .article-content h3 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%; 
        text-align: center;
    }

    .card-grid {
        grid-template-columns: 1fr; 
    }
    
    .faq-question {
        padding: 1.25rem 1rem;
    }
    
    .faq-answer {
        padding: 0 1rem;
    }
}