/* ==========================================================================
   Schengen Visa Support - Main Stylesheet
   Professional, clean design for trust and credibility
   ========================================================================== */

/* Import Poppins Font with font-display swap for better performance */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --bg-lighter: #f3f4f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --max-width: 1200px;
    --spacing: 1rem;
    --border-radius: 6px;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.2s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%;
}

*,
*::before,
*::after {
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: 120px; /* Account for sticky header + breadcrumb */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
}

/* Container */
.container {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--secondary-color);
}

h2 {
    font-size: 1.35rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--primary-color);
    color: var(--secondary-color);
}

h3 {
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

h4 {
    font-size: 1rem;
    font-weight: 600;
}

p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    font-size: 0.9rem;
}

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

a:hover {
    color: var(--secondary-color);
}

/* Header */
header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--box-shadow);
}

header .container,
header .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    display: flex;
    align-items: center;
}

/* Logo as link (for older pages) */
a.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.2s;
    line-height: 1;
}

.logo a:hover {
    opacity: 0.85;
}

.logo strong {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: inline-block;
    line-height: 1.2;
}

.logo img {
    height: 40px;
    width: auto;
}

/* Navigation */
/* nav {
    display: flex;
    align-items: center;
} */

nav ul,
nav .nav-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    /* align-items: center; */
    margin: 0;
    padding: 0;
}

nav li {
    display: flex;
    align-items: center;
}

nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1;
    display: inline-block;
}

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

/* Dropdown Navigation */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-block;
}

.dropdown-toggle:hover {
    color: var(--primary-color);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-md);
    min-width: 200px;
    z-index: 1001;
    padding: 0.5rem 0;
    flex-direction: column;
}

.dropdown:hover .dropdown-menu {
    display: flex;
}

.dropdown-menu li {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    font-size: 0.85rem;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-color);
}

.language-switcher a {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    border-radius: 3px;
    text-transform: uppercase;
}

.language-switcher a:hover,
.language-switcher a.active {
    color: var(--primary-color);
    background-color: var(--bg-light);
}

/* Language flag icons */
.lang-flag {
    width: 20px;
    height: 15px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.25rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    min-height: 48px;
}

.breadcrumb .container {
    overflow: hidden;
}

.breadcrumb ol {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    min-height: 40px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    gap: 0.5rem;
}

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

.breadcrumb li::after {
    content: "›";
    color: var(--text-light);
    font-size: 1.1em;
}

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

.breadcrumb li:last-child {
    color: var(--text-color);
    font-weight: 500;
}

.breadcrumb a {
    color: var(--text-light);
    transition: color 0.2s;
}

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

/* Main Content Layout */
main {
    padding: 0.5rem 0;
    min-height: 60vh;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* When main has container child, remove main padding */
main > .container {
    padding-left: 0;
    padding-right: 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
}

/* Article Content */
article.main-content {
    max-width: 800px;
    width: 100%;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.sidebar .widget,
.sidebar-section {
    background-color: var(--bg-light);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.sidebar .widget h3,
.sidebar-section h3 {
    font-size: 0.95rem;
    margin-top: 0;
    margin-bottom: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar .widget ul,
.sidebar-section ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.sidebar .widget li,
.sidebar-section li {
    margin-bottom: 0.5rem;
}

.sidebar .widget a,
.sidebar-section a {
    display: block;
    padding: 0.35rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-light);
    transition: color 0.2s;
}

.sidebar .widget a:hover,
.sidebar-section a:hover {
    color: var(--primary-color);
}

/* Responsive - Hide sidebar on mobile */
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
}

.meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.intro {
    font-size: 1rem;
    color: var(--text-color);
    padding: 1rem 1.25rem;
    background-color: var(--bg-light);
    border-left: 3px solid var(--primary-color);
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    line-height: 1.6;
}

/* Table of Contents */
.toc {
    background-color: var(--bg-light);
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
}

.toc h2 {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0;
    font-weight: 600;
    border-bottom: none;
    padding-bottom: 0;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.toc h2:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.toc ul {
    list-style: none;
    padding-left: 1rem;
    margin-top: 0.75rem;
    margin-bottom: 0;
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out, margin-top 0.3s ease-out;
    opacity: 1;
}

.toc.collapsed ul {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.toc.collapsed .toc-toggle {
    transform: rotate(0deg);
}

.toc:not(.collapsed) .toc-toggle {
    transform: rotate(90deg);
}

.toc .toc-toggle {
    transition: transform 0.3s ease;
    display: inline-block;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.toc li {
    margin-bottom: 0.35rem;
}

.toc a {
    display: block;
    padding: 0.2rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Content Sections */
section {
    margin-bottom: 2.5rem;
}

section:last-child {
    margin-bottom: 0;
}

/* Callout Boxes */
.tip-box,
.important-box,
.note-box,
.warning-box {
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
    border-left: 4px solid;
    line-height: 1.6;
}

.tip-box {
    background-color: #eff6ff;
    border-color: var(--info-color);
}

.important-box {
    background-color: #fee2e2;
    border-color: var(--danger-color);
}

.note-box {
    background-color: #fffbeb;
    border-color: var(--warning-color);
}

.warning-box {
    background-color: #fef2f2;
    border-color: var(--danger-color);
}

/* Lists */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    display: table;
    table-layout: auto;
}

/* Table wrapper for mobile scrolling */
@media (max-width: 767px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    
    table thead,
    table tbody,
    table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
}

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

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

tbody tr:nth-child(even) {
    background-color: var(--bg-light);
}

tbody tr:hover {
    background-color: #f0f0f0;
}

/* FAQ Section */
.faq-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

/* Related Pages Grid */
.related-grid,
.tool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.related-card,
.tool-card {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    background-color: var(--bg-color);
    box-shadow: var(--box-shadow);
    display: block;
    text-decoration: none;
    color: var(--text-color);
}

.related-card:hover,
.tool-card:hover {
    box-shadow: var(--box-shadow-md);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.related-card h3,
.related-card h4,
.tool-card h4 {
    margin-top: 0;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.related-card a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.related-card p,
.tool-card p {
    color: var(--text-light);
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Related tools section */
.related-tools {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
}

.related-tools h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Sidebar */
aside.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.widget {
    background-color: var(--bg-light);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
}

.widget h3 {
    margin-top: 0;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.widget ul {
    list-style: none;
    padding-left: 0;
}

.widget li {
    margin-bottom: 0.75rem;
}

/* Ad Slots */
.ad-slot {
    margin-bottom: 1.5rem;
    text-align: center;
    /* HIDDEN - Remove display:none below to show ads */
    display: none;
}

.ad-slot.sticky {
    position: sticky;
    top: 100px;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 2rem;
}

footer .container,
footer .footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

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

.footer-col h4,
.footer-section h3,
.footer-column h4 {
    color: white;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    border-bottom: none;
}

.footer-col ul,
.footer-section ul,
.footer-column ul {
    list-style: none;
    padding-left: 0;
}

.footer-col li,
.footer-section li,
.footer-column li {
    margin-bottom: 0.35rem;
}

.footer-col a,
.footer-section a,
.footer-column a {
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
}

.footer-col a:hover,
.footer-section a:hover,
.footer-column a:hover {
    color: white;
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

.footer-bottom small {
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

.btn:hover {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: var(--box-shadow-md);
}

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

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

/* Responsive Design */
@media (min-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .related-grid,
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .footer-grid,
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr 300px;
    }
    
    .related-grid,
    .tool-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .footer-grid,
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .related-grid,
    .tool-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    
    .footer-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Mobile Navigation */
@media (max-width: 767px) {
    .logo a,
    a.logo {
        font-size: 0.95rem;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    nav ul,
    nav .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        border-bottom: 1px solid var(--border-color);
        padding: 0.5rem;
        gap: 0;
        box-shadow: var(--box-shadow-md);
        max-height: 70vh;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 1000;
    }
    
    nav ul.active,
    nav .nav-menu.active {
        display: flex;
    }
    
    nav li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    nav li:last-child {
        border-bottom: none;
    }
    
    nav a {
        display: block;
        padding: 0.75rem 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 0.9rem;
    }
    
    /* Mobile dropdown styles */
    .dropdown-toggle {
        display: block;
        padding: 0.75rem 1rem;
        width: 100%;
        font-size: 0.9rem;
        cursor: pointer;
    }
    
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background-color: var(--bg-light);
        padding: 0;
        min-width: 100%;
    }
    
    .dropdown.active .dropdown-menu {
        display: flex;
    }
    
    .dropdown-menu a {
        padding: 0.6rem 1rem 0.6rem 2rem;
        font-size: 0.85rem;
    }
    
    /* Mobile language switcher */
    .language-switcher {
        border-left: none;
        margin-left: 0;
        padding: 1rem;
        justify-content: center;
        border-top: 1px solid var(--border-color);
    }
    
    aside.sidebar {
        position: static;
    }
    
    /* Mobile container adjustments */
    .container {
        padding: 0 1.25rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Mobile typography adjustments */
    h1 {
        font-size: 1.5rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
        margin-top: 2rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        margin-bottom: 1rem;
    }
    
    h3 {
        font-size: 1.25rem;
        margin-top: 1.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Mobile content adjustments */
    .intro {
        padding: 1rem;
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .toc {
        padding: 0.875rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .related-card {
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    .widget {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Ensure text doesn't overflow */
    p, li, td, th, span, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
    }
    
    /* Table responsiveness */
    table {
        font-size: 0.875rem;
        width: 100%;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    th, td {
        padding: 0.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        min-width: 80px;
    }
    
    /* Form elements */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        width: 100%;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    main {
        overflow-x: hidden;
    }
    
    /* Long URLs and text */
    a {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Code blocks and pre */
    pre, code {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: pre-wrap;
        font-size: 0.875rem;
    }
    
    /* Hero section mobile adjustments */
    .hero {
        padding: 2rem 1rem !important;
        margin-bottom: 2rem !important;
    }
    
    .hero h1 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .hero p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .hero .btn {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.9rem !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: nowrap;
    }
}

/* Print Styles */
@media print {
    header, footer, .breadcrumb, aside, .ad-slot, .mobile-menu-toggle {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
/* Compact Country List */
.country-list-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.country-list-compact span {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-lighter);
    border-radius: 4px;
    white-space: nowrap;
}

/* Compact Grid for Country Cards */
.country-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.country-card-compact {
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.country-card-compact strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.country-card-compact p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

@media (max-width: 767px) {
    .country-grid-compact {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .country-card-compact {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}
/* Forms */
.contact-form {
    max-width: 600px;
    margin: 2rem 0;
}

/* Images and Media - Prevent overflow */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

iframe, video, embed, object {
    max-width: 100%;
    height: auto;
}

/* Code blocks - Prevent overflow */
pre {
    overflow-x: auto;
    word-wrap: normal;
    white-space: pre;
    max-width: 100%;
    font-size: 0.875rem;
}

code {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    background-color: var(--bg-color);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Focus Styles */
a:focus,
button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }

/* Reduced Motion - Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-light: #333;
    }
    
    h1, h2, h3 {
        color: #000;
    }
    
    a {
        text-decoration: underline;
    }
}

/* Improved Link Visibility for Accessibility */
article a:not(.btn) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

article a:not(.btn):hover {
    text-decoration-thickness: 2px;
}

/* Focus-visible for keyboard users only */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Ensure minimum touch target size - 44x44px for mobile */
@media (max-width: 767px) {
    nav a,
    .btn,
    .sidebar a,
    .toc a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: var(--box-shadow-md);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    border: 2px solid white;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top span {
    line-height: 1;
    display: block;
}

/* Mobile adjustments for back to top */
@media (max-width: 767px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
    
    /* Mobile Breadcrumb */
    .breadcrumb {
        min-height: 40px;
    }
    
    .breadcrumb ol {
        font-size: 0.8rem;
        min-height: 36px;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        gap: 0.25rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .breadcrumb ol::-webkit-scrollbar {
        display: none;
    }
    
    .breadcrumb li {
        white-space: nowrap;
        flex-shrink: 0;
        gap: 0.25rem;
    }
    
    .breadcrumb li::after {
        font-size: 1em;
    }
    
    /* Mobile overflow fixes */
    body, html {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
        max-width: 100%;
    }
    
    /* Ensure all content elements respect container */
    .main-content > *,
    .content-wrapper > *,
    article > * {
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
    
    /* Fix images */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Fix pre and code blocks */
    pre, code {
        max-width: 100%;
        overflow-x: auto;
        word-wrap: normal;
    }
}

/* ==========================================================================
   BMI Calculator Specific Styles
   ========================================================================== */

/* Calculator Container - STANDARDIZED COMPACT SIZE */
.calculator-container,
.calculator-section,
.calculator-card {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-md);
    padding: 1rem;
    margin: 1rem auto;
    max-width: 380px;
}

.calculator-container h2,
.calculator-section h2,
.calculator-card h2,
.calculator-header h2 {
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 1rem;
    border-bottom: none;
}

.calculator-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Unit toggle button style (for pages using button-based toggles) */
.unit-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    cursor: pointer;
    font-size: 0.75rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.unit-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.unit-btn:hover:not(.active) {
    background-color: var(--bg-lighter);
}

/* Input group for combined input + unit label */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group input {
    flex: 1;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    border-right: none;
    padding: 0.4rem;
    font-size: 0.85rem;
}

.input-group .unit-label {
    padding: 0.4rem 0.6rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
}

/* CTA Section */
.cta-section {
    background-color: var(--bg-light);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    margin: 1.25rem 0;
}

.cta-section h2 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    text-align: center;
}

/* Calculator Form */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.unit-toggle {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 0.5rem;
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
}

.unit-toggle label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.8rem;
}

.form-group input[type="number"] {
    padding: 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-family: inherit;
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-calculate {
    background-color: var(--primary-color);
    color: white;
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Calculate button alternate class */
.calculate-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

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

/* Result value container */
.result-value {
    text-align: center;
    padding: 0.75rem;
}

.result-value .label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.2rem;
}

.result-value .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Category badge */
.category-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    margin: 0.35rem 0;
}

/* Description */
.description {
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
}

/* Category info box */
.category-info {
    background-color: var(--bg-light);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin: 0.75rem 0;
    border-left: 3px solid var(--primary-color);
}

/* BMI Result */
.bmi-result {
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    text-align: center;
    margin-top: 0.5rem;
}
.bmi-result.hidden {
    display: none;
}

.bmi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.bmi-category {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.bmi-description {
    color: var(--text-light);
    line-height: 1.4;
    font-size: 0.8rem;
}

/* BMI Category Colors */
.category-underweight {
    color: var(--info-color);
}

.category-normal {
    color: var(--success-color);
}

.category-overweight {
    color: var(--warning-color);
}

.category-obese {
    color: var(--danger-color);
}

/* BMI Chart */
.bmi-chart {
    margin: 1rem 0;
    background-color: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.chart-container {
    display: flex;
    height: 50px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: 1rem 0;
}

.chart-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem;
}

.chart-underweight {
    background-color: var(--info-color);
    flex: 18.5;
}

.chart-normal {
    background-color: var(--success-color);
    flex: 6.4;
}

.chart-overweight {
    background-color: var(--warning-color);
    flex: 5;
}

.chart-obese {
    background-color: var(--danger-color);
    flex: 10;
}

/* Chart Bar (for horizontal display) */
.chart-bar {
    display: flex;
    height: 50px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: 1rem 0;
}

.chart-segment.underweight {
    background-color: var(--info-color);
    flex: 18.5;
}

.chart-segment.normal {
    background-color: var(--success-color);
    flex: 6.4;
}

.chart-segment.overweight {
    background-color: var(--warning-color);
    flex: 5;
}

.chart-segment.obese {
    background-color: var(--danger-color);
    flex: 10;
}

/* Chart Legend */
.chart-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Result Container */
.result-container {
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    text-align: center;
    margin-top: 0.5rem;
}

/* Info Box */
.info-box {
    background-color: #eff6ff;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.info-box p {
    margin: 0;
    color: var(--text-color);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.hero h1 {
    color: white;
    margin-bottom: 0.35rem;
    font-size: 1.4rem;
}

.hero p {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Content Sections */
.content-section {
    margin: 1rem 0;
    padding: 1rem;
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 1.2rem;
}

.content-section ul, .content-section ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.content-section li {
    margin: 0.5rem 0;
    line-height: 1.7;
}

/* Responsive Calculator */
@media (max-width: 768px) {
    .calculator-container {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .unit-toggle {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .bmi-value {
        font-size: 1.75rem;
    }
    
    .bmi-category {
        font-size: 1rem;
    }
    
    .hero {
        padding: 1rem;
    }
    
    .hero h1 {
        font-size: 1.2rem;
    }
    
    .footer-grid,
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* =====================================================
   COMPACT CALCULATOR HERO SECTION (Side by Side Layout)
   ===================================================== */

.calculator-hero-section {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 1.5rem;
    align-items: start;
    margin: 1rem 0;
}

.calculator-side {
    display: flex;
    justify-content: flex-start;
}

.calculator-container.compact {
    max-width: 100%;
    padding: 0.75rem;
    margin: 0;
}

.calculator-container.compact h2 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.calculator-container.compact .form-group {
    margin-bottom: 0.4rem;
}

.calculator-container.compact .form-group label {
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
}

.calculator-container.compact .form-group input {
    padding: 0.35rem;
    font-size: 0.8rem;
}

.calculator-container.compact .unit-toggle {
    margin-bottom: 0.5rem;
    gap: 0.4rem;
    padding: 0.35rem;
}

.calculator-container.compact .unit-toggle label {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
}

.calculator-container.compact .btn-calculate {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
}

.calculator-container.compact .result-container {
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.calculator-container.compact .bmi-value {
    font-size: 1.5rem;
}

.calculator-container.compact .bmi-category {
    font-size: 0.8rem;
}

.calculator-container.compact .bmi-description {
    font-size: 0.7rem;
}

/* Calculator Info Side */
.calculator-info-side {
    padding: 0.75rem 0;
}

.calculator-info-side h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.35rem;
}

.calculator-info-side p {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.calculator-info-side .small-text {
    font-size: 0.7rem;
    color: var(--text-light);
}

/* Quick BMI Chart */
.bmi-quick-chart {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0.75rem 0;
}

.quick-range {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    color: white;
}

.quick-range.underweight {
    background-color: #3b82f6;
}

.quick-range.normal {
    background-color: #16a34a;
}

.quick-range.overweight {
    background-color: #ea580c;
}

.quick-range.obese {
    background-color: #dc2626;
}

/* Tablet: Stack calculator hero */
@media (max-width: 768px) {
    .calculator-hero-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .calculator-side {
        order: 1;
    }
    
    .calculator-info-side {
        order: 2;
        text-align: center;
    }
    
    .bmi-quick-chart {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .quick-range {
        flex: 1 1 45%;
        text-align: center;
    }
}

/* =====================================================
   FOOTER - Standardized & Compact
   ===================================================== */

/* Override footer for smaller, consistent look */
footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 1.5rem 0 1rem;
    margin-top: 2rem;
    font-size: 0.8rem;
}

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

.footer-col h4,
.footer-section h3,
.footer-column h4 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: none;
}

.footer-col li,
.footer-section li,
.footer-column li {
    margin-bottom: 0.25rem;
}

.footer-col a,
.footer-section a,
.footer-column a {
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
    line-height: 1.4;
}

.footer-col a:hover,
.footer-section a:hover,
.footer-column a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom p {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    margin: 0;
    line-height: 1.4;
}

/* Footer responsive - 2 columns on tablet, 1 on mobile */
@media (max-width: 900px) {
    .footer-grid,
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .footer-grid,
    .footer-content {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        text-align: center;
    }
    
    .footer-col,
    .footer-section,
    .footer-column {
        padding-bottom: 0.75rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .footer-col:last-child,
    .footer-section:last-child,
    .footer-column:last-child {
        border-bottom: none;
    }
}
