/* Mobile Delivery Interface Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Funnel Sans', sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.delivery-container {
    min-height: 100vh;
    padding: 0;
    max-width: 100%;
    margin: 0;
    background: #f5f5f5;
}

/* Header */
.delivery-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.delivery-header h1 {
    font-family: 'Funnel Display', sans-serif;
    font-size: 1.5rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.delivery-header h1 i {
    color: #f39c12;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.btn-icon {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-icon:active {
    transform: scale(0.95);
    background: #2980b9;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.auto-refresh-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.auto-refresh-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Orders Container */
.orders-container {
    padding: 15px;
    padding-bottom: 80px; /* Space for bottom navigation if needed */
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.delivery-order-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #e67e22;
}

.delivery-order-card:active {
    transform: scale(0.98);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #ecf0f1;
}

.order-number {
    font-family: 'Funnel Display', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
}

.order-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #7f8c8d;
    font-size: 0.95rem;
    font-weight: 600;
}

.order-time i {
    color: #95a5a6;
}

.order-customer-name {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.order-customer-name i {
    color: #3498db;
    font-size: 1.2rem;
}

.order-customer-name strong {
    color: #2c3e50;
    font-weight: 700;
}

/* Delivery Address */
.delivery-address {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.address-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #e67e22;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.address-details {
    flex: 1;
    min-width: 0;
}

.address-street {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 4px;
    word-break: break-word;
}

.address-city {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.address-action {
    flex-shrink: 0;
}

.btn-maps {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #4285f4;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(66, 133, 244, 0.3);
}

.btn-maps:active {
    transform: scale(0.95);
    background: #357ae8;
}

.btn-maps i {
    font-size: 1.1rem;
}

.order-items-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding-left: 4px;
}

.order-items-info i {
    color: #95a5a6;
}

.order-action {
    margin-top: 10px;
}

.btn-delivered {
    width: 100%;
    padding: 16px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: 'Funnel Sans', sans-serif;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-delivered:active {
    transform: scale(0.98);
    background: #229954;
}

.btn-delivered:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.delivery-status-badge.delivery-status-completed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-delivered i {
    font-size: 1.2rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.empty-state i {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-state h2 {
    font-family: 'Funnel Display', sans-serif;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.empty-state p {
    color: #7f8c8d;
    font-size: 1rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

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

/* Success Animation */
.order-delivered {
    animation: slideOut 0.5s ease-out forwards;
}

@keyframes slideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-100%);
        max-height: 0;
        margin: 0;
        padding: 0;
    }
}

/* PIN Code Modal */
.pin-code-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.pin-code-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.pin-code-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.pin-code-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.pin-code-modal-header i {
    font-size: 3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    display: block;
}

.pin-code-modal-header h2 {
    font-family: 'Funnel Display', sans-serif;
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 0;
}

.pin-code-modal-body {
    text-align: center;
}

.pin-code-modal-body p {
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 1rem;
}

.pin-code-input-group {
    margin-bottom: 20px;
}

.pin-code-input {
    width: 100%;
    padding: 18px;
    font-size: 2rem;
    text-align: center;
    border: 3px solid #ecf0f1;
    border-radius: 12px;
    font-family: 'Funnel Display', sans-serif;
    font-weight: 700;
    letter-spacing: 8px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #2c3e50;
}

.pin-code-input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.pin-code-error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding: 10px;
    background: #fee;
    border-radius: 8px;
    border: 1px solid #fcc;
}

.pin-code-submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: 'Funnel Sans', sans-serif;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.pin-code-submit-btn:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
}

.pin-code-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pin-code-submit-btn i {
    font-size: 1.2rem;
}

/* Confirmation Modal */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.confirmation-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.confirmation-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1;
    overflow: hidden;
}

.confirmation-modal-header {
    text-align: center;
    padding: 25px 25px 15px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.confirmation-modal-header i {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
    opacity: 0.9;
}

.confirmation-modal-header h2 {
    font-family: 'Funnel Display', sans-serif;
    font-size: 1.5rem;
    margin: 0;
    color: white;
}

.confirmation-modal-body {
    padding: 25px;
    text-align: center;
}

.confirmation-modal-body p {
    color: #2c3e50;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

.confirmation-modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #ecf0f1;
    background: #f8f9fa;
}

.confirmation-btn-cancel,
.confirmation-btn-confirm {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: 'Funnel Sans', sans-serif;
}

.confirmation-btn-cancel {
    background: #95a5a6;
    color: white;
}

.confirmation-btn-cancel:active {
    transform: scale(0.98);
    background: #7f8c8d;
}

.confirmation-btn-confirm {
    background: #27ae60;
    color: white;
}

.confirmation-btn-confirm:active {
    transform: scale(0.98);
    background: #229954;
}

/* Responsive adjustments for very small screens */
@media (max-width: 360px) {
    .delivery-header h1 {
        font-size: 1.3rem;
    }
    
    .order-number {
        font-size: 1.5rem;
    }
    
    .address-street {
        font-size: 0.95rem;
    }
    
    .pin-code-modal-content {
        padding: 20px;
    }
    
    .pin-code-input {
        font-size: 1.5rem;
        padding: 15px;
    }
}

/* Connect page (slug+pin gateway) */
.delivery-connect-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}
.delivery-connect-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
}
.delivery-connect-card h1 {
    font-family: 'Funnel Display', sans-serif;
    font-size: 1.75rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.delivery-connect-card h1 i { color: #f39c12; }
.delivery-connect-description {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.delivery-connect-error {
    color: #c0392b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.delivery-connect-form { margin-top: 1rem; }
.delivery-connect-field {
    margin-bottom: 1rem;
}
.delivery-connect-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #333;
}
.delivery-connect-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}
.delivery-connect-submit {
    width: 100%;
    padding: 12px;
    background: #f39c12;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0.5rem;
}
.delivery-connect-submit:hover { background: #e67e22; }
