/* Pickup Page Specific Styles - Only custom additions */

/* Table layout and styling come from orders.css (.table-container, .orders-table) */

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

.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* Green process button hover effect */
#processPickupBtn:hover {
    background: #059669 !important;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3) !important;
    transform: translateY(-1px);
}

#processPickupBtn:active {
    transform: translateY(0);
}

#processPickupBtn:disabled {
    background: #9ca3af !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* Clinic Filter Row */
.clinic-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
}

.filter-label svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.filter-select {
    flex: 1;
    max-width: 400px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:hover {
    border-color: var(--primary-color);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* Checkbox */
.checkbox-cell {
    width: 50px;
    text-align: center;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Order ID Badge */
.order-id-badge {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

/* Phase Name */
.phase-name {
    font-weight: 600;
    color: #8b5cf6;
    background: #f3f0ff;
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 0.875rem;
    display: inline-block;
}

/* Patient Info */
.patient-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.patient-name {
    font-weight: 600;
    color: var(--text-primary);
}

.patient-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Products List */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-item {
    font-size: 0.7rem;
    color: var(--text-primary);
    padding: 2px 0;
}

.product-more {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.text-muted {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.875rem;
}

/* Date Display */
.date-display {
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: var(--success);
    color: white;
}

.btn-icon:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Selected row highlight */
.orders-table tr.selected {
    background: #e8f4fd !important;
}

/* Empty State - needs own styling since it replaces table */
.empty-state {
    display: block;
    width: 100%;
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2px;
    box-sizing: border-box;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    stroke: var(--border);
}

.empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Loading Spinner Container - needs own styling since it replaces table */
#ordersTableContainer .loading-spinner {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 60px 20px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 2px !important;
    box-sizing: border-box !important;
    transform: none !important;
    writing-mode: horizontal-tb !important;
}

#ordersTableContainer .loading-spinner .spinner {
    width: 32px !important;
    height: 32px !important;
    border: 3px solid var(--border) !important;
    border-top: 3px solid var(--primary-color) !important;
    border-left: 3px solid transparent !important;
    border-right: 3px solid transparent !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 50% !important;
    animation: pickupSpinAnimation 1s linear infinite !important;
    margin: 0 auto 20px !important;
    display: block !important;
    transform: none !important;
}

#ordersTableContainer .loading-spinner p {
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
    transform: none !important;
    writing-mode: horizontal-tb !important;
    display: block !important;
    text-align: center !important;
}

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal .modal-content {
    background: var(--surface);
    border-radius: 2px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal .modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 2px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.modal .modal-close:hover {
    background: var(--background);
    color: var(--text-primary);
}

.modal .modal-close svg {
    width: 20px;
    height: 20px;
}

.modal .modal-body {
    padding: 20px;
}

.modal-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 0 20px 0;
}

.modal .modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 2px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--background);
}

.upload-area:hover {
    border-color: #3498db;
    background: #e8f4fd;
}

.upload-area.dragover {
    border-color: #3498db;
    background: #e8f4fd;
}

.upload-area svg {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.upload-area p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Preview Container */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--shadow);
}

.preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.preview-remove:hover {
    background: var(--error);
}

.preview-remove svg {
    width: 14px;
    height: 14px;
}

/* Button Spinner */
.btn-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-spinner .spinner {
    width: 16px;
    height: 16px;
    margin: 0;
    border-width: 2px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
}

/* Custom Modal for Alerts and Confirmations */
.custom-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.custom-modal-overlay.active {
    display: flex;
}

.custom-modal {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

.custom-modal-header {
    background: var(--primary-color);
    color: white;
    padding: 20px 25px;
    border-bottom: none;
}

.custom-modal-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.custom-modal-body {
    padding: 30px 25px;
}

.custom-modal-message {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-line;
}

.custom-modal-footer {
    padding: 20px 25px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--background);
    border-top: 1px solid var(--border);
}

.custom-modal-footer .btn-primary,
.custom-modal-footer .btn-secondary {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-modal-footer .btn-primary {
    background: var(--primary-color);
    color: white;
}

.custom-modal-footer .btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.custom-modal-footer .btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.custom-modal-footer .btn-secondary:hover {
    background: #e8e8e8;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Process Pickup Fixed Button */
.process-pickup-section {
    position: fixed;
    bottom: 0;
    left: 280px;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--border);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.btn-process-pickup {
    background: var(--success);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    width: 100%;
    max-width: 100%;
}

.btn-process-pickup svg {
    width: 20px;
    height: 20px;
}

.btn-process-pickup:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.btn-process-pickup:active {
    transform: translateY(0);
}

.btn-process-pickup:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.selected-count {
    background: white;
    color: var(--success);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .clinic-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        max-width: 100%;
    }
    
    .process-pickup-section {
        left: 80px;
        padding: 12px 16px;
    }
    
    .btn-process-pickup {
        padding: 12px 24px;
        font-size: 0.95rem;
        width: 100%;
        max-width: 100%;
    }
    
    .modal .modal-content {
        width: 95%;
        margin: 20px;
    }

    .preview-container {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

@media (max-width: 480px) {
    .process-pickup-section {
        left: 0;
        padding: 10px 12px;
    }
    
    .btn-process-pickup {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
        max-width: 100%;
        gap: 8px;
    }
    
    .selected-count {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
}
