/**
 * Bin Pickup Control Styles
 * Professional mobile-first design for field operations
 */

/* Main Control Container */
.bin-pickup-control {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    pointer-events: auto;
}

.bin-pickup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, #f3f4f6 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .bin-pickup-overlay {
        background: linear-gradient(to bottom, #1f2937 0%, #111827 100%);
    }
}

/* Header */
.bin-pickup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-bottom: 2px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    .bin-pickup-header {
        background: #1f2937;
        border-bottom-color: #374151;
    }
}

.header-content {
    flex: 1;
    min-width: 0;
}

.stop-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stop-address {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (prefers-color-scheme: dark) {
    .stop-title {
        color: #f9fafb;
    }
    .stop-address {
        color: #9ca3af;
    }
}

.close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 1rem;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #e5e7eb;
    transform: scale(1.1);
}

.close-btn svg {
    width: 20px;
    height: 20px;
    color: #6b7280;
}

@media (prefers-color-scheme: dark) {
    .close-btn {
        background: #374151;
    }
    .close-btn:hover {
        background: #4b5563;
    }
    .close-btn svg {
        color: #9ca3af;
    }
}

/* Progress Bar */
.progress-bar-container {
    padding: 1rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

@media (prefers-color-scheme: dark) {
    .progress-bar-container {
        background: #1f2937;
        border-bottom-color: #374151;
    }
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transition: width 0.3s ease;
    border-radius: 999px;
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .progress-bar {
        background: #374151;
    }
    .progress-text {
        color: #d1d5db;
    }
}

/* Bin List */
.bin-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.no-bins {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
    font-size: 1rem;
}

/* Bin Item */
.bin-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.bin-item:active {
    transform: scale(0.98);
}

.bin-item.collected {
    background: #f0fdf4;
    border-color: #86efac;
}

.bin-item.pending {
    background: white;
}

.bin-item.syncing {
    opacity: 0.7;
    border-style: dashed;
}

@media (prefers-color-scheme: dark) {
    .bin-item {
        background: #1f2937;
        border-color: #374151;
    }
    .bin-item.collected {
        background: #064e3b;
        border-color: #047857;
    }
}

/* Bin Status Icon */
.bin-status-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.bin-item.collected .bin-status-icon {
    background: #10b981;
}

.bin-item.pending .bin-status-icon {
    background: #f3f4f6;
}

.check-icon, .pending-icon {
    width: 28px;
    height: 28px;
}

.bin-item.collected .check-icon {
    color: white;
}

.bin-item.pending .pending-icon {
    color: #9ca3af;
}

/* Bin Details */
.bin-details {
    flex: 1;
    min-width: 0;
}

.bin-code {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.bin-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.bin-type::after {
    content: "•";
    margin-left: 0.5rem;
    color: #d1d5db;
}

.bin-timestamp {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #059669;
    margin-top: 0.25rem;
}

.time-icon {
    width: 14px;
    height: 14px;
}

.sync-status {
    font-size: 0.75rem;
    color: #f59e0b;
    font-weight: 600;
    margin-top: 0.25rem;
}

@media (prefers-color-scheme: dark) {
    .bin-code {
        color: #f9fafb;
    }
    .bin-meta {
        color: #9ca3af;
    }
}

/* Bin Actions */
.bin-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 72px;
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn svg {
    width: 24px;
    height: 24px;
}

.action-btn span {
    font-size: 0.75rem;
    font-weight: 600;
}

.camera-btn {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}

.camera-btn:hover {
    background: #dbeafe;
}

.quick-collect-btn {
    border-color: #10b981;
    background: #f0fdf4;
    color: #047857;
}

.quick-collect-btn:hover {
    background: #dcfce7;
}

.view-proof-btn {
    border-color: #8b5cf6;
    background: #f5f3ff;
    color: #6d28d9;
}

.view-proof-btn:hover {
    background: #ede9fe;
}

@media (prefers-color-scheme: dark) {
    .action-btn {
        background: #374151;
        border-color: #4b5563;
    }
    .camera-btn {
        background: #1e3a8a;
        border-color: #3b82f6;
    }
    .quick-collect-btn {
        background: #064e3b;
        border-color: #10b981;
    }
    .view-proof-btn {
        background: #4c1d95;
        border-color: #8b5cf6;
    }
}

/* Footer */
.bin-pickup-footer {
    padding: 1rem;
    background: white;
    border-top: 2px solid #e5e7eb;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    .bin-pickup-footer {
        background: #1f2937;
        border-top-color: #374151;
    }
}

.complete-stop-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.complete-stop-btn.enabled {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.complete-stop-btn.enabled:active {
    transform: scale(0.98);
}

.complete-stop-btn.disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

@media (prefers-color-scheme: dark) {
    .complete-stop-btn.disabled {
        background: #374151;
        color: #6b7280;
    }
}

/* Camera Modal */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: black;
}

.camera-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
}

.camera-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.camera-modal video {
    flex: 1;
    width: 100%;
    object-fit: cover;
}

.camera-controls {
    padding: 2rem;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
}

.btn-capture {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid white;
    background: #3b82f6;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-capture:active {
    transform: scale(0.9);
}

.btn-capture svg {
    width: 32px;
    height: 32px;
}

/* Proof Modal */
.proof-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 15000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.proof-container {
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.proof-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.proof-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.proof-container img {
    width: 100%;
    display: block;
}

.proof-details {
    padding: 1rem;
    background: white;
}

@media (prefers-color-scheme: dark) {
    .proof-container {
        background: #1f2937;
    }
    .proof-header {
        background: #374151;
        border-bottom-color: #4b5563;
    }
    .proof-details {
        background: #1f2937;
        color: #f9fafb;
    }
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .bin-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        min-width: auto;
    }
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .bin-pickup-control {
        left: 50%;
        transform: translateX(-50%);
        max-width: 600px;
        top: 2rem;
        bottom: 2rem;
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }

    .bin-pickup-overlay {
        border-radius: 16px;
    }
}
