/**
 * Orders Page Styles - ใช้ Bootstrap เป็นหลัก
 */

/* ========== STATISTICS CARDS ========== */
.stat-card {
    transition: transform 0.2s ease-in-out;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Gradient backgrounds removed for consistent card styling across all admin pages */

/* ========== TABLE STYLES ========== */
.table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

/* ========== STATUS BADGES ========== */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-draft {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.status-pending_payment {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-paid {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-processing {
    background-color: #cce5ff;
    color: #004085;
    border: 1px solid #99d6ff;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========== PAYMENT TYPE BADGES ========== */
.payment-type {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.payment-cash {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.payment-transfer {
    background-color: #e3f2fd;
    color: #1565c0;
}

.payment-credit {
    background-color: #fff3e0;
    color: #ef6c00;
}

/* ========== ORDER TYPE BADGES ========== */
.order-type {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.order-new {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.order-renew {
    background-color: #e8f5e8;
    color: #388e3c;
}

.order-change {
    background-color: #fff3e0;
    color: #f57c00;
}

/* ========== AMOUNT STYLING ========== */
.amount-display {
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.amount-large {
    color: #d32f2f;
}

.amount-medium {
    color: #f57c00;
}

.amount-small {
    color: #388e3c;
}

/* ========== ACTION BUTTONS ========== */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

/* ========== CUSTOMER INFO ========== */
.customer-name {
    font-weight: 600;
    color: #1976d2;
}

.customer-code {
    color: #6c757d;
    font-size: 0.75rem;
}

.customer-type {
    font-size: 0.75rem;
    color: #6c757d;
}

/* ========== PAGINATION ========== */
.pagination-info {
    font-size: 0.875rem;
    color: #6c757d;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .customer-name {
        font-size: 0.875rem;
    }
}

/* ========== LOADING STATES ========== */
.loading-row {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* ========== ORDER DETAILS MODAL ========== */
.order-detail-section {
    margin-bottom: 1.5rem;
}

.order-detail-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.order-detail-value {
    color: #212529;
}

.order-timeline {
    position: relative;
    padding-left: 2rem;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: #6c757d;
}

.timeline-item.current::before {
    background-color: #007bff;
}

.timeline-item.completed::before {
    background-color: #28a745;
}

/* ========== FILTERS SECTION ========== */
.filter-section {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.filter-row {
    margin-bottom: 0.75rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

/* ========== DARK MODE SUPPORT ========== */
@media (prefers-color-scheme: dark) {
    .stat-card {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    .status-badge {
        filter: brightness(0.9);
    }
}
