/* ===================================
   Order Details Page
   =================================== */

.order-details-wrapper {
    padding: 2rem 0;
    min-height: calc(100vh - 132px);
}

.order-details-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.order-details-header {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--primary-color);
}

.order-header-left h1 {
    color: var(--white);
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
}

.order-header-left p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-size: 1rem;
}

.order-status-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.status-badge {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge.pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.status-badge.approved {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.status-badge.processing {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.status-badge.shipped {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.status-badge.cancelled {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.order-details-body {
    padding: 2.5rem 2rem;
}

/* Order Information Grid */
.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.info-card {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    transition: var(--transition);
}

.info-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-200);
}

.info-card-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.25rem;
}

.info-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.95rem;
}

.info-value {
    color: var(--gray-900);
    font-weight: 700;
    font-size: 0.95rem;
    text-align: right;
}

.info-value.highlight {
    color: var(--primary-color);
    font-size: 1.125rem;
}

.info-value.success {
    color: var(--accent-color);
}

.info-value.danger {
    color: var(--danger-color);
}

/* Order Items Table */
.order-items-section {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.order-items-header {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--gray-200);
}

.order-items-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.order-items-header h3 i {
    color: var(--primary-color);
}

.order-items-table {
    width: 100%;
    border-collapse: collapse;
}

.order-items-table thead {
    background: var(--gray-800);
}

.order-items-table thead th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    color: var(--white);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-items-table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
}

.order-items-table tbody tr:hover {
    background: var(--primary-light);
}

.order-items-table tbody td {
    padding: 1.25rem 1.5rem;
    vertical-align: middle;
}

.product-info {
    align-items: center;
    gap: 1rem;
}

.product-image {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: var(--border-radius);
    background: var(--gray-50);
    padding: 0.5rem;
    border: 2px solid var(--gray-200);
}

.product-details h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.product-details p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.quantity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    min-width: 50px;
}

.price-cell {
    font-weight: 700;
    color: var(--gray-800);
    font-size: 1rem;
}

.total-cell {
    font-weight: 800;
    color: var(--accent-color);
    font-size: 1.125rem;
}

.order-items-table tfoot {
    background: var(--gray-50);
    border-top: 3px solid var(--primary-color);
}

.order-items-table tfoot td {
    padding: 1.5rem;
    font-weight: 800;
    font-size: 1.5rem;
}

.order-items-table tfoot .label {
    color: var(--gray-800);
    text-align: right;
}

.order-items-table tfoot .value {
    color: var(--accent-color);
    text-align: right;
}

/* Order Actions */
.order-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 2rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-lg);
}

.action-btn {
    flex: 1;
    min-width: 200px;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-decoration: none;
}

.action-btn i {
    font-size: 1.25rem;
}

.action-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.action-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.action-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.action-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.action-btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.action-btn-info:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.action-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.action-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.action-btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.action-btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

/* Edit Form */
.edit-form-section {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.edit-form-section h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.75rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Timeline Section */
.order-timeline {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.order-timeline h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.order-timeline h3 i {
    color: var(--primary-color);
}

.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-300);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: -2.85rem;
    top: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: 50%;
    border: 3px solid var(--white);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    font-size: 1rem;
    z-index: 1;
}

.timeline-icon.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.timeline-icon.pending {
    background: var(--gray-300);
    color: var(--gray-600);
}

.timeline-content {
    background: var(--gray-50);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.timeline-title {
    font-size: 1.063rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.5rem 0;
}

.timeline-date {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0 0 0.5rem 0;
}

.timeline-description {
    font-size: 0.95rem;
    color: var(--gray-700);
    margin: 0;
}

/* Payment Info Box */
.payment-info-box {
    background: linear-gradient(135deg, #ede9fe 0%, #e9d5ff 100%);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    margin-bottom: 2rem;
}

.payment-info-box h4 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.payment-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.payment-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.payment-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 600;
}

.payment-value {
    font-size: 1.063rem;
    color: var(--gray-900);
    font-weight: 700;
}

/* Back Button */
.back-to-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    margin-bottom: 2rem;
}

.back-to-list-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateX(-5px);
}

/* Alert Boxes */
.alert-box {
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid;
}

.alert-box i {
    font-size: 1.5rem;
}

.alert-box.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #1e40af;
}

.alert-box.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #b45309;
}

.alert-box.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #065f46;
}

/* Responsive Design */
@media (max-width: 992px) {
    .order-details-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
    }

    .order-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .order-details-wrapper {
        padding: 1rem 0;
    }

    .order-details-header {
        padding: 1.5rem;
    }

    .order-header-left h1 {
        font-size: 1.5rem;
    }

    .order-details-body {
        padding: 1.5rem 1rem;
    }

    .order-items-table {
        font-size: 0.875rem;
    }

    .order-items-table thead th,
    .order-items-table tbody td {
        padding: 1rem 0.75rem;
    }

    .product-image {
        width: 60px;
        height: 60px;
    }

    .info-card {
        padding: 1.25rem;
    }
}

@media (max-width: 576px) {
    .status-badge {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .order-items-header h3 {
        font-size: 1.25rem;
    }

    /* Make table scrollable on very small screens */
    .order-items-section {
        overflow-x: auto;
    }

    .order-items-table {
        min-width: 600px;
    }
}

