/* Global Styles & Variables */
:root {
    --neutral-dark: #333333;
    --neutral-light: #f5f5f5;
    --neutral-mid: #e0e0e0;
    --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --transition-time: 0.3s;
    --card-border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body {
    background-color: var(--neutral-light);
    color: var(--neutral-dark);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.container {
    width: 100%;
    max-width: min(1400px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 0 20px;
}

/* Ensure all content elements respect screen width */
* {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Prevent tables and other elements from causing horizontal overflow */
table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

@media (max-width: 768px) {
    table {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    table {
        font-size: 0.8rem;
    }
    
    .container {
        max-width: calc(100vw - 20px);
        padding: 0 10px;
    }
}

/* Images and media */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Pre and code blocks */
pre, code {
    max-width: 100%;
    overflow-x: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Blockquotes and wide content */
blockquote {
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Ensure grid layouts don't overflow */
.topic-categories, .evidence-grid {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Header */
header {
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-time);
}

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

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--neutral-dark);
    text-decoration: none;
    letter-spacing: -0.5px;
    line-height: 1.1;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: translateY(-1px);
}

.logo-subtitle {
    font-size: 0.85rem;
    color: #666;
    font-weight: 400;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.navigation a {
    text-decoration: none;
    color: var(--neutral-dark);
    font-weight: 500;
    font-size: 1.1rem;
    transition: all var(--transition-time);
    position: relative;
}

.navigation a:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    transition: width var(--transition-time);
    background-color: var(--primary-color, var(--neutral-dark));
}

.navigation a.active:after {
    width: 100%;
}

.navigation a:hover:after {
    width: 100%;
}

/* Footer */
footer {
    background-color: var(--neutral-dark);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.footer-description {
    max-width: 400px;
    opacity: 0.7;
    margin-bottom: 0;
}

.footer-heading {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-time);
}

.footer-links a:hover {
    color: white;
}

.copyright {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.changelog-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: background-color var(--transition-time), transform var(--transition-time);
    box-shadow: var(--box-shadow);
    margin-top: 1.5rem;
}

.changelog-button:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

/* Utility Classes */
.to-top-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color, #26a69a);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-time);
    z-index: 99;
}

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

.to-top-button:hover {
    background: var(--primary-accent-color, #00766c);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--neutral-dark);
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    /* Adjustments for smaller screens if needed */
}

@media (max-width: 576px) {
    .header-container {
        padding: 0 15px;
    }

    .mobile-menu-button {
        display: block;
    }

    .navigation {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 99;
        display: none;
    }
    
    .navigation.active {
        display: block;
    }

    .navigation ul {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    
    .navigation ul li {
        width: 100%;
    }
    
    .navigation ul li a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
}

/* Additional responsive table handling */
@media (max-width: 768px) {
    table {
        font-size: 0.9rem;
    }
    
    .container {
        max-width: calc(100vw - 20px);
        padding: 0 10px;
    }
}

@media (max-width: 576px) {
    table {
        font-size: 0.8rem;
    }
    
    .container {
        max-width: calc(100vw - 20px);
        padding: 0 10px;
    }
}

/* Universal overflow protection for all pages */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* Ensure all flex and grid containers respect viewport width */
.flex-container, .grid-container, [class*="grid"], [class*="flex"] {
    max-width: 100%;
    overflow: hidden;
}

/* Handle wide content elements */
.content-section, .main-column, .sidebar {
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Ensure responsive images and media */
img, video, iframe, embed, object {
    max-width: 100% !important;
    height: auto;
}

 