/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background-color: #fff;
    border-right: 1px solid #eee;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem;
}

.nav-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.nav-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
}

.nav-content ul {
    list-style: none;
}

.nav-content ul li {
    margin-bottom: 1rem;
}

.nav-content ul li a {
    text-decoration: none;
    color: #666;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.nav-content ul li a:hover {
    color: #000;
}

.external-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #f5f5f5;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.button:hover {
    background-color: #eee;
    transform: translateY(-1px);
}

.content {
    flex: 1;
    margin-left: 280px;
    padding: 3rem;
    max-width: 1200px;
}

.section {
    margin-bottom: 4rem;
}

.section h2, .section h3 {
    color: #1E3A8A;
    margin-bottom: 1.5rem;
}

.section h2 { font-size: 2rem; }
.section h3 { font-size: 1.75rem; }

.image-container {
    margin: 2rem 0;
    text-align: center;
}

.scaled-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.title-container {
    margin-bottom: 3rem;
}

.title-container h1 {
    color: #1E3A8A;
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.highlight {
    background: linear-gradient(120deg, rgba(255, 138, 0, 0.30) 0%, rgba(255, 107, 0, 0.30) 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.4em;
    background-position: 0 88%;
    padding: 0 2px;
}

/* Video popup (optional) */
.video-popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.video-popup.active { display: flex; }
.video-popup-content {
    position: relative;
    width: 80%;
    max-width: 1200px;
}
.video-popup-content video { width: 100%; border-radius: 8px; }
.close-popup {
    position: absolute;
    top: -40px; right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
}

/* Demos: SCoUT in action — one row Battle (4), one row Pursuit (5); equal-size boxes */
#demos .demo-row-title {
    font-size: 1.15rem;
    color: #1E3A8A;
    margin: 1.5rem 0 0.75rem 0;
    font-weight: 600;
}
#demos .demo-row-title:first-of-type { margin-top: 0; }
#demos .demo-row-title a {
    color: inherit;
    text-decoration: none;
}
#demos .demo-row-title a:hover { text-decoration: underline; }
#demos .demo-row {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}
#demos .demo-row-battle {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
#demos .demo-row-pursuit {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
#demos .demo-item {
    text-align: center;
    min-width: 0;
}
#demos .demo-label {
    display: block;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
#demos .demo-gif-wrap {
    width: 100%;
    padding-bottom: 100%; /* square */
    height: 0;
    position: relative;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
#demos .demo-gif-wrap .demo-gif {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* show full frame so top label (e.g. 20v20) is not cut off */
    border-radius: 8px;
}
@media (max-width: 900px) {
    #demos .demo-row-battle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #demos .demo-row-pursuit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    #demos .demo-row-battle,
    #demos .demo-row-pursuit { grid-template-columns: 1fr; }
}

/* Results tables */
.table-caption {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0.75rem;
}
.table-wrapper {
    overflow-x: auto;
    margin: 1rem 0 2rem 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.paper-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.paper-table th,
.paper-table td {
    padding: 0.4rem 0.5rem;
    border: 1px solid #e8e8e8;
    text-align: center;
}
.paper-table th { font-weight: 600; }
.paper-table td:first-child,
.paper-table th:first-child {
    text-align: left;
    min-width: 10rem;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
}
.paper-table .header-row th {
    background: #e8ecf4;
    color: #1a1a1a;
}
.paper-table .subheader-row th {
    background: #f0f2f8;
    font-weight: 500;
    font-size: 0.8rem;
}
.paper-table .best {
    font-weight: 600;
    background: rgba(30, 58, 138, 0.08);
}
.section h4 {
    color: #333;
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem 0;
}
.results-figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}
.results-fig-item {
    text-align: center;
}
.fig-caption {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .container { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    .content { margin-left: 0; padding: 2rem; }
}

.section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}
