body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: #f8f9fa; 
    margin: 0;
    padding: 0;
}

h1 { font-weight: 700; font-size: 1.7rem; margin: 10px 0; color: #2c3e50; text-align: center;}
h2 { font-weight: 700; font-size: 1.4rem; margin: 10px 0; color: #2c3e50; text-align: center;}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 4px;
    background-color: #96c96f;
    outline: none;
    border: none;
}
.header-btn:hover {background-color: #86b562;}

.header-right {
    display: flex;
    gap: 2px; /* space between the two right buttons */
}

/* Main Container for Centering */
.quiz-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh; /* Centers vertically in the viewport */
    gap: 20px;
    padding: 20px;
}

/* The Custom Button/Card */
.quiz-btn-group {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e0e0e0;
    margin-bottom: -3px;
}

.quiz-btn-group:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Left Side: Number */
.btn-number {
    background-color: white;
    color: white;
    font-weight: bold;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
}

/* Center: Main Clickable Area */
.btn-main-label {
    flex-grow: 1;
    padding: 0 20px;
    text-align: center;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    height: 60px;
}

/* Right Side: Help/Info "?" */
.btn-info-trigger {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    color: #888;
    cursor: pointer;
    border-left: 1px solid #eee;
    transition: background 0.2s;
}

.btn-info-trigger:hover {
    background-color: #e2e2e2;
    color: #333;
}

/* Score Styling */
#score-display { 
    text-align: center; 
    font-size: 1.1rem;
    color: white;
    background: #3498db;
    max-width: 250px;
    margin: 0 auto 20px auto;
    padding: 10px;
    padding: 12px 40px;
    border-radius: 30px;
    font-weight: 600;
    display: none; /* Hidden until quiz finished */
}

/* Toggle Container */
.settings-bar {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.2rem;
}

.btn-test {
  --bs-btn-color: #3b3d3b;
  --bs-btn-bg: white;
  --bs-btn-border-color: #3498db;
  --bs-btn-hover-color: var(--bs-white);
  --bs-btn-hover-bg: #{shade-color($bd-violet, 10%)};
  --bs-btn-hover-border-color: #{shade-color($bd-violet, 10%)};
  --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb);
  --bs-btn-active-color: var(--bs-btn-hover-color);
  --bs-btn-active-bg: #3498db;
  --bs-btn-active-border-color: #3498db;
  border: 2px solid #c9c9c9; 
  font-size: 1.1rem;
  border-radius: 15px; 
}

/* Question Card Styling - Matching the Index Page Look */
.question-card { 
    background: white; 
    max-width: 600px;
    margin: 0 auto 25px auto;
    border-radius: 16px; 
    overflow: visible;    /* Add this */
    position: relative;   /* Add this to help with z-index layering */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eef2f3;
}

/* Since we removed overflow:hidden, we must round the header's top corners manually */
.card-header-teal {
    background-color: #96c96f;
    font-size: 1.1rem;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 15px;  /* Add this */
    border-top-right-radius: 15px; /* Add this */
}

.leaderboard-card { 
    background: white; 
    max-width: 600px;
    margin: 0 auto 25px auto;
    border-radius: 16px; 
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eef2f3;
}

.leaderboard-card-header-teal {
    background-color: #96c96f;
    font-size: 1.1rem;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}   

/* Ensure the card currently being used sits on top of the cards below it */
.question-card:focus-within {
    z-index: 10;
}

.card-body {
    padding: 20px;
}

.audio-player { 
    width: 100%; 
    border-radius: 8px;
}

input[list] { 
    width: 100%; 
    padding: 12px 15px; 
    border: 2px solid #eee; 
    border-radius: 10px; 
    margin-top: 10px;
    font-size: 1rem; 
    transition: border-color 0.3s;
    outline: none;
}

input[list]:focus {
    border-color: #96c96f;
}

.feedback { 
    margin-top: 15px; 
    padding: 10px;
    border-radius: 8px;
    font-weight: 600; 
    display: none;
}
.correct-bg { background-color: #d4edda; color: #155724; display: block; }
.incorrect-bg { background-color: #f8d7da; color: #721c24; display: block; }

.sonogram {
    width: 100%;
    height: auto;
    margin-bottom: 5px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.hide-sonogram .sonogram { display: none; }

.action-container {
    display: flex;             /* Maintains flex context */
    flex-direction: column;    /* Stacks elements vertically */
    align-items: center;       /* Centers elements horizontally */
    justify-content: center;   /* Centers elements vertically within the container */
    gap: 12px;                 /* Space between input and button */
    padding-bottom: 20px;
    width: 100%;               /* Ensures it spans the full width to allow centering */
}

.pseudo-input {
    width: 300px; /* Matches the min-width of .btn-custom */
    padding: 12px 20px;
    border: 2px solid #3498db;
    border-radius: 30px;
    text-align: center;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: box-shadow 0.2s;
}

.pseudo-input:focus {
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

.pseudo-label {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: -5px;
}
.id-label {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: -10px;
    margin-top: 10px;
}

.btn-custom {
    padding: 12px 40px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    border: none;
    transition: transform 0.2s, background 0.2s;
    color: white;
    min-width: 300px;
}

.btn-custom:active { transform: scale(0.98); }

#submit-btn { background-color: #3498db; }
#new-quiz-btn { background-color: #3498db; }

.meta-info { font-size: 0.8rem; color: #95a5a6; margin-top: 15px; margin-bottom: -7px;}

.footer {
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin: 15px 5vw 5px 5vw;
    justify-content: space-between;
    border-top: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
    display: flex;
}
#pmLink {
    visibility: hidden;
    color: var(--bs-secondary-color);
    text-decoration: none;
    cursor: pointer;
    background: rgba(0,0,0,0);
    border: none
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 350px;
    overflow-y: auto;
    background: white;
    border: 2px solid #eee;
    border-radius: 0 0 10px 10px;
    display: none;
    border-top: none;
}

.autocomplete-results .dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-results .dropdown-item:hover, 
.autocomplete-results .dropdown-item.active { background-color: #eee;}
.match { font-weight: bold;}
.autocomplete-open input { border-radius: 10px 10px 0 0 !important;}

.autocomplete-input { 
    width: 100%; 
    padding: 12px 15px; 
    border: 2px solid #eee; 
    border-radius: 10px; 
    margin-top: 10px;
    font-size: 1rem; 
    outline: none;
}