/* Scanner Modal Styles */
.scanner-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.scanner-modal.show {
    display: block;
}

.scanner-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.scanner-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
}

.close-scanner {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b6b6b;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-scanner:hover {
    background-color: #f5f5f5;
}

#scanner-container {
    position: relative;
    background-color: #000;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scanner {
    width: 100%;
    height: 300px;
}

#scanner video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#scanner canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.scanner-status {
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.scanner-status p {
    margin: 0;
    color: #6b6b6b;
    font-size: 14px;
}

/* Add Product Modal Styles */
.add-product-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.add-product-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.add-product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.add-product-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.close-add-product {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-add-product:hover {
    color: #374151;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    padding: 20px 24px;
    background: #f9fafb;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 60%;
    right: -40%;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.step.completed:not(:last-child)::after {
    background: #10b981;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.step.active .step-number {
    background: #3b82f6;
    color: white;
}

.step.completed .step-number {
    background: #10b981;
    color: white;
}

.step span {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.step.active span {
    color: #3b82f6;
    font-weight: 500;
}

.add-product-step {
    padding: 24px;
    text-align: center;
}

.step-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.add-product-step h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.add-product-step p {
    margin: 0 0 24px 0;
    color: #6b7280;
    line-height: 1.5;
}

.camera-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.camera-container video,
.camera-container canvas {
    width: 100%;
    height: auto;
    display: block;
}

.camera-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.camera-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-size: 16px;
}

.camera-button:hover {
    background: #2563eb;
}

.camera-button.retake {
    background: #f59e0b;
}

.camera-button.retake:hover {
    background: #d97706;
}

.step-navigation {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.nav-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

.nav-button:hover {
    background: #2563eb;
}

.nav-button.back {
    background: #6b7280;
}

.nav-button.back:hover {
    background: #374151;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-left: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-status {
    text-align: left;
    max-width: 300px;
    margin: 0 auto;
}

.status-item {
    padding: 8px 0;
    font-size: 14px;
}

@media (max-width: 600px) {
    .add-product-content {
        width: 95%;
        margin: 5% auto;
        max-height: 85vh;
    }

    .progress-steps {
        padding: 16px 20px;
    }

    .add-product-step {
        padding: 20px;
    }
}