/* General Body and Typography */
:root {
    --primary-color: #4A90E2; /* Blue */
    --secondary-color: #50E3C2; /* Teal */
    --accent-color: #F5A623; /* Orange */
    --text-color: #333;
    --light-text-color: #666;
    --background-color: #F8F9FA;
    --card-background: #FFFFFF;
    --border-color: #E0E0E0;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --font-family-sans: 'Apple SD Gothic Neo', 'Malgun Gothic', 'NanumGothic', 'Noto Sans KR', sans-serif;
    --font-family-serif: Georgia, serif;
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: var(--font-family-sans);
    color: var(--primary-color);
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5em;
    text-align: center;
    padding: 20px 0;
    color: var(--card-background);
}

h2 {
    font-size: 1.8em;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 1em;
}

p {
    margin-bottom: 1em;
}

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

a:hover {
    text-decoration: underline;
}

/* Header */
header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1em 0;
    box-shadow: 0 2px 5px var(--shadow-medium);
    position: relative; /* Needed for absolute positioning of language selector */
}

header h1 {
    margin: 0;
}

.language-selector {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 5px;
}

.lang-button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-size: 0.9em;
}

.lang-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.lang-button.active {
    background-color: rgba(255, 255, 255, 0.5);
    border-color: white;
    font-weight: bold;
}

header nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

header nav a {
    color: white;
    font-weight: bold;
    padding: 0.5em 1em;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

header nav a:hover,
header nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

/* Main Content */
main {
    flex: 1;
    padding: 20px;
    max-width: 960px;
    margin: 20px auto;
    background-color: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow-medium);
}

section {
    padding: 20px;
}

.active-section {
    display: block;
}

.test-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 3px 10px var(--shadow-light);
}

button:hover {
    background-color: #3A7BDC; /* Darker primary */
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 1px 5px var(--shadow-light);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5em 0;
    margin-top: 30px;
    background-color: var(--text-color);
    color: var(--background-color);
    font-size: 0.9em;
    box-shadow: 0 -2px 5px var(--shadow-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    header nav ul {
        flex-direction: column;
        gap: 10px;
    }

    header nav a {
        padding: 0.5em;
    }

    .test-options {
        flex-direction: column;
        gap: 15px;
    }

    button {
        width: 80%;
        margin: 0 auto;
    }
}

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

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.5em;
    }
}

/* Contact Form Styling */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    margin: 30px auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-background);
    box-shadow: 0 2px 10px var(--shadow-light);
}

.contact-form label {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.contact-form textarea {
    resize: vertical; /* Allow vertical resizing */
}

.contact-form button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: auto; /* Override general button width */
    align-self: flex-start; /* Align button to start */
    box-shadow: 0 3px 10px var(--shadow-light);
}

.contact-form button[type="submit"]:hover {
    background-color: #3A7BDC; /* Darker primary */
    transform: translateY(-2px);
}