/* BASE-100 Institute - Global Styles */
/* Mobile-first responsive design */

:root {
    --bg-color: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #ff4d00;
    --grid-line: #e2e8f0;
}

/* Base Typography */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, h4, .font-display {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Technical Grid Background */
.tech-grid {
    background-size: 50px 50px;
    background-image: 
        linear-gradient(to right, rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.03) 1px, transparent 1px);
    position: relative;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Cards */
.hover-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.hover-card:hover {
    border-color: var(--text-main);
    transform: translateY(-2px);
    box-shadow: 4px 4px 0px rgba(0,0,0,1);
}

/* Buttons */
.btn-primary {
    background: #0f172a;
    color: white;
    border: 1px solid #0f172a;
    transition: all 0.2s ease;
    display: inline-block;
    text-decoration: none;
}

.btn-primary:hover {
    background: #ff4d00;
    border-color: #ff4d00;
    color: white;
}

.btn-secondary {
    background: white;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    transition: all 0.2s ease;
    display: inline-block;
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: #0f172a;
}

/* Ticker Animation */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: #0f172a;
    color: white;
    height: 30px;
    line-height: 30px;
}

.ticker {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Navigation */
nav {
    transition: all 0.3s ease;
}

.nav-link {
    position: relative;
    text-decoration: none;
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .ticker-item {
        font-size: 9px;
        padding: 0 1rem;
    }

    h1 {
        font-size: 2.5rem !important;
    }

    .hover-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* Mobile Grid Optimization */
    #knowledge-grid {
        font-size: 0.75rem;
        min-w-full;
    }

    #knowledge-grid td {
        min-height: 120px;
        height: 120px;
        padding: 0.5rem 0.25rem !important;
    }

    #knowledge-grid th {
        padding: 0.5rem 0.25rem !important;
    }

    #knowledge-grid .text-sm {
        font-size: 0.65rem;
    }

    #knowledge-grid .text-xs {
        font-size: 0.6rem;
    }
}

/* Grid Optimization */
#knowledge-grid {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
}

#knowledge-grid table {
    table-layout: auto;
    width: 100%;
}

#knowledge-grid td, #knowledge-grid th {
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
}

#knowledge-grid td {
    min-height: 140px;
    height: 140px;
}

#knowledge-grid th {
    min-height: auto;
}

/* Desktop Grid - Full width, no vertical scroll */
@media (min-width: 1024px) {
    #knowledge-grid {
        font-size: 0.875rem;
    }

    #knowledge-grid td {
        min-height: 140px;
        height: 140px;
    }
}

/* Modal Styles */
.fixed.z-50 {
    animation: fadeIn 0.2s ease-out;
}

/* Utility Classes */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding {
    padding: 4rem 1.5rem;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 6rem 1.5rem;
    }
}

/* Glossary Tooltips */
.glossary-term {
    border-bottom: 2px dotted #ff4d00;
    color: inherit;
    cursor: help;
    font-weight: 500;
    position: relative;
    transition: border-color 0.2s ease;
    display: inline;
    white-space: normal;
}

.glossary-term:hover {
    background-color: rgba(255, 77, 0, 0.1);
    border-bottom-color: #ff4d00;
    color: inherit;
}

.glossary-term::after {
    content: attr(data-definition);
    position: absolute;
    bottom: auto;
    top: -12px;
    left: 50%;
    transform: translate(-50%, -100%);
    background-color: #0f172a;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: normal;
    max-width: 280px;
    width: auto;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    text-align: left;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.glossary-term::before {
    content: '';
    position: absolute;
    bottom: auto;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #0f172a;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.glossary-term:hover::after,
.glossary-term:hover::before {
    opacity: 1;
}
