/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    color: #00ff88;
    font-family: 'Courier New', monospace;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    user-select: none;
    -webkit-user-select: none;
}

.container {
    max-width: 480px;
    width: 100%;
    background: #141414;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #1a1a1a;
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.03);
    min-height: 90vh;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #1a1a1a;
}

.header h1 {
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 2px;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

.header .badge {
    background: #1a1a1a;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    color: #666;
    border: 1px solid #2a2a2a;
}

.header-scan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1a1a1a;
}

.header-scan span {
    font-size: 18px;
    color: #00ff88;
    font-weight: 300;
    letter-spacing: 1px;
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    padding: 12px 14px;
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.05);
}

.form-group input::placeholder {
    color: #333;
}

/* ===== DROP ZONE ===== */
.drop-zone {
    border: 2px dashed #1a1a1a;
    padding: 30px 20px;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: #0a0a0a;
    margin-bottom: 16px;
}

.drop-zone:hover {
    border-color: #00ff88;
    background: #0f0f0f;
}

.drop-zone .icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.drop-zone p {
    color: #666;
    font-size: 14px;
}

.drop-zone .highlight {
    color: #00ff88;
}

/* ===== FILE INFO ===== */
.file-info {
    background: #0a0a0a;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #1a1a1a;
    margin-bottom: 16px;
    font-size: 13px;
    color: #888;
    line-height: 1.5;
}

.file-info .highlight {
    color: #00ff88;
}

/* ===== BUTTONS ===== */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    letter-spacing: 0.5px;
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-primary {
    background: #00ff88;
    color: #0a0a0a;
}

.btn-primary:hover:not(:disabled) {
    background: #00cc66;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.15);
}

.btn-secondary {
    background: #1a1a1a;
    color: #00ff88;
    border: 1px solid #2a2a2a;
}

.btn-secondary:hover:not(:disabled) {
    background: #2a2a2a;
    border-color: #00ff88;
}

.btn-success {
    background: #1a5e20;
    color: #69f0ae;
    border: 1px solid #2a7a30;
}

.btn-success:hover {
    background: #2a7a30;
}

.btn-back {
    background: none;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    padding: 4px 8px;
}

.btn-back:hover {
    color: #00ff88;
}

.btn-refresh {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
}

.btn-refresh:hover {
    color: #00ff88;
}

.btn-camera {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 12px 16px;
    color: #00ff88;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-camera:hover {
    background: #2a2a2a;
    border-color: #00ff88;
}

.btn-close-camera {
    background: #ff4444;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-close-camera:hover {
    background: #cc3333;
}

/* ===== SCAN PAGE ===== */
.scan-container {
    padding: 16px;
}

.tt-info {
    background: #0a0a0a;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #1a1a1a;
    margin-bottom: 16px;
}

.tt-name {
    font-size: 18px;
    font-weight: bold;
    color: #00ff88;
    margin-bottom: 8px;
    word-break: break-word;
}

.tt-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.tt-progress span {
    color: #888;
    font-size: 14px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
    margin: 0 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #00ff88;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.tt-status {
    margin-top: 8px;
    font-size: 14px;
    color: #ffd740;
}

.tt-status.success {
    color: #69f0ae;
}

.tt-status.error {
    color: #ff5252;
}

/* ===== PALLET LIST ===== */
.pallet-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
    background: #0a0a0a;
    border-radius: 8px;
    border: 1px solid #1a1a1a;
}

.pallet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid #0f0f0f;
    font-size: 13px;
    transition: background 0.2s;
}

.pallet-item:last-child {
    border-bottom: none;
}

.pallet-item .number {
    color: #00ccff;
    font-family: 'Courier New', monospace;
}

.pallet-item .status {
    font-size: 16px;
}

.pallet-item.scanned {
    background: #0f2a0f;
}

.pallet-item.scanned .number {
    color: #69f0ae;
}

.pallet-item.pending {
    background: #1a0f2a;
}

.pallet-item.pending .number {
    color: #ffd740;
}

/* ===== SCAN INPUT ===== */
.scan-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.scan-input-group input {
    flex: 1;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    padding: 12px 14px;
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.scan-input-group input:focus {
    border-color: #00ff88;
}

.scan-input-group input::placeholder {
    color: #333;
}

/* ===== CAMERA ===== */
.camera-container {
    margin-top: 10px;
    background: #0a0a0a;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #1a1a1a;
    overflow: hidden;
}

.camera-container #reader {
    width: 100%;
}

.camera-container #reader video {
    width: 100%;
    border-radius: 8px;
}

/* ===== LOGS ===== */
.log-list {
    margin-top: 12px;
}

.log-item {
    background: #0a0a0a;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
}

.log-item:hover {
    border-color: #2a2a2a;
}

.log-item .name {
    color: #00ff88;
    font-size: 14px;
    font-weight: bold;
}

.log-item .meta {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

.log-item .badge {
    display: inline-block;
    background: #1a1a1a;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #333;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}

/* ===== MODAL / DIALOG ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: #141414;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    border: 1px solid #2a2a2a;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

.modal h3 {
    color: #00ff88;
    font-size: 18px;
    margin-bottom: 12px;
    font-weight: 300;
}

.modal p {
    color: #888;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.modal .highlight {
    color: #00ff88;
}

.modal .btn-group {
    display: flex;
    gap: 10px;
}

.modal .btn-group .btn {
    flex: 1;
}

/* ===== SCROLLBAR ===== */
.pallet-list::-webkit-scrollbar {
    width: 3px;
}

.pallet-list::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.pallet-list::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 2px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .container {
        padding: 14px;
        border-radius: 12px;
    }
    
    .header h1 {
        font-size: 17px;
    }
    
    .btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .tt-name {
        font-size: 16px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 420px;
        min-height: 80vh;
    }
}