/*
 * Basic styling for the WalkRL project page.
 *
 * The design is intentionally simple and self‑contained, avoiding external
 * frameworks so the page works offline. Feel free to tweak colours or
 * spacing to match your branding. Responsive styles ensure the layout
 * remains usable on mobile devices.
 */

:root {
    /* Primary accent colour used for prominent buttons and highlights */
    --primary: #0066cc;
    --text-colour: #333;
    --background-colour: #ffffff;
    --button-background: #e5e5e5;
    --button-disabled: #cccccc;
    --button-text: #333;
    --button-primary-text: #fff;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-colour);
    color: var(--text-colour);
    line-height: 1.6;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 1.25rem;
}

h1.title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

h2 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

p {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

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

a:hover {
    text-decoration: underline;
}

/* Button styles */
.buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.button {
    display: inline-block;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    background-color: var(--button-background);
    color: var(--button-text);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.button:hover {
    background-color: #d5d5d5;
}

.button.primary {
    background-color: var(--primary);
    color: var(--button-primary-text);
}

.button.primary:hover {
    background-color: #004a99;
}

.button.disabled {
    background-color: var(--button-disabled);
    color: var(--button-text);
    pointer-events: none;
    cursor: default;
}

/* Highlight card for the video comparison call-to-action */
.highlight {
    background-color: #f8f9fb;
    border-left: 4px solid var(--primary);
    padding: 1rem;
    margin-top: 2rem;
}

.highlight h2 {
    margin-top: 0;
}

.highlight .button {
    margin-top: 0.5rem;
}

/* Compare section layout (ported from Video_Comparison page) */
.compare-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.compare-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.select-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.8rem 0;
    align-items: center;
}

.select-container select {
    flex: 1;
    min-width: 220px;
    padding: 0.4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.compare-sides {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
    margin-top: 0.2rem;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.side-panel .select-container {
    display: none; /* hide A/B raw video dropdown; filters drive selection */
}

.side-panel .filters {
    margin: 0;
}

.side-panel .filters select {
    min-width: 0;
    flex: 1;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.8rem 0 1rem 0;
    align-items: center;
}

.filters select {
    flex: 1;
    min-width: 220px;
    padding: 0.4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.players {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.player-slot {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #fff;
}

.players iframe {
    width: 100%;
    border: 0;
    display: none;
    /* Source is close to square; keep frame square to avoid thick letterboxing. */
    aspect-ratio: 1 / 1;
    height: auto;
}

.player-slot.loaded iframe {
    display: block;
}

.thumb-placeholder {
    width: 100%;
    /* Match square iframe aspect ratio */
    padding-top: 100%;
    background-color: #e9ecef;
    background-size: cover;
    background-position: center;
}

.player-slot.loaded .thumb-placeholder {
    display: none;
}

.origin-warning {
    margin-top: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    background: #fff3cd;
    border: 1px solid #ffe69c;
    color: #664d03;
    font-size: 0.95rem;
}

pre {
    background-color: #f4f4f4;
    padding: 0.8rem;
    overflow-x: auto;
    border-radius: 4px;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* Teaser image styling */
.teaser-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-top: 0.5rem;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #666;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    h1.title {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 1.2rem;
    }
    .buttons {
        flex-direction: column;
    }
    .button {
        width: 100%;
        text-align: center;
    }
    /* aspect-ratio stays square on small screens */
    .compare-sides {
        grid-template-columns: 1fr;
    }
}
