/**
 * Global Architecture CSS Layer (Universal Structural Layout)
 * Engine: Native Flex/Grid Engine, Core Fluid Typos & Color Tokens
 * Target: assets/css/main.css
 */

:root {
    --bg-primary: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* Branding Accent Yellow & Red Theme Colors */
    --brand-red: #dc2626;
    --brand-red-hover: #b91c1c;
    --brand-yellow: #facc15;
    --brand-yellow-dark: #eab308;
    
    --bg-ad-placeholder: #f1f5f9;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    
    --font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base Document Level Normalization Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Global Navbar Layer Structure */
.app-global-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 65px;
    width: 100%;
}

.nav-brand-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo-anchor {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    white-space: nowrap;
}

.brand-text-accent-red { color: var(--brand-red); }
.brand-text-accent-yellow { color: var(--brand-yellow-dark); }

/* Async Search Container Architecture */
.nav-search-wrapper-shell {
    flex: 0 1 500px;
    width: 100%;
    margin: 0 1.5rem;
    position: relative;
}

.search-input-field-group {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

#global-search-input {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

#global-search-input:focus {
    border-color: var(--brand-red);
    background-color: var(--bg-surface);
}

.search-shortcut-badge {
    position: absolute;
    right: 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* Real-time Overlay Dropdown Mappings */
.search-results-hidden-node { 
    display: none; 
}

.search-results-visible-display-overlay {
    position: absolute; 
    top: 100%; 
    left: 0; 
    right: 0;
    background: var(--bg-surface); 
    border: 1px solid var(--border-color);
    border-radius: 6px; 
    margin-top: 0.5rem; 
    box-shadow: var(--shadow-md);
    max-height: 300px; 
    overflow-y: auto; 
    z-index: 2000;
}

.search-results-list-wrapper { 
    list-style: none; 
    padding: 0.5rem 0; 
}

.search-result-item-node { 
    padding: 0.6rem 1rem; 
    display: flex;
    align-items: center;
    cursor: pointer;
}

.search-result-item-node:hover { 
    background: var(--bg-primary); 
    color: var(--brand-red); 
}

.result-indicator-bullet { 
    color: var(--brand-yellow-dark); 
    margin-right: 0.5rem; 
}

.search-no-results-notice { 
    padding: 1rem; 
    text-align: center; 
    color: var(--text-muted); 
    font-size: 0.9rem; 
}

/* Structural Workspace Layout Base Grid */
.global-app-structural-viewport {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: calc(100vh - 250px);
    width: 100%;
}

/* Tool Wrapper Elements */
.tool-wrapper-shell {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.tool-main-heading {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    border-left: 5px solid var(--brand-red);
    padding-left: 0.75rem;
    color: var(--text-main);
}

/* Light Mode Toggle Button Layout default */
.theme-switch-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.15s ease;
    width: 40px;
    height: 40px;
}

.theme-switch-btn:hover { background-color: var(--bg-primary); }

.theme-icon-moon-svg { display: block; }
.theme-icon-sun-svg { display: none; }

/* Footer Architecture */
.app-global-footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem 1.5rem 1.5rem;
    margin-top: 4rem;
    width: 100%;
}

.footer-core-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding-bottom: 2.5rem;
}

.footer-brand-column p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    max-width: 450px;
}

.footer-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}
.footer-logo-text .text-red { color: var(--brand-red); }
.footer-logo-text .text-yellow { color: var(--brand-yellow-dark); }

.footer-section-heading {
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.footer-links-list { list-style: none; }
.footer-links-list li { margin-bottom: 0.5rem; }
.footer-links-list a {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color 0.15s ease;
}
.footer-links-list a:hover { color: var(--brand-red); }

.footer-bottom-bar {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mobile Responsiveness Breakpoints Media Queries */
@media (max-width: 768px) {
    .app-global-navbar {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 0.75rem;
        align-items: stretch;
    }

    .nav-brand-wrapper {
        justify-content: space-between;
        width: 100%;
    }

    .nav-search-wrapper-shell {
        width: 100%;
        margin: 0;
        order: 3;
        flex: 1 1 auto;
    }
    
    #global-search-input {
        font-size: 16px;
        padding: 0.55rem 2rem 0.55rem 0.85rem;
    }

    .search-shortcut-badge {
        display: none;
    }

    .global-app-structural-viewport {
        margin: 1rem auto;
        padding: 0 1rem;
    }

    .tool-wrapper-shell {
        padding: 1.25rem;
        border-radius: 8px;
    }

    .tool-main-heading {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .footer-core-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}