/* ==========================================================================
   GLOBAL VARIABLES & RESET
   ========================================================================== */
:root { 
    --primary: #0f172a; 
    --secondary: #334155; 
    --accent: #3b82f6; 
    --accent-hover: #1d4ed8; 
    --bg: #f8fafc; 
    --surface: #ffffff; 
    --border: #e2e8f0; 
    --text: #334155; 
    --text-light: #64748b; 
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background-color: var(--bg); 
    color: var(--text); 
    overflow-x: hidden;
    line-height: 1.6;
}

a { text-decoration: none; }

/* ==========================================================================
   NAVIGATION & DROPDOWN
   ========================================================================== */
nav {
    position: fixed; top: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border); z-index: 1000;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 5%; transition: all 0.3s ease;
}

.brand { font-size: 1.5rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 0.5rem; }
nav .brand { position: relative; z-index: 1001; }
.brand img { width: 32px; height: 32px; display: block; }

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { color: var(--secondary); font-weight: 600; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); }

/* Dropdown Desktop */
.dropdown { position: relative; display: flex; align-items: center; }
.dropbtn { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.dropbtn a { flex-grow: 1; }
.dropdown-toggle { padding: 10px; cursor: pointer; display: flex; align-items: center; transition: transform 0.3s ease; }

.dropdown-content {
    display: none; position: absolute; top: 100%; left: 0;
    background-color: var(--surface); min-width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-radius: 0.5rem;
    border: 1px solid var(--border); flex-direction: column;
    z-index: 1001; overflow: hidden; margin-top: 15px; 
}

/* Invisible bridge */
.dropdown::after { content: ''; position: absolute; top: 100%; left: 0; width: 100%; height: 15px; background: transparent; }

.dropdown-content a { padding: 12px 16px; color: var(--secondary); font-weight: 500; border-bottom: 1px solid var(--border); transition: background 0.2s, color 0.2s; }
.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:hover { background-color: var(--bg); color: var(--accent); }

/* Hover opens on Desktop */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-content { display: flex; animation: fadeIn 0.2s ease-in-out; }
}

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

/* Mobile Nav Utilities */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; z-index: 1001; padding: 5px; }
.hamburger span { width: 25px; height: 3px; background-color: var(--primary); border-radius: 3px; transition: all 0.3s ease; }
.nav-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(2px); z-index: 999; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.nav-overlay.show { opacity: 1; visibility: visible; }

/* ==========================================================================
   BUTTONS & GENERAL UTILITIES
   ========================================================================== */
.btn-primary, .btn-secondary, .btn-nav { border-radius: 0.5rem; font-weight: 700; cursor: pointer; transition: all 0.3s ease; }
.btn-primary { padding: 1rem 2rem; font-size: 1.1rem; background: var(--accent); color: white; border: none; box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-3px); box-shadow: 0 15px 25px rgba(37, 99, 235, 0.4); }
.btn-secondary { padding: 1rem 2rem; font-size: 1.1rem; background: white; color: var(--primary); border: 2px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.btn-nav { padding: 0.5rem 1.25rem; background: var(--accent); color: white !important; font-weight: 600; border: none; }
.btn-nav:hover { background: var(--accent-hover); transform: translateY(-2px); }

.container { max-width: 1200px; margin: 0 auto; padding: 60px 5%; }
.section { padding: 6rem 5%; max-width: 1400px; margin: 0 auto; }
h2.section-title, .section-title { text-align: center; font-size: 2.5rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; }
p.section-subtitle, .section-subtitle { text-align: center; font-size: 1.1rem; color: var(--text-light); margin-bottom: 4rem; }

/* Page Header */
.page-header { text-align: center; padding: 120px 5% 40px; background: radial-gradient(circle at top, #e0f2fe 0%, var(--bg) 100%); border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 3rem; font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.page-header p { font-size: 1.2rem; color: var(--text-light); max-width: 600px; margin: 0 auto; }

/* Feature Icons */
.feature-icon { width: 60px; height: 60px; background: #eff6ff; color: var(--accent); border-radius: 1rem; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem; transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease; }
.feature-icon svg { width: 32px; height: 32px; }
.feature-card:hover .feature-icon, .use-case-card:hover .feature-icon { transform: scale(1.1) rotate(3deg); background: var(--accent); color: white; }

/* ==========================================================================
   LANDING PAGE SECTIONS (index.html)
   ========================================================================== */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 6rem 1rem 2rem 1rem; background: radial-gradient(circle at top, #e0f2fe 0%, var(--bg) 60%); position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 50px 50px; opacity: 0.4; z-index: -1; transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px); animation: gridMove 15s linear infinite; }
@keyframes gridMove { 0% { background-position: 0 0; } 100% { background-position: 0 50px; } }
.hero h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 800; color: var(--primary); margin-bottom: 1.5rem; line-height: 1.1; letter-spacing: -1px; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.25rem; color: var(--text-light); max-width: 600px; margin-bottom: 2.5rem; }
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.feature-card { background: var(--surface); padding: 2.5rem; border-radius: 1rem; border: 1px solid var(--border); box-shadow: 0 4px 6px rgba(0,0,0,0.02); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden; z-index: 1; }
.feature-card::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 0%; background: linear-gradient(to bottom, #eff6ff, transparent); z-index: -1; transition: height 0.4s ease; }
.feature-card:hover { transform: translateY(-10px); border-color: #bfdbfe; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.feature-card:hover::after { height: 100%; }
.feature-card h3 { font-size: 1.3rem; margin-bottom: 1rem; color: var(--primary); }
.feature-card p { color: var(--text-light); font-size: 0.95rem; }

.workflow { background: var(--primary); color: white; padding: 6rem 5%; text-align: center; }
.workflow h2 { font-size: 2.5rem; margin-bottom: 3rem; }
.steps { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; }
.step { flex: 1; min-width: 250px; max-width: 300px; }
.step-num { width: 50px; height: 50px; background: var(--accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800; margin: 0 auto 1.5rem auto; box-shadow: 0 0 20px rgba(37, 99, 235, 0.5); }
.step h3 { font-size: 1.2rem; margin-bottom: 1rem; }
.step p { color: #94a3b8; font-size: 0.95rem; }

.faq-wrapper { max-width: 800px; margin: 0 auto; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; margin-bottom: 1rem; overflow: hidden; transition: all 0.3s ease; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.faq-item:hover { border-color: var(--accent); }
details summary { padding: 1.5rem; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; color: var(--primary); font-size: 1.1rem; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '＋'; color: var(--accent); font-size: 1.2rem; font-weight: bold; transition: transform 0.3s ease; }
details[open] summary::after { transform: rotate(45deg); }
details[open] { border-color: var(--accent); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); }
.faq-content { padding: 0 1.5rem 1.5rem 1.5rem; color: var(--text-light); font-size: 1rem; line-height: 1.6; }
.faq-content ul { margin-left: 1.5rem; margin-top: 0.5rem; }
.faq-content hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.clause-tag { display: inline-block; background: #e0f2fe; color: #0369a1; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; font-family: monospace; font-weight: 600; margin-right: 6px; }

.cta-section { text-align: center; padding: 6rem 5%; background: linear-gradient(135deg, #e0f2fe 0%, #ffffff 100%); }
.cta-section h2 { font-size: 2.5rem; color: var(--primary); margin-bottom: 1.5rem; }
.cta-section p { color: var(--secondary); margin-bottom: 2.5rem; font-size: 1.1rem; }

/* ==========================================================================
   RESOURCES PAGE SECTIONS
   ========================================================================== */
.use-cases { background-color: var(--surface); border-bottom: 1px solid var(--border); }
.use-cases-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.use-case-card { background: var(--bg); padding: 30px; border-radius: 12px; border: 1px solid var(--border); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.use-case-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: #bfdbfe; }
.use-case-card h3 { color: var(--primary); margin-bottom: 10px; font-size: 1.3rem; }
.use-case-card p { color: var(--text-light); font-size: 0.95rem; }

.feature-row { display: flex; align-items: center; gap: 50px; margin-bottom: 80px; }
.feature-row:nth-child(even) { flex-direction: row-reverse; }
.feature-text { flex: 1; }
.feature-text h3 { font-size: 1.8rem; margin-bottom: 15px; color: var(--primary); }
.feature-text p { color: var(--text-light); margin-bottom: 20px; }
.feature-text ul { list-style: none; }
.feature-text li { position: relative; padding-left: 25px; margin-bottom: 10px; color: var(--text); font-weight: 500; }
.feature-text li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: bold; }
.feature-visual { flex: 1; background: var(--surface); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.feature-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

.knowledge-base { background-color: var(--bg); border-top: 1px solid var(--border); }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.kb-card { background: var(--surface); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); transition: all 0.3s ease; }
.kb-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); border-color: #bfdbfe; }
.kb-image { height: 180px; background-color: var(--border); width: 100%; object-fit: cover; }
.kb-content { padding: 25px; }
.kb-tag { display: inline-block; background: #e0f2fe; color: var(--accent); font-size: 0.8rem; padding: 4px 10px; border-radius: 6px; margin-bottom: 15px; font-weight: 700; letter-spacing: 0.5px; }
.kb-title { font-size: 1.2rem; margin: 0 0 10px 0; color: var(--primary); line-height: 1.4; }
.kb-desc { color: var(--text-light); font-size: 0.95rem; margin-bottom: 20px; }
.kb-link { text-decoration: none; color: var(--accent); font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 5px; transition: gap 0.2s; }
.kb-card:hover .kb-link { gap: 10px; }

/* ==========================================================================
   ARTICLE LIBRARY SECTIONS (Articles.html)
   ========================================================================== */
.controls-section { padding: 2rem 5%; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 70px; z-index: 99; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.02); }
.controls-container { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }

.search-wrapper { position: relative; max-width: 500px; width: 100%; margin: 0 auto; }
.search-wrapper svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-light); width: 20px; height: 20px; }
.search-input { width: 100%; padding: 14px 20px 14px 45px; border-radius: 50px; border: 1px solid var(--border); background: var(--bg); font-size: 1rem; color: var(--text); transition: all 0.3s ease; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }
.search-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }

.filter-group { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.filter-btn { background: white; border: 1px solid var(--border); color: var(--secondary); padding: 8px 16px; border-radius: 50px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.filter-btn:hover { border-color: var(--accent); color: var(--accent); background: #eff6ff; }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.articles-section { padding: 4rem 5%; min-height: 50vh; }
.articles-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }

.article-card { background: var(--surface); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); transition: all 0.3s ease; display: flex; flex-direction: column; position: relative; }
.article-card:hover { transform: translateY(-8px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); border-color: #bfdbfe; }
.card-image-wrapper { position: relative; height: 200px; overflow: hidden; }
.card-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.article-card:hover .card-image { transform: scale(1.05); }

.bookmark-btn { position: absolute; top: 15px; right: 15px; background: rgba(255,255,255,0.9); border: none; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-light); transition: all 0.2s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.1); z-index: 2; }
.bookmark-btn:hover { color: var(--accent); transform: scale(1.1); }

.card-content { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.card-tag { background: #e0f2fe; color: var(--accent); font-size: 0.8rem; padding: 4px 10px; border-radius: 6px; font-weight: 700; letter-spacing: 0.5px; }
.read-time { font-size: 0.85rem; color: var(--text-light); display: flex; align-items: center; gap: 4px; }
.card-title { font-size: 1.25rem; margin: 0 0 10px 0; color: var(--primary); line-height: 1.4; }
.card-desc { color: var(--text-light); font-size: 0.95rem; margin-bottom: 25px; flex-grow: 1; }
.card-link { text-decoration: none; color: var(--accent); font-weight: 600; font-size: 0.95rem; display: inline-flex; align-items: center; gap: 5px; transition: gap 0.2s; margin-top: auto; }
.article-card:hover .card-link { gap: 10px; }

.no-results { text-align: center; grid-column: 1 / -1; padding: 4rem 1rem; color: var(--text-light); display: none; }
.no-results svg { width: 48px; height: 48px; margin-bottom: 1rem; opacity: 0.5; }

/* ==========================================================================
   FOOTER & COOKIES
   ========================================================================== */
footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 5%; text-align: center; color: var(--text-light); }
.footer-links { margin-top: 1rem; display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { color: var(--secondary); font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }

.cookie-banner { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -10px 30px rgba(0,0,0,0.05); padding: 1.5rem 5%; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; z-index: 9998; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.cookie-banner.show { transform: translateY(0); }
.cookie-content { flex: 1 1 300px; }
.cookie-content h4 { color: var(--primary); margin-bottom: 0.25rem; font-size: 1.1rem; }
.cookie-content p { color: var(--text-light); font-size: 0.85rem; margin: 0; line-height: 1.4; }
.cookie-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn-cookie-solid, .btn-cookie-outline { padding: 0.6rem 1.2rem; border-radius: 0.4rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-cookie-solid { background: var(--accent); color: white; border: none; }
.btn-cookie-solid:hover { background: var(--accent-hover); }
.btn-cookie-outline { background: transparent; color: var(--secondary); border: 1px solid var(--border); }
.btn-cookie-outline:hover { background: var(--bg); border-color: var(--secondary); }

.cookie-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); z-index: 9999; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.cookie-modal-overlay.show { opacity: 1; visibility: visible; }
.cookie-modal { background: var(--surface); width: 90%; max-width: 500px; border-radius: 1rem; padding: 2rem; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); transform: scale(0.95); transition: transform 0.3s ease; }
.cookie-modal-overlay.show .cookie-modal { transform: scale(1); }
.cookie-toggle-group { border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem; margin-bottom: 1rem; }
.cookie-toggle-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border); transition: .3s; border-radius: 24px; }
.toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
.toggle-switch input:checked + .toggle-slider { background-color: var(--success, #22c55e); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }
.toggle-slider.disabled { background-color: var(--success, #22c55e); opacity: 0.5; cursor: not-allowed; }
.cookie-modal-footer { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .page-header h1 { font-size: 2.2rem; }
    
    .hamburger { display: flex; }
    .nav-links { position: fixed; top: 0; right: -100%; width: 260px; height: 100vh; background-color: var(--surface); flex-direction: column; align-items: flex-start; padding: 80px 20px 20px 20px; box-shadow: -5px 0 25px rgba(0,0,0,0.1); transition: right 0.3s ease; z-index: 1000; }
    .nav-links.open { right: 0; }
    
    .nav-links > a, .dropdown { width: 100%; border-bottom: 1px solid var(--border); }
    .nav-links > a { padding: 12px 0; font-size: 1.1rem; }
    
    /* Mobile Dropdown Overrides */
    .dropdown { flex-direction: column; align-items: flex-start; padding: 0; }
    .dropbtn { padding: 0; } 
    .dropbtn a { padding: 12px 0; font-size: 1.1rem; }
    
    .dropdown-content {
        position: static; box-shadow: none; border: none; border-radius: 0;
        width: 100%; margin-top: 0; padding-left: 15px; 
        border-left: 2px solid var(--border); margin-left: 10px; margin-bottom: 0;
        /* Hidden by default on mobile, display managed by JS */
        display: none; 
    }
    .dropdown-content.show { display: flex; margin-bottom: 10px; animation: fadeIn 0.2s ease-in-out; }
    
    .dropdown::after { display: none; } /* Remove bridge on mobile */
    .dropdown-content a { padding: 10px 0; font-size: 1rem; }
    
    /* Rotate arrow when open */
    .dropdown-toggle.rotate svg { transform: rotate(180deg); }

    .nav-links .btn-nav { margin-top: 20px; text-align: center; border-bottom: none; }

    .hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.open span:nth-child(2) { opacity: 0; }
    .hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .feature-row, .feature-row:nth-child(even) { flex-direction: column; gap: 30px; }
   .filter-group{display:none;}
}
