:root {
    --bg-color: #0d1117;
    --text-color: #c9d1d9;
    --accent-color: #58a6ff;
    --secondary-bg: #161b22;
    --border-color: #30363d;
    --success-color: #238636;
    --disabled-color: #484f58;
    --max-width: 800px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    width: 100%;
    max-width: var(--max-width);
    margin-bottom: 40px;
    text-align: center;
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #f0f6fc;
}

.progress-container {
    width: 100%;
    background-color: var(--secondary-bg);
    height: 8px;
    border-radius: 4px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    transition: width 0.3s ease;
}

main {
    width: 100%;
    max-width: var(--max-width);
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

section {
    display: none;
}

section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.video-wrapper {
    margin: 20px 0;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
    /* Default to container width */
    max-width: 100%;
}

/* Base styles for Able Player to ensure it fills the wrapper */
.able-player,
.able-player-container,
.able-player-inner,
.able-player-media-container,
.able-player-surface,
.able-player.able-youtube,
.able-player.able-video {
    width: 100% !important;
    max-width: none !important;
    min-width: 100% !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
}

/* Maintain aspect ratio on the media container specifically */
.able-player-media-container,
.able-player iframe {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
}

.able-player iframe {
    height: 100% !important;
    /* Within the aspect-ratio container */
}

.reflection-box {
    margin-top: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

textarea {
    width: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 12px;
    border-radius: 6px;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 20px;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

button {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

button.primary {
    background-color: var(--success-color);
    color: #fff;
}

button.primary:hover:not(:disabled) {
    background-color: #2ea043;
}

button.secondary {
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

button.secondary:hover {
    background-color: var(--bg-color);
}

button:disabled {
    background-color: var(--disabled-color);
    opacity: 0.6;
    cursor: not-allowed;
}

.research-basis {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

details {
    cursor: pointer;
}

summary {
    font-weight: 600;
    color: var(--accent-color);
    padding: 5px 0;
}

.note {
    font-size: 0.9rem;
    font-style: italic;
    color: #8b949e;
    margin-top: 10px;
}

footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.85rem;
    color: #8b949e;
    width: 100%;
    max-width: var(--max-width);
}

.reset-btn {
    background: none;
    border: none;
    color: #f85149;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
}

.reset-btn:hover {
    color: #ff7b72;
}