/* QR Scanner Pro Styles */
:root {
    --light-grey: #f4f6f9;
    --neon-blue: #4d9eff;
    --black: #000000;
    --white: #ffffff;
    --border-radius: 8px;
    --transition: 0.2s ease;
}

body {
    background: var(--light-grey);
}

.qr-scanner-app {
    max-width: 800px;
    margin: 20px auto;
    background: var(--light-grey);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--black);
}

/* Header */
.scanner-header {
    background: var(--neon-blue);
    color: var(--black);
    padding: 20px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Tabs */
.scanner-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    background: #fff;
}
.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--black);
}
.tab-btn i {
    margin-right: 8px;
}
.tab-btn.active {
    background: var(--neon-blue);
    color: var(--black);
    border-bottom: 2px solid var(--neon-blue);
}
.tab-btn:not(.active):hover {
    background: #e9ecef;
}

/* Panels */
.scanner-panel {
    display: none;
    padding: 20px;
}
.scanner-panel.active {
    display: block;
}

/* Camera container */
#camera-container {
    width: 100%;
    min-height: 300px;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}
#camera-container video {
    width: 100%;
    height: auto;
    object-fit: cover;
}
.camera-selector {
    margin-bottom: 15px;
    text-align: center;
}
.camera-selector label {
    margin-right: 10px;
    font-weight: bold;
}
.camera-selector select {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* Drop zone */
.drop-zone {
    border: 2px dashed #aaa;
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
}
.drop-zone.drag-over {
    border-color: var(--neon-blue);
    background: #eef5ff;
}
.drop-zone i {
    font-size: 48px;
    color: #888;
    margin-bottom: 10px;
}
.file-label {
    color: var(--neon-blue);
    text-decoration: underline;
    cursor: pointer;
}

/* Error messages */
.error-message {
    color: #d32f2f;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* Result area */
.result-area {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.result-area h3 {
    margin-top: 0;
    font-size: 18px;
}
.scanned-data {
    background: #f8f9fa;
    padding: 12px;
    border-radius: var(--border-radius);
    font-family: monospace;
    word-break: break-all;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    min-height: 60px;
}
.btn, .btn-small {
    background: var(--neon-blue);
    color: var(--black);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}
.btn {
    padding: 10px 20px;
    font-size: 16px;
}
.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}
.btn:hover, .btn-small:hover {
    background: #3a8ae0;
    transform: translateY(-1px);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* History area */
.history-area {
    padding: 20px;
}
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.history-header h3 {
    margin: 0;
    font-size: 18px;
}
.history-actions {
    display: flex;
    gap: 10px;
}
.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}
.history-item {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}
.history-data {
    flex: 1;
    font-family: monospace;
    word-break: break-all;
    margin-right: 10px;
}
.history-meta {
    font-size: 12px;
    color: #666;
    margin: 5px 0;
    width: 100%;
}
.history-time, .history-type {
    display: inline-block;
    margin-right: 12px;
}
.history-actions {
    display: flex;
    gap: 8px;
}
.history-actions button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    color: #555;
}
.history-actions button:hover {
    color: var(--neon-blue);
}
.empty-history {
    text-align: center;
    color: #888;
    padding: 20px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .scanner-header {
        font-size: 20px;
        padding: 15px;
    }
    .tab-btn {
        font-size: 14px;
        padding: 10px;
    }
    .drop-zone {
        padding: 20px;
    }
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .history-actions {
        margin-top: 8px;
        align-self: flex-end;
    }
}