body {
    font-family: Arial, sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background-color .3s, color .3s;
    background-color: #f0f0f0;
}
.container {
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    width: 400px;
    max-width: 90%;
    transition: background-color .3s, opacity .3s, transform .3s;
    background-color: #fff;
    display: none;
    margin-top: 60px;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(10px);
}
.container.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.container h1 {
    margin-top: 0;
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}
.form-group {
    margin-bottom: 18px;
}
label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: #555;
}
textarea, input[type=text], input[type=password] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    transition: background-color .3s, color .3s, border-color .3s;
    background-color: #fff;
    color: #333;
    box-sizing: border-box;
}
textarea:focus, input[type=text]:focus, input[type=password]:focus {
    border-color: #f7931a;
    outline: 0;
    box-shadow: 0 0 5px rgba(247,147,26,.3);
}
input[type=file] {
    display: block;
    margin-top: 5px;
    color: #555;
}
input[type=file]::file-selector-button {
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #eee;
    cursor: pointer;
    transition: background-color .2s;
    margin-right: 10px;
}
input[type=file]::file-selector-button:hover {
    background-color: #ddd;
}
button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color .2s, color .2s, box-shadow .2s, transform .1s;
    background-color: #555;
    color: #fff;
    margin-right: 5px;
    margin-top: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    font-weight: 700;
}
button:hover {
    background-color: #333;
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}
button:active {
    box-shadow: inset 0 1px 3px rgba(0,0,0,.2);
    transform: translateY(1px);
}
#barcodeForm button, #mainContainer > .form-group button {
    background-color: #eee;
    color: #333;
    border: 1px solid #ccc;
}
#barcodeForm button:hover, #mainContainer > .form-group button:hover {
    background-color: #ddd;
}
button[onclick="downloadBarcodes()"] {
    background-color: #4caf50;
    color: #fff;
    border: none;
}
button[onclick="downloadBarcodes()"]:hover {
    background-color: #45a049;
}
#scanBarcodeButton, #scanInspectionBarcodeButton {
    padding: 10px 12px;
    line-height: 1;
    flex-shrink: 0;
}
#result, #productResult, #inspectionProductResult {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: background-color .3s, color .3s;
    background-color: #f9f9f9;
    color: #333;
    min-height: 50px;
    word-wrap: break-word;
    line-height: 1.5;
}
#result ul, #productResult ul {
    padding-left: 20px;
    margin-top: 10px;
}
#result li, #productResult li {
    margin-bottom: 5px;
}
#cameraScannerContainer, #inspectionScannerContainer {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    background-color: #f0f0f0;
    margin-top: 15px;
}
#barcodeVideo, #inspectionBarcodeVideo {
    width: 100%;
    max-width: 360px;
    height: auto;
    border: 1px solid #b0b0b0;
    background-color: #000;
}
#scannerMessage, #inspectionScannerMessage {
    color: #e67e22;
    margin-top: 8px;
    min-height: 1.2em;
}
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px 0;
    transition: background-color .3s, color .3s;
    background-color: #ddd;
    color: #333;
    z-index: 10;
    font-size: .9em;
}
footer a {
    color: #333;
    text-decoration: none;
    font-weight: 700;
}
footer a:hover {
    text-decoration: underline;
}
.found {
    color: #4caf50;
    font-weight: 700;
}
.not-found {
    color: #f44336;
    font-weight: 700;
}
.dark-theme {
    background-color: #1e1e1e;
    color: #f1f1f1;
}
.dark-theme .container {
    background-color: #2d2d2d;
    box-shadow: 0 4px 15px rgba(0,0,0,.4);
}
.dark-theme .container h1 { color: #f1f1f1; }
.dark-theme label { color: #ccc; }
.dark-theme textarea, .dark-theme input[type=text], .dark-theme input[type=password] {
    background-color: #3a3a3a;
    color: #fff;
    border-color: #555;
}
.dark-theme textarea:focus, .dark-theme input[type=text]:focus, .dark-theme input[type=password]:focus {
    border-color: #f7931a;
    box-shadow: 0 0 5px rgba(247,147,26,.4);
}
.dark-theme input[type=file] { color: #ccc; }
.dark-theme input[type=file]::file-selector-button {
    background-color: #444;
    color: #eee;
    border-color: #555;
}
.dark-theme input[type=file]::file-selector-button:hover { background-color: #555; }
.dark-theme button {
    background-color: #555;
    color: #f1f1f1;
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.dark-theme button:hover {
    background-color: #666;
    box-shadow: 0 4px 8px rgba(0,0,0,.35);
}
.dark-theme #barcodeForm button, .dark-theme #mainContainer > .form-group button {
    background-color: #444;
    color: #eee;
    border: 1px solid #555;
}
.dark-theme #barcodeForm button:hover, .dark-theme #mainContainer > .form-group button:hover { background-color: #555; }
.dark-theme button[onclick="downloadBarcodes()"] {
    background-color: #81c784;
    color: #111;
    border: none;
}
.dark-theme button[onclick="downloadBarcodes()"]:hover { background-color: #66bb6a; }
.dark-theme #result, .dark-theme #productResult, .dark-theme #inspectionProductResult {
    background-color: #333;
    color: #fff;
    border-color: #555;
}
.dark-theme footer {
    background-color: #222;
    color: #aaa;
}
.dark-theme footer a { color: #f7931a; }
.dark-theme .found { color: #81c784; }
.dark-theme .not-found { color: #e57373; }
.dark-theme #cameraScannerContainer, .dark-theme #inspectionScannerContainer {
    background-color: #2a2a2a;
    border-color: #444;
}
.dark-theme #barcodeVideo, .dark-theme #inspectionBarcodeVideo {
    border-color: #555;
    background-color: #111;
}
.dark-theme #scannerMessage, .dark-theme #inspectionScannerMessage { color: #f39c12; }
.theme-toggle {
    position: fixed;
    top: 15px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 1001;
    background-color: rgba(255,255,255,.8);
    padding: 5px 10px;
    border-radius: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.dark-theme .theme-toggle {
    background-color: rgba(0,0,0,.5);
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.theme-toggle label {
    margin-right: 10px;
    font-weight: 400;
    font-size: .9em;
    color: #333;
    margin-bottom: 0;
    cursor: pointer;
}
.dark-theme .theme-toggle label { color: #eee; }
#themeSwitch {
    appearance: none;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background-color .3s;
    vertical-align: middle;
}
#themeSwitch::before {
    content: '';
    width: 16px;
    height: 16px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left .3s;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
#themeSwitch:checked { background-color: #f7931a; }
#themeSwitch:checked::before { left: 22px; }
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity .3s ease-out;
    transform: scale(1);
}
.login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(.95);
}
.login-box {
    background: #fff;
    padding: 35px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,.3);
    width: 340px;
    max-width: 90%;
    text-align: center;
    transition: background-color .3s;
}
.dark-theme .login-box {
    background: #333;
    box-shadow: 0 5px 15px rgba(0,0,0,.6);
}
.login-box h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 1.6em;
}
.dark-theme .login-box h2 { color: #f1f1f1; }
.login-box .form-group { text-align: left; }
.login-box input[type=text], .login-box input[type=password] {
    margin-bottom: 15px;
    width: 100%;
}
.login-box button {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    margin-top: 10px;
    background-color: #f7931a;
    color: #fff;
}
.login-box button:hover { background-color: #e6891a; }
.dark-theme .login-box button {
    background-color: #f7931a;
    color: #fff;
}
.dark-theme .login-box button:hover { background-color: #e6891a; }
#loginError {
    margin-top: 15px;
    color: #f44336;
    font-weight: 700;
}
.dark-theme #loginError { color: #e57373; }
#choiceScreen { text-align: center; }
#choiceScreen p {
    margin-bottom: 25px;
    font-size: 1.1em;
    color: #555;
}
.dark-theme #choiceScreen p { color: #ccc; }
#choiceScreen button {
    padding: 15px 30px;
    font-size: 1.1em;
    min-width: 170px;
    margin: 0 10px 10px;
}
button[onclick="showChoiceScreen()"] {
    background-color: #6c757d;
    color: #fff;
    margin-top: 25px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 80%;
    max-width: 250px;
}
button[onclick="showChoiceScreen()"]:hover { background-color: #5a6268; }
.dark-theme button[onclick="showChoiceScreen()"] { background-color: #5a6268; }
.dark-theme button[onclick="showChoiceScreen()"]:hover { background-color: #4a5258; }
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}
.keyboard-toggle {
    position: fixed;
    top: 15px;
    left: 20px;
    z-index: 1001;
}
#keyboardToggleBtn {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2em;
    padding: 0;
    margin: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    border: 1px solid #ccc;
    background-color: #e0e0e0;
    color: #333;
}
.dark-theme #keyboardToggleBtn {
    background-color: #444;
    border-color: #666;
    color: #eee;
}
#keyboardToggleBtn.disabled {
    background-color: #f44336;
    color: #fff;
}
.dark-theme #keyboardToggleBtn.disabled { background-color: #b71c1c; }
.inspection-summary p {
    margin: 5px 0;
    font-size: 1.1em;
}
.inspection-summary strong {
    display: inline-block;
    min-width: 60px;
}
#inspectionCounts {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}
.dark-theme #inspectionCounts {
    background-color: #333;
    border-color: #555;
}
#inspectionCounts p {
    margin: 5px 0;
    font-size: 1em;
}
#inspectionCounts span {
    font-weight: bold;
    margin-left: 5px;
}
#incorrectCountSpan { color: #f44336; }
#missingCountSpan { color: #ff9800; }
.dark-theme #incorrectCountSpan { color: #e57373; }
.dark-theme #missingCountSpan { color: #ffb74d; }
#lastEntryActions button {
    font-size: 0.9em;
    padding: 6px 10px;
    margin-right: 8px;
    margin-bottom: 5px;
}
#logListModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 15px;
    box-sizing: border-box;
}
#logListModal.visible { display: flex; }
#logListContent {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    position: relative;
}
.dark-theme #logListContent { background: #333; }
#logListContent h2 { margin-top: 0; }
#logListItems {
    list-style: none;
    padding: 0;
    margin: 0;
}
#logListItems li {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.dark-theme #logListItems li { border-bottom-color: #555; }
#logListItems li:last-child { border-bottom: none; }
#logListItems .log-info {
    flex-grow: 1;
    margin-right: 10px;
}
#logListItems .log-actions button {
    font-size: 0.8em;
    padding: 4px 8px;
    margin-left: 5px;
    margin-bottom: 5px;
}
#logListItems strong {
    display: inline-block;
    min-width: 50px;
}
#logListItems .status-correct { color: green; }
#logListItems .status-incorrect { color: red; }
#logListItems .status-missing { color: orange; }
.dark-theme #logListItems .status-correct { color: #81c784; }
.dark-theme #logListItems .status-incorrect { color: #e57373; }
.dark-theme #logListItems .status-missing { color: #ffb74d; }
#closeLogListBtn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: #aaa;
    padding: 0;
    line-height: 1;
}
.dark-theme #closeLogListBtn { color: #777; }
#resumePromptOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2100;
}
#resumePromptOverlay.visible { display: flex; }
#resumePromptBox {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
}
.dark-theme #resumePromptBox { background: #333; }
#resumePromptBox p { margin-bottom: 25px; }
#resumePromptBox button { margin: 0 10px; }
.details-box {
    padding: 10px 15px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}
.dark-theme .details-box {
    border-color: #555;
    background-color: #333;
}
#rptDetailsList {
    padding-left: 20px;
    margin: 5px 0 0;
    list-style-type: disc;
}
.rpt-summary {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    background-color: #e9f5ff;
    border-left: 5px solid #2196F3;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dark-theme .rpt-summary {
    background-color: #2c3e50;
    border-left-color: #3498db;
}
.rpt-summary button {
    margin-left: 10px;
    padding: 4px 10px;
    font-size: 0.85em;
    background-color: #6c757d;
    flex-shrink: 0; 
}
/* --- KAMERA HEDEFLEME ÇERÇEVESİ STİLLERİ --- */

.camera-scanner {
    position: relative;
    overflow: hidden; /* Taşmaları engellemek için */
    padding: 0; /* İç boşlukları sıfırla */
    border: none; /* Mevcut çerçeveyi kaldır */
    background-color: #000; /* Video yüklenene kadar siyah arka plan */
    border-radius: 4px;
    aspect-ratio: 4 / 3;
    max-height: 400px;

}

.camera-scanner video {
    display: block; /* Alt boşluğu kaldırmak için */
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; 
}

.viewfinder {
    width: 85%; /* Genişliği biraz artırdım, daha iyi odaklanır */
    max-width: 400px;
    height: 100px; /* Barkodlar için ideal yükseklik */
    background: transparent;
    border: 2px solid orange; 
    border-radius: 8px; /* Köşeleri hafif yuvarla */
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.5); 
    position: relative;
}

.viewfinder::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 5%; /* Çizginin kenarlardan biraz içeride başlaması için */
    width: 90%;
    height: 2px; /* Çizgiyi biraz kalınlaştırdım */
    background-color: orange;
    box-shadow: 0 0 5px rgba(255, 165, 0, 0.7); /* Turuncu bir parlama efekti */
    border-radius: 2px;
    animation: laserPulse 2s infinite;
}

@keyframes laserPulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.camera-scanner p,
.camera-scanner button {
    position: relative; /* Normal akışta kalsınlar ama z-index alabilmeleri için */


    z-index: 5; 
}
