:root {
    --bg-color: #f0f0f0;
    --container-bg-color: white;
    --text-color: #333;
    --subtext-color: #555;
    --button-bg-color: #333;
    --button-text-color: white;
    --shadow-color: rgba(0,0,0,0.1);
    --form-border-color: #ccc;
    --form-input-bg: white;
    --form-input-text: #333;
    --disqus-bg-color: var(--container-bg-color);
    --disqus-text-color: var(--text-color);
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --container-bg-color: #2c2c2c;
    --text-color: #f0f0f0;
    --subtext-color: #cccccc;
    --button-bg-color: #f0f0f0;
    --button-text-color: #333;
    --shadow-color: rgba(255,255,255,0.1);
    --form-border-color: #555;
    --form-input-bg: #3c3c3c;
    --form-input-text: #f0f0f0;
    --disqus-bg-color: var(--container-bg-color);
    --disqus-text-color: var(--text-color);
}

body {
    margin: 0;
    padding: 20px; /* Add some padding around the content */
    min-height: 100vh; /* Ensure body takes at least full viewport height */
    display: flex;
    flex-direction: column; /* Stack content vertically */
    align-items: center; /* Center horizontally */
    background-color: var(--bg-color);
    font-family: 'Pretendard', sans-serif;
    transition: background-color 0.5s ease;
    box-sizing: border-box; /* Include padding in element's total width and height */
}

.top-bar {
    position: fixed; /* Keep dark mode toggle visible */
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px; /* Add space between buttons */
}

.top-bar-btn {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 50px;
    transition: transform 0.2s, background-color 0.2s;
    text-decoration: none; /* Remove underline for links */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    font-family: 'Pretendard', sans-serif;
}

.top-bar-btn:hover {
    transform: scale(1.05);
}

.container {
    text-align: center;
    background-color: var(--container-bg-color);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px var(--shadow-color);
    transition: background-color 0.5s, box-shadow 0.5s;
    margin-bottom: 30px; /* Space below main content */
    width: 100%;
    max-width: 800px; /* Increased max-width */
    margin-top: 80px; /* More space from top for fixed top-bar */
}

h1 {
    color: var(--text-color);
    margin-bottom: 20px;
}

.color-code {
    font-size: 24px;
    font-weight: bold;
    color: var(--subtext-color);
    margin-bottom: 30px;
    font-family: monospace;
    height: 30px; /* Prevent layout shift */
}

button { /* General button style, for the '색깔 뽑기' button */
    padding: 15px 30px;
    font-size: 18px;
    cursor: pointer;
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    border: none;
    border-radius: 50px;
    transition: transform 0.2s, background-color 0.2s;
}

button:hover {
    transform: scale(1.05);
}

#colorDisplay {
    width: 100%;
    height: 100px;
    margin-top: 30px;
    border-radius: 10px;
    background-color: #eee;
    transition: background-color 0.5s ease;
}

/* Contact Form Specific Styles (now used by contact.html and .contact-page-container) */
.contact-form-section, .contact-page-container { /* Common styling for sections */
    background-color: var(--container-bg-color);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px var(--shadow-color);
    width: 100%;
    max-width: 500px; /* Limit form width */
    text-align: left; /* Align text within the form section */
    margin-bottom: 30px;
}

.contact-form-section h2, .contact-page-container h2 {
    color: var(--text-color);
    text-align: center;
    margin-bottom: 30px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--subtext-color);
    font-weight: bold;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--form-border-color);
    border-radius: 8px;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    background-color: var(--form-input-bg);
    color: var(--form-input-text);
    font-family: 'Pretendard', sans-serif;
    font-size: 16px;
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: #3498db; /* Highlight on focus */
    outline: none;
}

.contact-form button[type="submit"] {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    cursor: pointer;
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    border: none;
    border-radius: 50px;
    transition: transform 0.2s, background-color 0.2s;
}

.contact-form button[type="submit"]:hover {
    transform: scale(1.02); /* Slightly less pronounced hover for submit button */
    background-color: #000;
}

/* Disqus Specific Styles */
#disqus_thread {
    background-color: var(--disqus-bg-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    width: 100%;
    max-width: 800px; /* Adjust as needed */
    margin-top: 30px;
    margin-bottom: 50px; /* Space from bottom */
}

/* Basic styling for Disqus iframe, though Disqus often handles its own styling */
#disqus_thread iframe {
    background-color: var(--disqus-bg-color) !important;
    color: var(--disqus-text-color) !important;
    border-radius: 10px;
}