/* Global & Reset Styles */
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 60px; /* Offset for fixed header height */
}
body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    color: #333;
    text-align: center;
    line-height: 1.6;
}

/* Header Styles */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px; /* Added padding */
    box-sizing: border-box; /* Added box-sizing */
}
.header-logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}
#hamburger-btn {
    background: none;
    border: none;
    font-size: 24px; /* Adjusted font-size */
    cursor: pointer; /* Added cursor pointer */
    color: #333;
    display: block;
}

/* Mobile Menu Styles */
#mobile-menu {
    position: fixed;
    top: 0;
    right: -100%; /* Initially hidden */
    width: 250px;
    max-width: 80%; /* Responsive width */
    height: 100%;
    background-color: #f8f8f8;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    padding-top: 60px; /* Space below header */
}
#mobile-menu.open {
    right: 0; /* Slide in */
}
#close-menu-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #333;
    display: block; /* Ensure it's visible */
}
#mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#mobile-menu li {
    border-bottom: 1px solid #eee; /* Separator for menu items */
}
#mobile-menu li:last-child {
    border-bottom: none;
}
.menu-item {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    font-size: 1.1em;
}
.menu-item:hover {
    background-color: #e9e9e9;
}

/* Main Content Container (redefined for layout reset) */
.container { /* This targets #home-section */
    background-color: #ffffff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-width: 600px; /* User specified */
    width: 100%;
    display: flex; /* For internal flex layout */
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 80px auto 0; /* User specified margin-top for header offset + auto for centering */
    position: relative; /* For z-index or other positioning if needed */
}

/* General element styles (previously inline or in original .container) */
h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2.5em;
    font-weight: 900;
}
.mode-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.mode-button {
    background: #f0f2f5;
    color: #555;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mode-button.active, .mode-button:hover {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.input-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* File Upload Styles */
.file-upload-wrapper {
    width: 100%;
    position: relative;
}
.file-upload-label {
    display: inline-block;
    background: linear-gradient(45deg, #4CAF50, #66BB6A);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.file-upload-label:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}
#image-upload {
    display: none;
}

/* Webcam Styles */
#webcam-view {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    border: 2px solid #ddd;
    display: none;
}
#webcam-button {
    background: linear-gradient(45deg, #FFC107, #FFA000);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 250px;
    display: none;
}
#webcam-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

#image-preview {
    max-width: 100%;
    max-height: 250px;
    height: auto;
    border-radius: 10px;
    border: 2px dashed #ddd;
    object-fit: contain;
    margin-top: 15px;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#check-salary-button, #share-button {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 300px;
    margin-top: 20px;
}
#kakao-share-button, #reset-button {
    background-color: #FEE500;
    color: #3C1E1E;
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 300px;
    margin-top: 10px;
}
#share-button {
    margin-top: 20px;
}
#check-salary-button:hover, #share-button:hover, #kakao-share-button:hover, #reset-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
#check-salary-button:disabled {
    background: linear-gradient(45deg, #cccccc, #aaaaaa);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#loading-message {
    font-size: 1.5em;
    font-weight: bold;
    color: #555;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    display: none; 
}
/* CSS Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#result-text {
    font-size: 2.2em;
    font-weight: 900;
    color: #2c3e50;
    margin-top: 30px;
    word-break: keep-all;
    line-height: 1.4;
}
#salary-amount {
    font-size: 2.8em;
    font-weight: bold;
    color: #007bff;
    margin-top: 10px;
}

/* Footer Styles */
#footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    font-size: 0.85em;
    color: #777;
}
#footer p {
    margin-bottom: 10px;
}
#footer a {
    color: #777;
    text-decoration: none;
    margin: 0 10px;
}
#footer a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #main-header {
        padding: 0 15px;
    }
    .header-logo {
        font-size: 1.3em;
    }
    #hamburger-btn {
        font-size: 1.8em;
    }
    #mobile-menu {
        width: 70%; /* Adjust width for smaller screens */
    }
    .container { /* Specific adjustment for main content container */
         margin-top: 70px; /* A bit more top margin for smaller screens */
    }
}
/* Card Link Buttons */
.card-link-container {
    width: 100%;
    max-width: 600px;
    margin: 40px auto 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 20px;
}

.card-link {
    display: block;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 20px 25px;
    text-decoration: none;
    color: #333;
    font-size: 1.3em;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-link::after {
    content: '>';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    color: #007bff;
    transition: right 0.3s ease;
}

.card-link:hover::after {
    right: 15px;
}

/* Section for additional text */
.info-section {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: left;
    color: #333;
}
.info-section h2 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
}
.info-section h3 {
    font-size: 1.3em;
    color: #0056b3;
    margin-bottom: 10px;
    font-weight: 600;
}
.info-section p {
    font-size: 0.95em;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}
.info-section p:last-child {
    margin-bottom: 0;
}
.privacy-alert {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 1em;
    line-height: 1.5;
    text-align: center;
}
/* Contact Form Styles */
.contact-form-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: left;
}
.contact-form-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2em;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}
.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    border-color: #007bff;
    outline: none;
}
.form-group textarea {
    resize: vertical;
    min-height: 120px;
}
.submit-button {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.mailto-link-container {
    text-align: center;
    margin-top: 25px;
    font-size: 1.1em;
}
.mailto-link-container a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}
.mailto-link-container a:hover {
    text-decoration: underline;
}
.cross-link-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.finance-test-container {
    max-width: 800px;
    text-align: left;
}

.quiz-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quiz-question {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e9ecef;
}

.quiz-question h3 {
    margin: 0 0 10px 0;
    font-size: 1.05em;
    color: #222;
}

.quiz-question label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95em;
    color: #444;
    cursor: pointer;
}

.quiz-question input[type="radio"] {
    margin-right: 8px;
}

.finance-result-box {
    width: 100%;
    margin-top: 20px;
    padding: 20px;
    background: #eef6ff;
    border: 1px solid #d5e7ff;
    border-radius: 12px;
}

.finance-result-box h2 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    color: #0b4ea2;
}

.finance-result-tip {
    margin-top: 8px;
    font-weight: bold;
    color: #1f4f82;
}

/* Blog List Styles */
.blog-list-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: left;
}
.blog-list-container h1 {
    text-align: center;
    margin-bottom: 40px;
    color: #333;
    font-size: 2.5em;
}
.blog-post-card {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.blog-post-card h2 {
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 10px;
}
.blog-post-card h2 a {
    color: #007bff;
    text-decoration: none;
}
.blog-post-card h2 a:hover {
    text-decoration: underline;
}
.blog-post-card p {
    font-size: 1em;
    color: #555;
    line-height: 1.6;
}
.blog-post-card .post-date {
    font-size: 0.85em;
    color: #999;
    text-align: right;
    margin-top: 15px;
}
