:root {
    --primary-color: #4CAF50; /* Green */
    --primary-dark-color: #388E3C;
    --secondary-color: #FFC107; /* Amber */
    --background-color: #f4f7f6;
    --text-color: #333;
    --light-text-color: #777;
    --border-color: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --font-family-sans: 'Roboto', 'Noto Sans KR', sans-serif;
    --font-family-serif: 'Merriweather', serif;
}

/* Base Styles */
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;
}

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

a:hover {
    text-decoration: underline;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 2px 4px var(--shadow-color);
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-family: var(--font-family-serif);
}

header .description {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0.5rem auto 0;
}

main {
    flex: 1;
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow-color);
}

h2 {
    color: var(--primary-dark-color);
    font-family: var(--font-family-serif);
    font-size: 2rem;
    margin-top: 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Upload Section */
#upload-section p {
    margin-bottom: 1.5rem;
}

#image-upload {
    display: block;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fdfdfd;
}

#uploaded-image {
    display: block;
    margin: 1rem auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 1px 3px var(--shadow-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: block;
    width: fit-content;
    margin: 1.5rem auto 0;
}

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

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#result-container {
    margin-top: 1.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    color: var(--primary-dark-color);
}

#label-container {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--light-text-color);
}

#label-container div {
    margin-bottom: 0.3rem;
}

/* AdSense Section */
#adsense-ad {
    text-align: center;
}

/* How It Works Section */
#how-it-works ul {
    list-style: none;
    padding: 0;
}

#how-it-works li {
    background-color: #e8f5e9; /* Light green */
    margin-bottom: 0.5rem;
    padding: 0.8rem 1rem;
    border-left: 5px solid var(--primary-color);
    border-radius: 4px;
}

/* About Us & Contact Section */
#about-us p, #contact p {
    margin-bottom: 1rem;
}

#contact form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#contact .form-group {
    display: flex;
    flex-direction: column;
}

#contact label {
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--primary-dark-color);
}

#contact input[type="text"],
#contact input[type="email"],
#contact textarea {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-family-sans);
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box; /* Ensures padding doesn't increase total width */
}

#contact input[type="text"]:focus,
#contact input[type="email"]:focus,
#contact textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

#contact button[type="submit"] {
    align-self: flex-start; /* Align button to the start of the form */
    margin-top: 1rem;
}


/* Footer */
footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
}

footer nav a {
    color: var(--secondary-color);
    margin: 0 0.5rem;
}

footer nav a:hover {
    text-decoration: underline;
}

footer p {
    margin: 0.5rem 0;
}

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

    main {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }

    section {
        padding: 1.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    button {
        padding: 0.7rem 1.2rem;
        font-size: 1rem;
    }
}

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Roboto:wght@400;700&display=swap');