/* General Body Styles */
body {
    font-family: 'Pretendard', 'Malgun Gothic', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f4f7f6;
    transition: background-color 0.3s, color 0.3s;
    box-sizing: border-box;
}

body.dark-mode {
    background-color: #2c3e50;
    color: #ecf0f1;
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    flex-grow: 1; /* Make main content grow to fill space */
}

/* Header and Navigation Bar */
header {
    width: 100%;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.dark-mode header {
    background-color: #34495e;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.navigation-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
}

.nav-logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

body.dark-mode .nav-logo {
    color: #ecf0f1;
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: bold;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #2ecc71;
}

body.dark-mode .nav-links a {
    color: #bdc3c7;
}

body.dark-mode .nav-links a:hover {
    color: #27ae60;
}


/* Ads Container */
.ads-container {
    margin: 20px 0;
    text-align: center;
    width: 100%;
    max-width: 728px;
}

/* Main Content Container */
.container {
    text-align: center;
    background: white;
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    width: 90%;
    max-width: 500px;
    margin-bottom: 20px;
    transition: background-color 0.3s, box-shadow 0.3s;
}

body.dark-mode .container {
    background: #34495e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Specific container for text-heavy pages */
.text-container {
    text-align: left;
    max-width: 800px;
}

.text-container h1, .text-container h2 {
    margin-bottom: 1em;
}

.text-container p, .text-container li {
    line-height: 1.8;
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8em;
}

body.dark-mode h1 {
    color: #ecf0f1;
}

p {
    color: #7f8c8d;
    margin-bottom: 30px;
}

body.dark-mode p {
    color: #bdc3c7;
}

#result {
    font-size: 1.8em;
    font-weight: bold;
    color: #e74c3c;
    min-height: 50px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* General Button Styles */
button {
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    color: white;
    background-color: #2ecc71;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover {
    background-color: #27ae60;
}

button:active {
    transform: scale(0.98);
}

/* Theme Toggle Button */
#theme-toggle {
    background-color: #3498db;
    margin-left: 20px; /* Add margin to separate from nav links */
}

body.dark-mode #theme-toggle {
    background-color: #f39c12;
}

/* Contact Form */
.contact-form-container {
    padding-top: 30px;
}

.contact-form-container h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.5em;
}

body.dark-mode .contact-form-container h2 {
    color: #ecf0f1;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: bold;
}

body.dark-mode .form-group label {
    color: #bdc3c7;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    background-color: #f9f9f9;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}

body.dark-mode .form-group input[type="text"],
body.dark-mode .form-group input[type="email"],
body.dark-mode .form-group textarea {
    background-color: #2c3e50;
    border-color: #555;
    color: #ecf0f1;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    border-color: #2ecc71;
    outline: none;
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
}

.contact-form-container button[type="submit"] {
    width: 100%;
    margin-top: 20px;
    background-color: #3498db;
}

.contact-form-container button[type="submit"]:hover {
    background-color: #2980b9;
}

body.dark-mode .contact-form-container button[type="submit"] {
    background-color: #9b59b6;
}

body.dark-mode .contact-form-container button[type="submit"]:hover {
    background-color: #8e44ad;
}

/* Article Page Styles */
.article-header {
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}
body.dark-mode .article-header {
    border-bottom-color: #444;
}
.article-meta {
    font-size: 0.9em;
    color: #7f8c8d;
}
article section {
    margin-bottom: 30px;
}

/* Article List Styles */
.article-list {
    list-style: none;
    padding: 0;
}
.article-list li {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
}
body.dark-mode .article-list li {
    border-bottom-color: #444;
}
.article-list a {
    text-decoration: none;
    color: inherit;
    display: block;
}
.article-list h2 {
    color: #3498db;
    margin-bottom: 10px;
}
body.dark-mode .article-list h2 {
    color: #5dade2;
}
.article-list p {
    color: #7f8c8d;
    margin-bottom: 10px;
}
body.dark-mode .article-list p {
    color: #bdc3c7;
}
.article-date {
    font-size: 0.8em;
    color: #95a5a6;
}


/* Footer */
footer {
    width: 100%;
    text-align: center;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
    margin-top: auto; /* Push footer to the bottom */
}

body.dark-mode footer {
    background-color: #34495e;
    color: #bdc3c7;
}

footer p {
    margin: 0;
    color: #7f8c8d;
}

body.dark-mode footer p {
    color: #bdc3c7;
}
