/* Universal Box-Sizing Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* General Body & Typography */
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5; /* Slightly tighter line height */
    margin: 0;
    padding: 0;
    background-color: #FFFFFF;
    color: #8B8C89;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #FFFFFF;
    padding: 0.6rem 0; /* Even less padding */
    border-bottom: 1px solid #E7ECEF;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02); /* Lighter shadow */
    text-align: center;
}

h1 {
    color: #274C77;
    margin: 0;
    font-size: 2rem; /* Slightly smaller */
    font-weight: 700;
    letter-spacing: -0.5px;
}

main {
    flex-grow: 1;
    max-width: 550px; /* Even narrower content area */
    margin: 10px auto; /* Even less vertical margin */
    padding: 0 12px; /* Less horizontal padding */
}

/* Centered Primary Verb and English Translation */
h2 {
    color: #6096BA;
    font-size: 1.6rem; /* Smaller */
    font-weight: 600;
    margin-top: 0.3rem; /* Even less margin above main verb */
    margin-bottom: 0.3rem; /* Even less margin below main verb */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* Smaller gap */
}

.verb-detail-card > p { /* Target only the immediate p for English translation */
    text-align: center;
    margin-bottom: 0.8rem; /* Less margin below translation */
}

h3 {
    color: #8B8C89;
    font-size: 1.25rem; /* Smaller */
    font-weight: 600;
    margin-top: 1rem; /* Less margin above section headers */
    margin-bottom: 0.6rem; /* Less margin below section headers */
    border-bottom: 1px solid #E7ECEF;
    padding-bottom: 0.2rem; /* Even less padding */
}

p {
    margin-bottom: 0.6rem; /* Reduced default paragraph margin */
}

.intro-text {
    font-size: 0.85em; /* Smaller */
    color: #8B8C89;
    font-style: italic;
    line-height: 1.6; /* Improves readability by adding space between lines */
    margin-top: 5px; /* Space above the paragraph */
    margin-bottom: 5px; /* Space below the paragraph */
    text-align: center; /* Centers the text (adjust to 'left' if you prefer) */
    margin-left: auto; /* Centers the block if max-width is used */
    margin-right: auto; /* Centers the block if max-width is used */
    padding: 0 15px; /* Adds a little padding on the sides for smaller screens */
}

/* You might also want to style the strong tags within it to stand out */
.intro-text strong {
    color: #274C77; /* Using a darker blue from your existing palette */
    font-weight: 700; /* Make it bolder */
}

/* Controls Section (Level Selection & Next Verb Link) */
.controls {
    text-align: center;
    margin-bottom: 10px; /* Less margin below controls section */
    padding-top: 0;
    padding-bottom: 8px; /* Less padding */
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.controls p {
    font-size: 0.95em; /* Smaller */
    margin-bottom: 6px; /* Less margin */
    color: #8B8C89;
    font-weight: 500;
}

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* Space between input and button */
    margin-bottom: 10px; /* Space below the search container */
}

#search-verb-input {
    padding: 7px 10px;
    border: 1px solid #E7ECEF;
    border-radius: 5px;
    font-size: 0.9em;
    color: #343a40;
    background-color: #FFFFFF;
    flex-grow: 1; /* Allows input to take available space */
    max-width: 300px; /* Or a specific max-width */
}

#search-verb-input:focus {
    border-color: #A3CEF1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(163, 206, 241, 0.2);
}

#search-verb-btn { /* Styling similar to main-action-link but can be customized */
    /* main-action-link styles are mostly fine, but ensure it looks like a button */
    padding: 7px 12px; /* Adjust padding to match input height better */
    font-size: 0.9em;
    /* If #search-verb-btn inherits from .main-action-link, these might not be needed */
    /* background-color: #E7ECEF; */
    /* color: #274C77; */
    /* border: 1px solid #A3CEF1; */
    /* border-radius: 5px; */
}

#search-message {
    min-height: 1.2em; /* Reserve space to prevent layout shifts */
    margin-top: 0;
    margin-bottom: 8px; /* Space below the message */
}


.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 6px; /* Smaller space between buttons */
    margin-bottom: 10px; /* Less margin above next verb link */
    flex-wrap: wrap;
}

.filter-btn {
    background-color: #E7ECEF;
    color: #8B8C89;
    border: none;
    padding: 7px 12px; /* Less padding */
    border-radius: 5px; /* Slightly less rounded */
    cursor: pointer;
    font-size: 0.85em; /* Smaller */
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04); /* Lighter shadow */
    flex-grow: 0;
    max-width: 120px; /* Smaller max width */
}

.filter-btn:hover {
    background-color: #A3CEF1;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.filter-btn.active {
    background-color: #274C77;
    color: white;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(39, 76, 119, 0.15);
    transform: translateY(0);
}

/* Next Verb Link - Styled as a simple text link */
.main-action-link {
    outline: none;
    border: none; /* Add this if it's a border */
    display: inline-block;
    background-color: transparent;
    color: #6096BA;
    text-decoration: none;
    padding: 3px 6px; /* Even less padding */
    /* border-radius: 0px; */
    cursor: pointer;
    font-size: 0.9em; /* Smaller */
    font-weight: 600;
    transition: color 0.2s ease, background-color 0.2s ease;
    box-shadow: none;
    margin-top: 6px; /* Less margin */
    margin-bottom: 6px; /* Less margin */
}

.main-action-link:focus {
    outline: none;
    /* OPTIONAL: You can add a custom focus style here if you want to keep
       an accessibility indicator, but change its appearance. For example: */
    /* box-shadow: 0 0 0 2px rgba(96, 150, 186, 0.5); */ /* A subtle blue glow */
    /* border: 1px solid #6096BA; */ /* A border matching your text color */
}

.main-action-link:hover {
    color: #274C77;
    text-decoration: underline;
    background-color: transparent; /* Changed to transparent */
    transform: none;
    box-shadow: none;
}

.main-action-link.disabled {
    color: #8B8C89;
    text-decoration: none;
    background-color: transparent;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Verb Detail Card (now just a content area) */
.verb-detail-card {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    margin-top: 0;
}

.loading-message, .error-message, .info-message {
    text-align: center;
    color: #8B8C89;
    font-style: italic;
    padding: 15px 0; /* Less padding */
    font-size: 0.9em; /* Smaller */
}

.error-message {
    color: #dc3545;
    font-weight: bold;
}

/* Conjugation Table */
.conjugation-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem; /* Less margin after English translation */
    background-color: #FFFFFF;
    border: 1px solid #E7ECEF;
    border-radius: 5px; /* Slightly less rounded */
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02); /* Lighter shadow */
}

.conjugation-table th,
.conjugation-table td {
    padding: 7px 9px; /* Less padding */
    text-align: left;
    border-bottom: 1px solid #E7ECEF;
}

.conjugation-table th {
    background-color: #E7ECEF;
    color: #8B8C89;
    font-weight: 600;
    font-size: 0.8em; /* Smaller */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conjugation-table tr:last-child td {
    border-bottom: none;
}

/* Zebra striping for table rows */
.conjugation-table tbody tr:nth-child(odd) {
    background-color: #FFFFFF;
}

.conjugation-table tbody tr:nth-child(even) {
    background-color: #fcfdfe;
}


/* Example Sentences */
.example-sentences {
    margin-top: 0.8rem; /* Less margin above 'Example Sentences' header */
    padding-top: 0.6rem; /* Less padding */
    border-top: 1px solid #E7ECEF;
}

.sentence-pair {
    background-color: #F8F9FA;
    padding: 6px 10px; /* Less padding at top/bottom of each example sentence box */
    border-radius: 5px;
    margin-bottom: 8px; /* Less margin between sentence pairs */
    border: 1px solid #E7ECEF;
}

.korean-sentence {
    font-size: 1em; /* Smaller */
    font-weight: 500;
    color: #274C77;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    margin-bottom: 0.2rem; /* Less margin */
}

.english-sentence {
    font-size: 0.85em; /* Smaller */
    color: #8B8C89;
    font-style: italic;
    margin-top: 0;
}

/* Audio Play Buttons */
.audio-btn {
    background-color: transparent;
    color: #274C77;
    border: none;
    padding: 3px; /* Less padding */
    width: 24px; /* Smaller */
    height: 24px; /* Smaller */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85em; /* Smaller icon */
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: none;
    flex-shrink: 0;
}

.audio-btn:hover {
    background-color: rgba(39, 76, 119, 0.05); /* Even lighter hover effect */
    transform: translateY(-0.5px); /* Less pronounced lift */
    box-shadow: none;
}

.audio-btn:active {
    background-color: rgba(39, 76, 119, 0.08); /* Even lighter active effect */
    transform: translateY(0);
    box-shadow: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 0.8rem 0; /* Less padding */
    background-color: #FFFFFF;
    border-top: 1px solid #E7ECEF;
    color: #8B8C89;
    font-size: 0.75em; /* Smaller */
    margin-top: auto;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.05rem;
    }

    .conjugation-table {
        font-size: 0.75em;
    }

    .conjugation-table th,
    .conjugation-table td {
        padding: 5px 7px;
    }

    .filter-buttons {
        gap: 5px;
    }

    .filter-btn {
        width: calc(100% - 24px); /* Adjusted for tighter main padding */
        max-width: 200px;
        padding: 6px 10px;
        font-size: 0.8em;
    }
    .main-action-link {
        font-size: 0.85em;
        padding: 3px 5px;
        margin-top: 5px;
        margin-bottom: 5px;
    }

    .korean-sentence {
        font-size: 0.95em;
    }
    .english-sentence {
        font-size: 0.8em;
    }
    .sentence-pair {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    main {
        margin: 8px auto;
        padding: 0 8px;
    }

    .audio-btn {
        padding: 2px;
        width: 20px;
        height: 20px;
        font-size: 0.8em;
    }
}

/* --- */
/* Subscription Form */
#subscribe-section {
    margin-top: 1.8rem; /* Slightly reduced */
    padding-top: 1.2rem; /* Slightly reduced */
    border-top: 1px solid #E7ECEF;
    text-align: center;
}

#subscribe-section h2 {
    font-size: 1.5rem; /* Slightly smaller */
    color: #274C77;
    margin-bottom: 0.6rem; /* Reduced */
    justify-content: center;
}

#subscribe-section p {
    font-size: 0.9em; /* Slightly smaller */
    color: #8B8C89;
    margin-bottom: 1rem; /* Reduced */
}

.subscribe-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* Reduced space between form groups */
    max-width: 450px;
    margin: 0 auto 15px auto; /* Reduced bottom margin */
    padding: 12px; /* Reduced padding around the form */
    border: 1px solid #E7ECEF;
    border-radius: 8px;
    background-color: #F8F9FA;
}

.subscribe-form .form-group {
    width: 100%;
    margin-bottom: 0; /* No explicit margin-bottom for form-group, controlled by gap */
}

.subscribe-form input[type="email"] {
    width: calc(100% - 20px);
    padding: 9px; /* Slightly reduced padding */
    border: 1px solid #E7ECEF;
    border-radius: 5px;
    font-size: 0.95em; /* Slightly smaller */
    color: #343a40;
    background-color: #FFFFFF;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.subscribe-form input[type="email"]:focus {
    border-color: #A3CEF1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(163, 206, 241, 0.25);
}

.subscribe-form .level-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px; /* Reduced */
    margin-top: 5px;
}

.subscribe-form .level-prompt {
    font-size: 0.85em; /* Slightly smaller */
    color: #8B8C89;
    margin-bottom: 3px; /* Reduced */
    font-weight: 500;
}

.subscribe-form .level-options {
    display: flex;
    gap: 10px; /* Reduced space between radio buttons */
    flex-wrap: wrap;
    justify-content: center;
}

.subscribe-form .level-options input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.subscribe-form .level-options label {
    background-color: #E7ECEF;
    color: #8B8C89;
    padding: 7px 10px; /* Reduced padding */
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em; /* Slightly smaller */
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.subscribe-form .level-options input[type="radio"]:checked + label {
    background-color: #6096BA;
    color: white;
    box-shadow: 0 2px 4px rgba(96, 150, 186, 0.2);
}

.subscribe-form .level-options label:hover {
    background-color: #A3CEF1;
    color: #274C77;
}

.subscribe-btn {
    background-color: #274C77;
    color: white;
    border: none;
    padding: 10px 20px; /* Reduced padding */
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em; /* Slightly smaller */
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 250px;
    margin-top: 8px; /* Reduced */
    box-shadow: 0 3px 8px rgba(39, 76, 119, 0.25);
}

.subscribe-btn:hover {
    background-color: #6096BA;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(96, 150, 186, 0.3);
}

.subscribe-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(39, 76, 119, 0.15);
}

#subscribe-message {
    margin-top: 8px; /* Reduced */
    font-size: 0.85em; /* Slightly smaller */
    padding: 0; /* Remove default paragraph padding if it was adding space */
}

/* Responsive adjustments for the new form */
@media (max-width: 768px) {
    #subscribe-section h2 {
        font-size: 1.3rem;
    }

    .subscribe-form {
        max-width: 380px;
        padding: 10px;
    }

    .subscribe-form input[type="email"] {
        padding: 7px;
        font-size: 0.9em;
    }

    .subscribe-form .level-options label {
        padding: 6px 9px;
        font-size: 0.8em;
    }

    .subscribe-btn {
        padding: 9px 18px;
        font-size: 0.9em;
    }
    #subscribe-message {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    #subscribe-section h2 {
        font-size: 1.1rem;
    }

    .subscribe-form {
        max-width: 95%;
        gap: 6px;
    }

    .subscribe-form .level-options {
        flex-direction: column;
        gap: 6px;
    }
    .subscribe-form .level-options label {
        width: calc(100% - 20px);
    }
}



