/* ========================================
   ORDER DETAIL MODAL — Premium Design
   ======================================== */

/* Modal entrance animation */
#order-detail-modal .modal-content {
    padding: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: od-slideUp 0.3s ease-out;
    max-width: 420px;
}

@keyframes od-slideUp {
    from {
        transform: translateY(24px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Gradient header */
#order-detail-modal .modal-header {
    padding: 1.15rem 1.5rem;
    margin-bottom: 0;
    border-bottom: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
}

#order-detail-modal .modal-header h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

#order-detail-modal .modal-header .close-modal {
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
}

#order-detail-modal .modal-header .close-modal:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Modal body */
#order-detail-modal .modal-body {
    padding: 1rem 1.25rem 0.75rem;
    overflow-y: auto;
    max-height: 65vh;
}

/* --- Section cards --- */
.detail-section {
    margin-bottom: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: box-shadow 0.2s;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    margin-bottom: 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-section h4::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* --- Address card --- */
.detail-address-box {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
}

.detail-address-text {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.45;
    word-break: break-word;
    color: var(--text-primary);
}

.detail-actions-row {
    display: flex;
    gap: 0.5rem;
}

.detail-actions-row .secondary-btn {
    flex: 1;
    text-align: center;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    font-weight: 500;
    gap: 0.3rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.detail-actions-row .secondary-btn i {
    font-size: 0.75rem;
}

.detail-actions-row .secondary-btn:first-child:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.detail-actions-row .secondary-btn:last-child {
    color: var(--success-color);
    border-color: var(--success-color);
}

.detail-actions-row .secondary-btn:last-child:hover {
    background: var(--success-color);
    color: #fff;
}

/* --- Key-value rows --- */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row:first-child {
    padding-top: 0;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 400;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.detail-value {
    text-align: right;
    font-size: 0.85rem;
    word-break: break-word;
    color: var(--text-primary);
}

.detail-value.font-medium {
    font-weight: 600;
}

/* --- Loading spinner --- */
.detail-loading {
    padding: 1.15rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.detail-loading i {
    margin-right: 0.4rem;
    color: var(--primary-color);
}

/* --- Footer (delete button) --- */
#order-detail-modal .modal-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
}

#order-detail-modal #od-delete-btn {
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s;
    padding: 0.6rem;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
}

#order-detail-modal #od-delete-btn:hover {
    background: var(--danger-color);
    color: #fff;
}

/* --- Label download button --- */
#od-label-btn {
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

#od-label-btn i {
    color: #dc2626;
    transition: color 0.2s;
}

#od-label-btn:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

#od-label-btn:hover i {
    color: #fff;
}

/* --- Edit category inline button --- */
#od-edit-category-btn {
    background: none;
    border: none;
    padding: 0.15rem 0.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.7rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

#od-edit-category-btn:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

/* --- Category picker chips (detail modal) --- */
.od-category-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0 0.25rem;
}

.cat-btn-edit {
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.cat-btn-edit:hover,
.cat-btn-edit:active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* --- Utility classes --- */
.text-danger {
    color: var(--danger-color) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    flex: 1;
}

.hidden {
    display: none !important;
}

/* --- Dark Mode Overrides --- */
body.dark-mode .detail-section {
    background-color: var(--surface-color);
    border-color: var(--border-color);
}

body.dark-mode .detail-address-box {
    background: transparent;
}

body.dark-mode .detail-row {
    border-bottom-color: var(--border-color);
}

body.dark-mode .detail-section h4 {
    border-bottom-color: var(--border-color);
}

/* --- Shopee Section Theme --- */
.shopee-section h4 {
    color: #f05a28;
}

.shopee-section h4::before {
    background: #f05a28;
}

/* --- Tracking Events Timeline --- */
.tracking-events {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tracking-event {
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.78rem;
}

.tracking-event:last-child {
    border-bottom: none;
}

.tracking-event-time {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
}

.tracking-event-desc {
    color: var(--text-primary);
    line-height: 1.35;
}