:root {
    --primary-color: #1a73e8;
    --primary-dark-color: #1665c8;
    --secondary-button-color: #e8f0fe;
    --secondary-button-text-color: #1967d2;
    --text-color: #3c4043;
    --secondary-text-color: #5f6368;
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --border-color: #dadce0;
    --error-color: #d93025;
}

body {
    font-family: 'Noto Sans JP', 'Roboto', "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header --- */
.site-header {
    width: 100%;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-color);
}
.logo-img {
    height: 32px;
    width: 32px;
}
.logo-text {
    font-size: 18px;
    font-weight: 500;
}

/* --- Language Selector --- */
.lang-selector-container {
    position: relative;
}
#lang-selector {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    cursor: pointer;
    font-size: 14px;
}

/* --- Main Content --- */
.container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    box-sizing: border-box;
    margin: 0 auto;
    flex-grow: 1; /* Make main content grow */
}

.card {
    background-color: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 32px;
    margin-bottom: 40px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    width: 100%;
    box-sizing: border-box;
}

.upload-card-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 8px;
    text-align: center;
}

.upload-card-header p {
    color: var(--secondary-text-color);
    margin-bottom: 32px;
    font-size: 16px;
    text-align: center;
}

#drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    text-align: center;
}

#drop-zone.dragover {
    background-color: #e8f0fe;
    border-color: var(--primary-color);
}

#drop-zone .material-icons {
    font-size: 48px;
    color: var(--primary-color);
}

#drop-zone p {
    margin: 16px 0 0;
    color: var(--secondary-text-color);
    font-weight: 500;
}

#drop-zone span {
    color: var(--primary-color);
    font-weight: 700;
}

input[type="file"] {
    display: none;
}

.options {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkbox-container {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.checkbox-container input { display: none; }
.checkbox-container .checkmark {
    width: 18px; height: 18px; border: 2px solid var(--secondary-text-color); border-radius: 3px;
    margin-right: 8px; display: inline-block; position: relative; transition: background-color 0.2s, border-color 0.2s;
}
.checkbox-container .checkmark:after {
    content: ""; position: absolute; display: none; left: 5px; top: 1px;
    width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checkbox-container input:checked ~ .checkmark { background-color: var(--primary-color); border-color: var(--primary-color); }
.checkbox-container input:checked ~ .checkmark:after { display: block; }

#file-list-display {
    margin-top: 24px; text-align: left; max-height: 150px; overflow-y: auto;
    border-top: 1px solid var(--border-color); padding-top: 16px;
}
#file-list-display div { padding: 4px 0; font-size: 14px; color: var(--secondary-text-color); }

#submit-btn {
    background-color: var(--primary-color); color: white; border: none; border-radius: 4px; padding: 10px 24px;
    font-size: 16px; font-weight: 500; cursor: pointer; margin-top: 24px; transition: background-color 0.3s, box-shadow 0.3s;
    min-width: 200px; display: block; margin-left: auto; margin-right: auto;
}
#submit-btn:disabled { background-color: #e0e0e0; cursor: not-allowed; color: #9e9e9e; }
#submit-btn:not(:disabled):hover { background-color: var(--primary-dark-color); box-shadow: 0 1px 3px 0 rgba(0,0,0,0.2); }

/* --- Results Card --- */
#results-card { display: none; }
#results-card h2 { font-size: 22px; text-align: center; }
#results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
#download-all-btn, #process-more-btn {
    border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 4px;
    font-weight: 500; font-size: 14px; cursor: pointer; transition: background-color 0.2s;
}
#download-all-btn { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }
#download-all-btn:hover { background-color: var(--primary-dark-color); }
#process-more-btn { background-color: var(--surface-color); color: var(--primary-color); }
#process-more-btn:hover { background-color: var(--secondary-button-color); }
#processed-file-list { list-style: none; padding: 0; margin: 0; }
#processed-file-list li {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--border-color);
}
#processed-file-list li:last-child { border-bottom: none; }
.file-name { word-break: break-all; padding-right: 16px; }
.download-link {
    background-color: var(--secondary-button-color); color: var(--secondary-button-text-color);
    text-decoration: none; padding: 6px 12px; border-radius: 4px; font-size: 14px;
    font-weight: 500; transition: background-color 0.2s; white-space: nowrap;
}
.download-link:hover { background-color: #d2e3fc; }

#error-message {
    color: var(--error-color); background-color: #fce8e6; border: 1px solid var(--error-color);
    padding: 16px; border-radius: 8px; margin-top: 24px; text-align: center; display: none;
}

.article {
    background-color: var(--surface-color); padding: 32px; border-radius: 8px;
    border: 1px solid var(--border-color); text-align: left; line-height: 1.8;
}
.article h2 { font-size: 24px; border-bottom: 2px solid var(--primary-color); padding-bottom: 8px; margin-bottom: 24px; }
.article h3 { font-size: 20px; margin-top: 32px; border-left: 4px solid var(--primary-color); padding-left: 12px; }
.article p, .article ul { font-size: 16px; color: var(--secondary-text-color); }

/* --- Footer --- */
.site-footer {
    width: 100%;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 20px;
    box-sizing: border-box;
    margin-top: auto; /* Push footer to the bottom */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow items to wrap on small screens */
    gap: 20px;
}
.footer-links {
    display: flex;
    gap: 24px;
    align-items: center;
}
.footer-links a {
    text-decoration: none;
    color: var(--secondary-text-color);
    font-size: 13px;
}
.footer-links a:hover {
    color: var(--primary-color);
}

/* --- Media Queries (Responsive Design) --- */
@media (max-width: 768px) {
    .site-header {
        padding: 10px 15px;
    }
    .logo-text {
        font-size: 16px;
    }
    .container { padding: 10px; }
    .card, .article { padding: 20px; }
    .upload-card-header h1 { font-size: 24px; }
    #results-header { flex-direction: column; }

    /* Footer responsive */
    .site-footer {
        flex-direction: column; /* Stack items vertically */
        justify-content: center;
        text-align: center;
    }
}