body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color, #f4f6f9);
    color: var(--text-color, #1f2937);
    margin: 0;
    padding-bottom: 80px; /* Space for bottom nav */
    transition: background-color 0.3s, color 0.3s;
}

:root {
    --bg-color: #f4f6f9;
    --text-color: #1f2937;
    --container-bg: white;
    --success-bg: #d1fae5;
    --error-bg: #fee2e2;
}

[data-theme="dark"] {
    --bg-color: #1f2937;
    --text-color: #f3f4f6;
    --container-bg: #374151;
    --success-bg: #064e3b;
    --error-bg: #7f1d1d;
}

.container {
    max-width: 80%;
    margin: 1rem auto;
    background: var(--container-bg, white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 1rem;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--container-bg, white);
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 64px;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.75rem;
    padding: 8px;
    transition: color 0.2s, transform 0.2s, background-color 0.2s;
}

.nav-item i {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.nav-item.active {
    color: #3b82f6;
    background-color: #dbeafe;
    border-radius: 8px;
    transform: scale(1.1);
}

.nav-item:active {
    transform: scale(1.15);
}

.nav-item .tooltip {
    position: absolute;
    bottom: 100%;
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-item:hover .tooltip {
    opacity: 1;
}

.video-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

#video, #video-item, #video-sku {
    display: block;
    width: 100%;
    max-height: 200px;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #3b82f6;
    animation: scan 1.5s infinite linear;
}

.scan-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px dashed #3b82f6;
    width: 80%;
    height: 80px;
    color: #3b82f6;
    text-align: center;
    line-height: 80px;
    font-size: 0.875rem;
    opacity: 0.7;
    animation: fadeInOut 3s infinite;
}

@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

@keyframes fadeInOut {
    0% { opacity: 0.7; }
    50% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

.item-verified {
    background-color: var(--success-bg, #d1fae5);
    border-left: 4px solid #10b981;
}

.item-missing {
    background-color: var(--error-bg, #fee2e2);
    border-left: 4px solid #ef4444;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-primary:active {
    transform: scale(1.05);
}

.btn-primary:disabled, .btn-primary.loading {
    background-color: #93c5fd;
    cursor: not-allowed;
}

.btn-primary.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

.btn-secondary {
    background-color: #ffb553;
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
    font-size: 1rem;
}

.btn-secondary:hover {
    background-color: #2781ff;
}

.btn-secondary:active {
    transform: scale(1.05);
}

.btn-secondary:disabled, .btn-secondary.loading {
    background-color: #d1d5db;
    cursor: not-allowed;
}

.btn-secondary.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 6px;
    animation: fadeIn 0.5s ease-in;
    font-size: 1rem;
    text-align: center;
}

.status-message.success {
    background-color: var(--success-bg, #d1fae5);
    color: #10b981;
}

.status-message.error {
    background-color: var(--error-bg, #fee2e2);
    color: #ef4444;
}

.search-input {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    border-radius: 6px;
    width: 100%;
    outline: none;
    transition: border-color 0.3s;
    font-size: 1rem;
}

.search-input:focus {
    border-color: #3b82f6;
}

.search-input.error {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.accordion-header {
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
}

.accordion-header:hover {
    background-color: #f9fafb;
}

.accordion-header:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.accordion-header i {
    font-size: 1.25rem;
}

.accordion-content {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.accordion-item {
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.accordion-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.variation-item {
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    transition: background-color 0.3s;
}

.variation-item:hover {
    background-color: #f9fafb;
}

.alert {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 1rem;
    text-align: center;
    position: relative;
}

.alert.error {
    background-color: var(--error-bg, #fee2e2);
    color: #ef4444;
}

.alert.success {
    background-color: var(--success-bg, #d1fae5);
    color: #10b981;
}

.alert .close-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    font-size: 0.875rem;
    cursor: pointer;
}

.product-image, .item-image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
}

.verify-checkbox {
    appearance: none;
    width: 32px;
    height: 32px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.verify-checkbox:checked {
    background-color: #10b981;
    border-color: #10b981;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
}

.verify-checkbox:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.quantity-counter {
    font-size: 0.875rem;
    color: #4b5563;
}

.order-header {
    border: 1px solid #e5e7eb;
    padding: 1rem;
    border-radius: 8px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--container-bg, #dbeafe);
}

#image-modal, #share-modal, #verify-modal {
    padding: 1rem;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--container-bg, white);
    padding: 1.5rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-content .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Toast Styles */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 6px;
    z-index: 2000;
    animation: slideIn 0.5s ease-in-out, slideOut 0.5s ease-in-out 2.5s forwards;
}

.toast.success {
    background-color: var(--success-bg, #d1fae5);
    color: #10b981;
}

.toast.error {
    background-color: var(--error-bg, #fee2e2);
    color: #ef4444;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Progress Indicator */
.item-progress {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #10b981;
}

.item-progress.completed::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #10b981;
}

/* Empty/Error States */
.empty-state, .error-state {
    text-align: center;
    padding: 2rem;
    background: var(--container-bg, white);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin: 1rem 0;
}

.empty-state i, .error-state i {
    font-size: 2rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.retry-btn {
    background-color: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    display: inline-block;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--container-bg, white);
    border-radius: 8px;
}

.step {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    transition: color 0.3s, background-color 0.3s;
}

.step.active {
    color: #3b82f6;
    background-color: #dbeafe;
    border-radius: 6px;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    z-index: 2000;
    display: none;
}

/* Mobile Styles */
@media (max-width: 576px) {
    body {
        font-size: 0.875rem;
    }

    .container {
        margin: 0.5rem;
        padding: 0.75rem;
        border-radius: 8px;
    }

    h2 {
        font-size: 1rem;
    }

    .video-container {
        max-height: 180px;
    }

    .scan-guide {
        width: 90%;
        height: 80px;
        line-height: 80px;
        font-size: 0.75rem;
    }

    .btn-primary, .btn-secondary {
        padding: 1rem;
        font-size: 1.125rem;
    }

    .modal-content .btn-primary, .modal-content .btn-secondary {
        position: sticky;
        bottom: 0;
        margin-top: 1rem;
    }

    .search-input {
        padding: 0.75rem;
        font-size: 1rem;
        height: 48px;
    }

    .accordion-header {
        padding: 0.75rem;
        min-height: 64px;
        font-size: 0.875rem;
    }

    .accordion-content {
        padding: 0.5rem;
    }

    .product-image, .item-image {
        width: 48px;
        height: 48px;
    }

    .order-header {
        padding: 0.75rem;
    }

    #image-modal, #share-modal, #verify-modal {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0.5rem;
        border-radius: 0;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        padding: 1rem;
    }

    #modal-image {
        max-height: 70vh;
    }

    .bottom-nav {
        height: 60px;
    }

    .nav-item i {
        font-size: 1.25rem;
    }

    .nav-item span {
        font-size: 0.7rem;
    }

    .verify-checkbox {
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    body {
        font-size: 1rem;
    }

    .container {
        margin: 1rem;
        padding: 1rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .btn-primary, .btn-secondary {
        width: auto;
        padding: 0.5rem 1rem;
    }

    .search-input {
        height: 40px;
    }

    .flex-col {
        flex-direction: row;
    }
}

