/* Advanced Order Management Mobile Styles */

/* Order ID Copy Button Styles for Advanced Orders */
.order-id-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.order-id-text {
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    flex-shrink: 0;
}

.copy-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    border-radius: 6px;
    padding: 0.375rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    flex-shrink: 0;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.copy-btn i {
    font-size: 0.875rem;
}

/* Specific styling for order ID display in advanced cards */
.order-id-display .order-id-section {
    align-items: center;
    gap: 0.75rem;
}

.mobile-orders-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem;
}

.advanced-order-card {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.advanced-order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.order-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-info-primary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-id-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.order-id-display i {
    font-size: 0.875rem;
    opacity: 0.8;
}

.order-number {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.order-status-mobile .status-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.order-amount-mobile {
    text-align: right;
    font-size: 1.5rem;
    font-weight: 700;
}

.order-amount-mobile .currency {
    font-size: 1rem;
    opacity: 0.8;
}

.order-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.customer-info-section {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.customer-avatar {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.customer-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.customer-name {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
}

.customer-email,
.customer-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

.customer-email i,
.customer-phone i {
    width: 14px;
    font-size: 0.75rem;
}

.order-meta-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #475569;
    font-size: 0.875rem;
}

.meta-item i {
    width: 16px;
    color: #64748b;
    font-size: 0.875rem;
}

.order-items-preview,
.gift-cards-preview {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.items-header,
.gift-cards-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.items-header i,
.gift-cards-header i {
    color: #667eea;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

.item-name {
    flex: 1;
    font-weight: 500;
    color: #334155;
}

.item-quantity {
    color: #64748b;
    margin: 0 0.5rem;
}

.item-price {
    font-weight: 600;
    color: #059669;
}

.items-more {
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
    font-style: italic;
    padding: 0.25rem;
}

.gift-cards-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gift-card-mini {
    background: white;
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 120px;
}

.card-code {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
}

.card-status {
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
}

.card-status.status-redeemed {
    background: #dcfce7;
    color: #166534;
}

.card-status.status-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.card-status.status-expired {
    background: #fee2e2;
    color: #dc2626;
}

.cards-more {
    background: #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 60px;
}

.order-card-actions {
    background: #f8fafc;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.action-btn i {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.view-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.view-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
}

.edit-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}

.more-btn {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.more-btn:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-1px);
}

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

/* Status badge colors */
.status-badge.status-completed {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.status-badge.status-pending {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.status-badge.status-failed {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

.status-badge.status-cancelled {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .order-meta-section {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .order-card-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-btn {
        flex-direction: row;
        justify-content: center;
        padding: 0.75rem;
    }
    
    .action-btn i {
        margin-bottom: 0;
        margin-right: 0.5rem;
    }
}

/* Animation for loading states */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading .advanced-order-card {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Loading, Empty, and Error States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    min-height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-left: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    color: #64748b;
    font-size: 1rem;
}

.empty-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    min-height: 200px;
}

.empty-icon, .error-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.error-icon {
    color: #ef4444;
}

.empty-title, .error-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.empty-description, .error-description {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.orders-display-container {
    margin-top: 1rem;
}

/* Desktop Orders Table */
.desktop-orders-table {
    margin-top: 1rem;
}

.table-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
}

.orders-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.orders-table tr:hover {
    background: #f8fafc;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-buttons .btn {
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

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

/* Enhanced desktop styles */
@media (min-width: 769px) {
    .mobile-orders-container {
        display: none;
    }
    
    .desktop-orders-table {
        display: block !important;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .desktop-orders-table {
        display: none !important;
    }
    
    .mobile-orders-container {
        display: flex;
    }
}