/* -----------------------------
   CSS
----------------------------- */
:root {
    --primary: #10a37f; /* green accent */
    --primary-hover: #0e8a6c;
    --secondary: #f5f5f5; /* light gray surfaces */
    --surface: #ffffff; /* main content background */
    --text: #111827; /* dark gray text */
    --text-light: #4b5563; /* secondary text */
    --error: #ef4444;
    --success: #22c55e;
    --shadow: rgba(0,0,0,0.08);
    --nav-offset: 120px;
    --border-radius: 10px;
    --font-family: "Inter", "Segoe UI", sans-serif;
}

/* -----------------------------
   Global Styles
----------------------------- */
* {
    font-family: var(--font-family);
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--secondary);
    color: var(--text);
}

body::before {
    content: "";
    display: block;
    height: var(--nav-offset);
}

h1, h2, h3, h4, h5, h6, p {
    color: var(--text);
}

/* -----------------------------
   Headings
----------------------------- */
h1 {
    text-align: center;
    padding: 20px;
    margin: 30px auto 20px;
    font-size: 36px;
    font-weight: 700;
}

#indexh1,
#welcome {
    font-size: 50px;
    font-weight: 700;
}

h2 {
    text-align: center;
}

.heading-box,
.heading-box-other,
.review-box {
    position: relative;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 4px 12px var(--shadow);
}

.heading-box {
    padding: 15px;
    margin: 15px auto;
    max-width: 65%;
}

.heading-box-other {
    padding: 10px;
    margin: 10px auto;
    max-width: 55%;
}

.heading-box h1, 
.heading-box h2 {
    font-weight: 700;
    margin: 0;
}

.review-box {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 20px;
    max-width: 65%;
    width: 90%;
}

/* -----------------------------
   Navigation
----------------------------- */
nav {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1000px;
    padding: 30px 50px;
    background-color: rgba(255, 255, 255, 0.70);
    border-radius: 15px;
    backdrop-filter: blur(30px);
    box-shadow: 0 4px 10px var(--shadow);
}

nav a {
    padding: 10px 18px;
    margin: 5px;
    text-decoration: none;
    border-radius: 8px;
    color: var(--surface);
    background-color: var(--primary);
    transition: background-color 0.3s ease;
    font-weight: 600;
}

nav a:hover {
    background-color: var(--primary-hover);
}

.logo {
    color: var(--text);
    font-weight: 700;
    font-size: 1.25rem;
}

/* -----------------------------
   Username Display
----------------------------- */
#username {
    background-color: var(--primary);
    color: var(--surface);
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

#username:hover {
    color: var(--surface);
}

/* -----------------------------
   Profile
----------------------------- */
.profile-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.profile-box {
    flex: 1 1 45%;
    max-width: 600px;
    min-width: 300px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0,0,0,0.05);
    background-color: var(--surface);
    box-shadow: 0 4px 12px var(--shadow);
    padding: 20px;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 20px; 
    align-items: center; 
    padding: 20px;
}

.profile-row {
    display: flex;
    justify-content: space-between; 
    width: 80%;
    max-width: 400px;
}

.profile-row span,
.profile-row strong {
    text-align: center;
}

/* -----------------------------
   Tables
----------------------------- */
table {
    margin: 20px auto;
    border-spacing: 0;
    width: 90%;
}

td, th {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 8px 20px;
    text-align: left;
}

/* -----------------------------
   Forms
----------------------------- */
form, .form {
    grid-template-columns: max-content 1fr;
    grid-gap: 1em 0.5em;
    display: flex;                /* switch to flex layout */
    flex-direction: column;       /* stack items vertically */
    justify-content: center;      /* center vertically if container allows */
    align-items: center;          /* center horizontally */
    text-align: center;           /* center text inside inputs/buttons if needed */
}


fieldset {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
    background-color: var(--surface);
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
}

label {
    grid-column: 1 / 2;
    text-align: right;
    color: var(--text-light);
    font-weight: 500;
}

input, textarea, select {
    grid-column: 2 / 3;
    width: 70%;                /* make fields wider */
    max-width: 500px;          /* optional maximum width */
    padding: 0.6em;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
    background-color: var(--secondary);
    font-size: 1rem;
    text-align: center;        /* center text inside fields */
    display: block;
    margin: 0 auto;            /* center fields horizontally */
}


textarea {
    height: 4em;
    resize: vertical;
}

legend {
    font-size: 1.8em;
    text-align: center;
    color: var(--text);
    font-weight: 700;
}

.full-width {
    grid-column: 1 / span 2;
    margin-top: 1em;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* -----------------------------
   Buttons
----------------------------- */
button, #button {
    background-color: var(--primary);
    color: var(--surface);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.6em 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 600;
}

button:hover, #button:hover {
    background-color: var(--primary-hover);
}

.signInBut {
    padding: 0.6em;
}

/* -----------------------------
   Links
----------------------------- */
a.nav {
    color: red;
    text-decoration: none;
    font-weight: 600;
}

a.nav:hover {
    color: var(--primary);
}

/* -----------------------------
   Practice NZSL
----------------------------- */
#practice-container {
    max-width: 840px;
    margin: 20px auto;
    padding: 20px;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--shadow);
}

.loading, .error {
    text-align: center;
    padding: 40px;
    font-size: 18px;
}

.error {
    color: var(--error);
}

.question-header {
    text-align: center;
    margin-bottom: 30px;
}

.instruction {
    color: var(--text-light);
    font-style: italic;
}

.english-sentence, .gloss-sentence {
    margin-bottom: 30px;
    padding: 15px;
    background-color: var(--secondary);
    border-radius: var(--border-radius);
}

.english-sentence h3, 
.gloss-sentence h3 {
    margin-top: 0;
}

.sentence-blanks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.blank-input {
    width: 100px;
    padding: 5px;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 3px;
    text-align: center;
    font-size: 16px;
}

.blank-input:focus {
    outline: none;
    border-color: var(--primary);
}

.blank-input.correct {
    border-color: var(--success);
    background-color: #dcfce7;
}

.blank-input.incorrect {
    border-color: var(--error);
    background-color: #fee2e2;
}

.word {
    font-weight: bold;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.check-button, .hint-button, .next-button {
    padding: 10px 20px;
    font-size: 16px;
}

.feedback {
    text-align: center;
    padding: 15px;
    border-radius: var(--border-radius);
    margin: 20px 0;
}

.correct-feedback {
    color: var(--success);
    font-weight: bold;
}

.incorrect-feedback {
    color: var(--error);
    font-weight: bold;
}

.correct-answer {
    margin-top: 15px;
    padding: 10px;
    background-color: var(--secondary);
    border-radius: 3px;
}

.progress {
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    color: var(--text-light);
}

/* -----------------------------
   Help Page
----------------------------- */
.help-container {
    max-width: 1000px;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 0 20px;
}

.help-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--surface);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--shadow);
}

.video-container {
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
}

.video-description h2 {
    margin: 10px 0;
    font-weight: bold;
    color: var(--text);
}

.video-description p {
    color: var(--text-light);
    line-height: 1.5;
}

.faq-container {
    max-width: 900px;
    margin: 60px auto;
    padding: 20px;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--shadow);
    text-align: center;
}

.faq-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text);
}

.faq-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.faq-container li {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* -----------------------------
   Responsive
----------------------------- */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 12px;
    }

    .profile-container {
        flex-direction: column;
        align-items: center;
    }

    table, form {
        width: 100%;
    }
}
