html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    background: #1a1a1a;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect x="0" y="0" width="100" height="100" fill="transparent"/><path d="M 0 0 L 100 100 M 100 0 L 0 100" stroke="rgba(255,255,255,0.02)" stroke-width="1"/></svg>');
    background-size: 20px 20px;
    background-blend-mode: soft-light;
}

body.is-loading > *:not(#pre-loader) {
    visibility: hidden;
    opacity: 0;
}

#pre-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.75s ease, visibility 0.75s ease;
}

#pre-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    color: #fff;
    width: 90%;
    max-width: 400px;
}

.loader-logo {
    font-size: 3em;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 25px;
    color: #3498db;
    user-select: none;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: #3498db;
    border-radius: 5px;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.8);
}

#preloader-text {
    font-size: 1.1em;
    color: #ccc;
    letter-spacing: 1px;
    min-height: 1.5em;
    user-select: none;
}

header {
    background: #2a2a2a;
    color: #f0f0f0;
    padding: 0 40px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 65px;
    display: flex;
    align-items: center;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-title {
    font-size: 1.8em;
    font-weight: 700;
    letter-spacing: 2px;
    color: #e0e0e0;
}

.menu-container {
    position: relative;
}

.menu-btn {
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 1.5em;
    cursor: pointer;
    padding: 10px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}
.menu-btn svg {
    width: 24px;
    height: 24px;
}
.menu-btn:hover {
    color: #3498db;
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #333;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    padding: 10px 0;
    list-style: none;
    margin: 10px 0 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s linear;
}

.menu-container:hover .menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.menu-dropdown a {
    color: #e0e0e0;
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 1.1em;
    transition: background-color 0.3s, color 0.3s;
}

.menu-dropdown a:hover {
    background-color: #3498db;
    color: #fff;
}

.nav-action-btn {
    background-color: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.nav-action-btn:hover {
    background-color: #3498db;
    border-color: #3498db;
    color: #fff;
}

.language-switcher {
    display: flex;
    gap: 5px;
    background-color: #222;
    padding: 5px;
    border-radius: 8px;
}
.lang-btn {
    background-color: transparent;
    color: #aaa;
    padding: 6px 15px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}
.lang-btn:hover {
    background-color: #444;
    color: #fff;
    transform: none;
}
.lang-btn.active {
    background-color: #3498db;
    color: white;
    font-weight: bold;
    box-shadow: none;
    transform: none;
}

main {
    flex: 1;
    padding: 60px;
    max-width: 1300px;
    margin: 40px auto;
    background: #282828;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

section {
    margin-bottom: 70px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    padding: 30px;
    border-radius: 15px;
    background-color: #333;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

section:first-of-type {
    margin-top: 0;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    height: auto;
    overflow: visible;
}

h2 {
    color: #f0f0f0;
    border-bottom: 3px solid #555;
    padding-bottom: 25px;
    margin-bottom: 40px;
    font-size: 2.8em;
    text-align: center;
    position: relative;
    font-weight: 600;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.8);
}

#master-drag-drop-area {
    border: 4px dashed #3498db; 
    background-color: #3a3a3a; 
    padding: 80px 50px;
    text-align: center;
    cursor: pointer;
    border-radius: 15px;
    transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.2);
}
#master-drag-drop-area:hover {
    background-color: #4a4a4a; 
    border-color: #2980b9; 
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
#master-drag-drop-area.highlight {
    background-color: #4a4a4a; 
    border-color: #2980b9; 
    transform: scale(1.02); 
    box-shadow: 0 12px 35px rgba(0,0,0,0.5);
}
#master-drag-drop-area p {
    font-size: 1.6em;
    color: #3498db; 
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

#master-file-list.single-file-list {
    list-style-type: none;
    padding: 0;
    margin-top: 0; 
    border: 1px solid #555;
    border-radius: 10px;
    background-color: #3a3a3a;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    display: none;
}

button#master-check-btn {
    background-color: #2ecc71; 
    color: white;
    padding: 18px 35px;
    border: none;
    border-radius: 12px;
    font-size: 1.3em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease;
    display: block;
    width: fit-content;
    margin: 30px auto 25px; 
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.4); 
    font-weight: bold;
    letter-spacing: 0.5px;
}
button#master-check-btn:hover:not(:disabled) {
    background-color: #27ae60; 
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.5); 
}
button#master-check-btn:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
    transform: none;
}

.results-box {
    border-radius: 10px;
    padding: 25px 30px;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: #444;
    color: #e0e0e0;
    border-left: 5px solid transparent;
    display: none;
}

#stems-summary-display.results-box {
    margin-bottom: 20px;
}

#report-actions-container {
    display: none; 
    padding: 10px 0 20px 0;
    text-align: center;
}

#export-report-btn {
    background-color: #3498db;
    padding: 12px 28px;
    font-size: 1.1em;
}
#export-report-btn:hover {
    background-color: #2980b9;
}


.results-box.status-pass-info {
    background-color: #3a4a3a;
    border-left-color: #2ecc71;
    color: #e0ffe0;
}
.results-box.status-fail {
    background-color: #4a3a3a;
    border-left-color: #e74c3c;
    color: #ffe0e0;
}
.results-box p:first-of-type {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: bold;
}

.results-box .summary-message {
    font-size: 1.1em;
    line-height: 1.5;
    margin-bottom: 20px;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    padding: 0;
    list-style-type: none;
}

.detail-item {
    display: flex;
    align-items: center;
    font-size: 1.05em;
    padding: 12px 15px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-right: 15px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    border-radius: 50%;
}

.detail-item.status-pass::before {
    background-color: #2ecc71;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>');
}

.detail-item.status-fail::before {
    background-color: #e74c3c;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg>');
}
.detail-item.status-info::before {
    background-color: #3498db;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4m0-4h.01"/></svg>');
}

.detail-item.status-fail.clickable-error {
    cursor: pointer;
    transition: background-color: 0.2s;
}
.detail-item.status-fail.clickable-error:hover {
    background-color: rgba(231, 76, 60, 0.2);
}

#drag-drop-area {
    border: 4px dashed #3498db;
    background-color: #3a3a3a;
    padding: 80px 60px;
    text-align: center;
    cursor: default;
    border-radius: 15px;
    transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.2);
}

#drag-drop-area.highlight {
    background-color: #4a4a4a;
    border-color: #2980b9;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

#drag-drop-area p {
    font-size: 1.8em;
    color: #3498db;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    margin: 0 0 30px 0;
}

.upload-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.action-btn {
    background-color: #3498db;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
}
.action-btn:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
}

.or-separator {
    color: #999;
    font-size: 1.1em;
    font-weight: 500;
}

#file-list {
    list-style-type: none;
    padding: 0;
    margin-top: 0; 
    border: 1px solid #444;
    border-radius: 12px;
    max-height: 500px;
    overflow-y: auto;
    background-color: #3a3a3a;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.2);
}

#master-file-list.single-file-list li,
#file-list li {
    padding: 20px 35px;
    border-bottom: 1px solid #4a4a4a;
    background-color: #3a3a3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e0e0e0;
    gap: 15px;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInSlideUp 0.6s ease-out forwards;
}

#master-file-list.single-file-list li:hover,
#file-list li:hover {
    background-color: #4a4a4a;
    transform: translateX(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#file-list li:last-child,
#master-file-list.single-file-list li:last-child {
    border-bottom: none;
}

#file-list .no-files-item {
    justify-content: center;
    color: #888;
}
#file-list .no-files-item:hover {
    transform: none;
    background-color: #3a3a3a;
    box-shadow: none;
}

#file-list-actions-container {
    display: none; 
    text-align: right;
    padding: 15px 20px;
}
#clear-all-btn {
    background-color: #e74c3c;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: 500;
}
#clear-all-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

.file-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.file-info-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 20px;
}

.file-size {
    color: #bbbbbb;
    white-space: nowrap;
}

button.remove-file-btn {
    background-color: #e74c3c;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease;
    margin-left: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

button.remove-file-btn:hover {
    background-color: #c0392b;
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

button#start-check-btn {
    background-color: #2ecc71;
    color: white;
    padding: 22px 45px;
    border: none;
    border-radius: 15px;
    font-size: 1.6em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease;
    display: block;
    width: fit-content;
    margin: 40px auto; 
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.6);
    font-weight: bold;
    letter-spacing: 1px;
}

button#start-check-btn:hover:not(:disabled) {
    background-color: #27ae60;
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(46, 204, 113, 0.8);
}

button#start-check-btn:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
    transform: none;
}

@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#results-details-list {
    display: flex;
    flex-direction: column;
    gap: 15px; 
    margin-top: 25px;
}

.result-card {
    background-color: #3a3a3a;
    border-radius: 12px;
    border-left: 8px solid;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInSlideUp 0.5s ease-out forwards;
}

.result-card.status-pass { border-left-color: #2ecc71; }
.result-card.status-fail { border-left-color: #e74c3c; }

.result-card .card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background-color: rgba(0,0,0,0.1);
    cursor: pointer;
    user-select: none;
}

.result-card .card-header .file-name {
    font-size: 1.2em;
    font-weight: 500;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.result-card.status-pass .file-name { color: #f0f0f0; }
.result-card.status-fail .file-name { color: #ffdddd; }

.result-card .card-status-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 20px;
    flex-shrink: 0;
}

.result-card.status-pass .card-status-icon {
    background-color: #2ecc71;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>');
}
.result-card.status-fail .card-status-icon {
    background-color: #e74c3c;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg>');
}

.card-toggle-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23cccccc" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease-in-out;
    margin-left: auto;
}

.result-card .card-body {
    padding: 0 25px 25px 25px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out, opacity 0.3s ease-in-out;
}

.result-card.is-collapsed .card-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}
.result-card.is-collapsed .card-toggle-icon {
    transform: rotate(-90deg);
}


.result-card .card-body .detail-list {
    margin-top: 0;
    padding-left: 10px;
    border-left: 2px solid #555;
}

.status-pass { color: #2ecc71; font-weight: bold; }
.status-fail { color: #e74c3c; font-weight: bold; }
.status-info { color: #3498db; font-weight: bold; }

footer {
    background: #2a2a2a;
    color: #bbbbbb;
    padding: 2rem 40px;
    margin-top: auto;
    font-size: 0.9em;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    z-index: 2;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
}

.footer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.footer-left .social-links {
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}
.footer-left .social-links a {
    color: #999;
    text-decoration: none;
    margin: 0;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
}
.footer-left .social-links .footer-icon {
    width: 24px;
    height: 24px;
}
.footer-left .social-links a:hover {
    color: #fff;
    text-decoration: none;
}
.footer-left .social-links span {
    display: none;
}

.footer-left .copyright-text {
    margin: 0;
    color: #888;
    font-size: 0.9em;
}

.footer-right {
    display: flex;
    gap: 25px;
}
.footer-right a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-right a:hover {
    color: #fff;
    text-decoration: underline;
}

#loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85);
    display: flex; justify-content: center; align-items: center; z-index: 3000;
    opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease;
}
#loading-overlay.active { opacity: 1; visibility: visible; }
.loading-container { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.icon-wrapper { width: 100px; height: 100px; position: relative; transition: transform 0.3s ease-in-out; }
.spinner {
    width: 100%; height: 100%; border: 8px solid rgba(255, 255, 255, 0.2);
    border-top-color: #3498db; border-radius: 50%; animation: spin 1s linear infinite;
    position: absolute; top: 0; left: 0; opacity: 1; transition: opacity 0.3s ease-in-out;
}
@keyframes spin { to { transform: rotate(360deg); } }
.icon-success, .icon-failure {
    width: 100%; height: 100%; border-radius: 50%; position: absolute; top: 0; left: 0;
    opacity: 0; transform: scale(0.5); transition: all 0.4s cubic-bezier(0.25, 0.25, 0.25, 1.25);
}
.icon-success .circle, .icon-failure .circle {
    stroke-dasharray: 166; stroke-dashoffset: 166; stroke-width: 4; stroke-miterlimit: 10;
    stroke: #fff; fill: none; animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.icon-success .checkmark, .icon-failure .cross {
    stroke-dasharray: 48; stroke-dashoffset: 48; stroke-width: 4; stroke-linecap: round;
    stroke: #fff; fill: none; animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}
@keyframes stroke { 100% { stroke-dashoffset: 0; } }
#loading-overlay.success .icon-wrapper, #loading-overlay.failure .icon-wrapper { animation: icon-pop 0.5s ease-out forwards; }
@keyframes icon-pop { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
#loading-overlay.success .spinner, #loading-overlay.failure .spinner { opacity: 0; }
#loading-overlay.success .icon-wrapper { background-color: #2ecc71; border-radius: 50%; transition: background-color 0.3s ease; }
#loading-overlay.success .icon-success { opacity: 1; transform: scale(1); }
#loading-overlay.failure .icon-wrapper { background-color: #e74c3c; border-radius: 50%; transition: background-color 0.3s ease; }
#loading-overlay.failure .icon-failure { opacity: 1; transform: scale(1); }
#loading-progress-text { color: #e0e0e0; font-size: 1.2em; text-align: center; min-height: 1.5em; transition: opacity 0.3s ease; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background-color: #333;
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content {
    transform: scale(1);
}
.modal-content h3 {
    margin-top: 0;
    font-size: 1.8em;
    color: #f0f0f0;
}
.modal-content p {
    font-size: 1.1em;
    color: #ccc;
    line-height: 1.7;
    margin: 20px 0 30px 0;
}
.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}
.modal-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.modal-btn.primary {
    background-color: #3498db;
    color: white;
}
.modal-btn.primary:hover {
    background-color: #2980b9;
}
.modal-btn.danger {
    background-color: #e74c3c;
    color: white;
}
.modal-btn.danger:hover {
    background-color: #c0392b;
}
.modal-btn.secondary {
    background-color: #555;
    color: #eee;
}
.modal-btn.secondary:hover {
    background-color: #666;
}

.welcome-modal-content {
    max-width: 650px;
    text-align: left;
}
.welcome-modal-body {
    margin-bottom: 25px;
}
.welcome-modal-body p {
    font-size: 1em;
    margin: 15px 0;
    color: #ddd;
}
.welcome-modal-donate-container {
    text-align: center;
    margin-bottom: 25px;
}
.welcome-modal-signature {
    text-align: right;
    margin-top: 25px;
    color: #bbb;
    font-size: 0.95em;
}
.welcome-modal-signature p {
    margin: 4px 0;
    line-height: 1.5;
}
.welcome-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #444;
}
.dont-show-again {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.dont-show-again input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}
.dont-show-again label {
    color: #ccc;
    font-size: 0.9em;
    user-select: none;
    cursor: pointer;
}
.modal-btn.success {
    background-color: #2ecc71;
    color: white;
}
.modal-btn.success:hover {
    background-color: #27ae60;
}
.donation-modal-content {
    max-width: 550px;
}
.qr-code-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin: 25px 0 35px 0;
}
.qr-code-container img {
    width: 180px;
    height: auto;
    max-width: 45%;
    border-radius: 10px;
    background-color: #fff;
    padding: 5px;
    object-fit: contain;
}
.donation-modal-extra-action {
    margin-top: -15px;
    margin-bottom: 30px;
    text-align: center;
}

.issue-modal-content {
    text-align: left;
    max-width: 600px;
}
.issue-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.export-btn {
    padding: 8px 18px;
    font-size: 1em;
    background-color: #27ae60;
    color: white;
}
.export-btn:hover {
    background-color: #2ecc71;
}
.issue-list {
    list-style-type: none;
    padding: 0;
    margin: 20px 0 30px 0;
    max-height: 300px;
    overflow-y: auto;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid #444;
}
.issue-list-item {
    padding: 12px 20px;
    border-bottom: 1px solid #444;
}
.issue-list-item:last-child {
    border-bottom: none;
}
.issue-list-item .file-name {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #ddd;
}
.issue-list-item .file-name .status-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-right: 12px;
}
.issue-list-item .error-detail {
    margin-top: 8px;
    margin-left: 32px;
    font-size: 0.9em;
    color: #aaa;
}
.issue-list-item .status-icon.status-fail {
    background-color: #e74c3c;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg>');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px;
    border-radius: 50%;
}

.stems-info-modal-content {
    max-width: 800px;
    text-align: left;
}
.stems-info-body {
    margin-bottom: 25px;
}
.stems-info-body p {
    font-size: 1em;
    margin: 15px 0;
    color: #ddd;
    line-height: 1.7;
}
.stems-info-images-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
}
.stems-info-figure {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex: 1;
}
.stems-info-figure img {
    max-width: 100%;
    height: auto;
    max-height: 350px;
    border-radius: 8px;
    background-color: #222;
    border: 1px solid #555;
    object-fit: contain;
}
.stems-info-caption {
    font-size: 1.1em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.stems-info-caption::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
    border-radius: 50%;
}
.stems-info-caption.status-pass::before {
    background-color: #2ecc71;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>');
}
.stems-info-caption.status-fail::before {
    background-color: #e74c3c;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg>');
}

.disclaimer-modal-content {
    max-width: 700px;
    text-align: left;
}
.disclaimer-modal-content h3 {
    text-align: center;
    margin-bottom: 25px;
}
#disclaimer-content-container p {
    font-size: 1em;
    color: #ccc;
    line-height: 1.8;
    margin: 0 0 18px 0;
}
#disclaimer-content-container p:last-child {
    margin-bottom: 0;
}
#disclaimer-content-container ul {
    list-style-type: disc;
    padding-left: 25px;
    margin: 20px 0;
    color: #ccc;
}
#disclaimer-content-container li {
    margin-bottom: 12px;
}
#disclaimer-content-container a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}
#disclaimer-content-container a:hover {
    text-decoration: underline;
    color: #5dade2;
}
.disclaimer-modal-content .modal-buttons {
    margin-top: 30px;
}

.detail-item[data-tooltip] {
    position: relative;
    cursor: help;
}

.detail-item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 120%;
    z-index: 10;
    
    background-color: #111;
    color: #eee;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #555;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    font-size: 0.9em;
    font-weight: normal;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
    width: 320px;
    max-width: calc(100vw - 40px);
    
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.detail-item[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}


@media (max-width: 992px) {
    main { padding: 40px; margin: 40px auto; }
    section { padding: 20px; }
    h2 { font-size: 2.2em; }
    #drag-drop-area, #master-drag-drop-area { padding: 70px 40px; }
    #drag-drop-area p, #master-drag-drop-area p { font-size: 1.5em; }
    #master-file-list.single-file-list li, #file-list li { padding: 18px 25px; }
    button#start-check-btn, button#master-check-btn { padding: 18px 35px; font-size: 1.3em; }
}
@media (max-width: 768px) {
    .navbar { flex-direction: column; height: auto; padding: 10px 20px; gap: 10px; }
    .nav-left, .nav-right { width: 100%; justify-content: space-between; }
    main { margin: 25px; padding: 25px; border-radius: 15px; }
    h2 { font-size: 1.8em; margin-bottom: 30px; padding-bottom: 20px; }
    h2::after { width: 50px; height: 3px; }
    #drag-drop-area, #master-drag-drop-area { padding: 60px 30px; }
    #drag-drop-area p, #master-drag-drop-area p { font-size: 1.3em; }
    #master-file-list.single-file-list li, #file-list li { padding: 15px 20px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .file-name { max-width: 100%; }
    .file-info-right { width: 100%; justify-content: space-between; }
    button.remove-file-btn { margin-top: 0; padding: 8px 16px; font-size: 1em; }
    button#start-check-btn, button#master-check-btn { padding: 15px 30px; font-size: 1.2em; }
    .lang-btn { padding: 9px 18px; font-size: 1em; margin: 0; }
    .spinner { width: 60px; height: 60px; border-width: 8px; }
    footer, .footer-content { flex-direction: column; text-align: center; gap: 20px;}
    .footer-left, .footer-right { align-items: center; }
    .footer-left .social-links { justify-content: center; }
    .stems-info-images-container { flex-direction: column; align-items: center; }
}
#desktop-only-message {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #1a1a1a; color: #e0e0e0; z-index: 2000; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    font-size: 1.5em; padding: 20px;
}
@media (max-width: 992px) {
    body > *:not(#desktop-only-message):not(#loading-overlay) { display: none !important; }
    #desktop-only-message { display: flex !important; }
}
@media (min-width: 993px) { #desktop-only-message { display: none !important; } }
#upload-section, #results-section { display: none; }
