/* =========================================================================
   Padra Order Tracker - front-end styles
   Three selectable skins (Modern / Luxury / Vibrant) share one component
   structure and differ only through the CSS custom properties defined in
   each `.skin-*` block below. Pick a skin from Settings -> Display Skin.
   ========================================================================= */

.pd-ot-wrapper {
    --pd-radius: 18px;
    --pd-radius-sm: 12px;
    --pd-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --pd-bg: #f8fafc;
    --pd-card-bg: #ffffff;
    --pd-border: #e2e8f0;
    --pd-text: #1e293b;
    --pd-text-muted: #64748b;
    --pd-text-faint: #94a3b8;
    --pd-primary: #3b82f6;
    --pd-primary-strong: #2563eb;
    --pd-primary-contrast: #ffffff;
    --pd-button-bg: var(--pd-primary);
    --pd-input-bg: #ffffff;
    --pd-line: #e2e8f0;
    --pd-success: #10b981;
    --pd-danger: #ef4444;
    --pd-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Vazirmatn', Tahoma, sans-serif;
    --pd-heading-font: var(--pd-font);

    max-width: 820px;
    margin: 0 auto;
    font-family: var(--pd-font);
    direction: rtl;
    color: var(--pd-text);
}

.pd-ot-wrapper * { box-sizing: border-box; }

/* ======== Skin: Modern (default) ======== */
.pd-ot-wrapper.skin-modern {
    --pd-radius: 18px;
    --pd-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}
.pd-ot-wrapper.skin-modern.dark {
    --pd-bg: #0f172a;
    --pd-card-bg: #1e293b;
    --pd-border: #334155;
    --pd-text: #f1f5f9;
    --pd-text-muted: #94a3b8;
    --pd-text-faint: #64748b;
    --pd-input-bg: #0f172a;
    --pd-line: #334155;
    --pd-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ======== Skin: Luxury (premium dark) ======== */
.pd-ot-wrapper.skin-luxury {
    --pd-radius: 22px;
    --pd-bg: #120c22;
    --pd-card-bg: #1a1435;
    --pd-border: #3a2f5c;
    --pd-text: #f5f1ff;
    --pd-text-muted: #b8a9d9;
    --pd-text-faint: #8a7bb0;
    --pd-primary: #d4af37;
    --pd-primary-strong: #c49a2b;
    --pd-primary-contrast: #1a1435;
    --pd-input-bg: #241b45;
    --pd-line: #3a2f5c;
    --pd-success: #34d399;
    --pd-shadow: 0 12px 40px rgba(212, 175, 55, 0.12);
    --pd-heading-font: Georgia, 'Times New Roman', var(--pd-font);
}

/* ======== Skin: Vibrant (colorful gradient) ======== */
.pd-ot-wrapper.skin-vibrant {
    --pd-radius: 26px;
    --pd-bg: #fdf4ff;
    --pd-card-bg: #ffffff;
    --pd-border: #f0e4ff;
    --pd-text: #241b3d;
    --pd-text-muted: #6f6591;
    --pd-text-faint: #a79bcf;
    --pd-primary: #8b5cf6;
    --pd-primary-strong: #7c3aed;
    --pd-primary-contrast: #ffffff;
    --pd-button-bg: linear-gradient(135deg, #ec4899, #8b5cf6 55%, #06b6d4);
    --pd-input-bg: #faf7ff;
    --pd-line: #ecdffe;
    --pd-shadow: 0 14px 36px rgba(139, 92, 246, 0.18);
}

/* ======== Search Box ======== */
.pd-ot-search-box {
    background: var(--pd-card-bg);
    border-radius: var(--pd-radius);
    padding: 32px;
    box-shadow: var(--pd-shadow);
    border: 1px solid var(--pd-border);
    margin-bottom: 28px;
}

.pd-ot-header { text-align: center; margin-bottom: 24px; }
.pd-ot-header h3 {
    font-family: var(--pd-heading-font);
    font-size: 24px;
    font-weight: 700;
    color: var(--pd-text);
    margin: 0 0 8px 0;
}
.pd-ot-header p { color: var(--pd-text-muted); font-size: 14px; margin: 0; }

/* ======== Form ======== */
.pd-ot-form { display: flex; flex-direction: column; gap: 18px; }
.pd-ot-input-group { display: flex; flex-direction: column; gap: 8px; }
.pd-ot-input-group label { font-weight: 600; color: var(--pd-text); font-size: 14px; }

.pd-ot-input-group input {
    padding: 14px 16px;
    border: 2px solid var(--pd-border);
    border-radius: var(--pd-radius-sm);
    font-size: 15px;
    background: var(--pd-input-bg);
    color: var(--pd-text);
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pd-ot-input-group input::placeholder { color: var(--pd-text-faint); }
.pd-ot-input-group input:focus {
    outline: none;
    border-color: var(--pd-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pd-primary) 20%, transparent);
}

/* Honeypot field: moved off-screen rather than display:none, since some
   bots specifically skip inputs hidden that way. Real visitors never
   see or reach it (also unreachable by keyboard via tabindex="-1"). */
.pd-ot-hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.pd-ot-submit {
    background: var(--pd-button-bg);
    color: var(--pd-primary-contrast);
    border: none;
    padding: 15px 24px;
    border-radius: var(--pd-radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.pd-ot-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--pd-primary) 40%, transparent);
}
.pd-ot-submit:active { transform: translateY(0); }
.pd-ot-submit:disabled { opacity: 0.7; cursor: default; transform: none; }

.btn-loader {
    display: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: pd-ot-spin 0.7s linear infinite;
}
.pd-ot-submit:disabled .btn-loader { display: inline-block; }

/* ======== Result Container ======== */
.pd-ot-result-container { animation: pd-ot-fadeIn 0.4s ease; }

.pd-ot-loading, .pd-ot-error {
    text-align: center;
    padding: 30px 20px;
    border-radius: var(--pd-radius-sm);
    font-size: 15px;
}
.pd-ot-loading { color: var(--pd-text-muted); background: var(--pd-card-bg); border: 1px solid var(--pd-border); }
.pd-ot-error {
    background: #fef2f2;
    background: color-mix(in srgb, var(--pd-danger) 10%, var(--pd-card-bg));
    border: 1px solid #fecaca;
    border: 1px solid color-mix(in srgb, var(--pd-danger) 35%, transparent);
    color: var(--pd-danger);
    font-weight: 600;
}

/* ======== Status Card ======== */
.pd-ot-status-card {
    background: var(--pd-card-bg);
    border-radius: var(--pd-radius);
    padding: 26px;
    box-shadow: var(--pd-shadow);
    border: 1px solid var(--pd-border);
}

.pd-ot-status-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--pd-line);
    margin-bottom: 20px;
}

.pd-ot-status-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}
.pd-ot-status-icon .dashicons { font-size: 28px; width: 28px; height: 28px; }

.pd-ot-status-info { flex: 1; min-width: 0; }
.pd-ot-status-info h4 {
    font-family: var(--pd-heading-font);
    margin: 0 0 6px 0;
    font-size: 18px;
    color: var(--pd-text);
}

.pd-ot-status-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

/* ======== Timeline ======== */
.pd-ot-timeline { margin: 8px 0 24px 0; position: relative; }

.pd-ot-timeline-item { display: flex; gap: 18px; position: relative; padding-bottom: 26px; }
.pd-ot-timeline-item:last-child { padding-bottom: 0; }

.pd-ot-timeline-marker { position: relative; flex-shrink: 0; }

.pd-ot-timeline-icon {
    width: 42px;
    height: 42px;
    background: var(--pd-card-bg);
    border: 3px solid var(--pd-line);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
    z-index: 2;
    color: var(--pd-text-faint);
}
.pd-ot-timeline-icon .dashicons { font-size: 20px; width: 20px; height: 20px; }

.pd-ot-timeline-item.current .pd-ot-timeline-icon {
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent);
    animation: pd-ot-pulse 2s infinite;
}

.pd-ot-timeline-line {
    position: absolute;
    top: 42px;
    right: 20px;
    width: 2px;
    height: calc(100% - 20px);
    background: var(--pd-line);
    z-index: 1;
}
.pd-ot-timeline-item.completed .pd-ot-timeline-line { background: var(--pd-success); }

.pd-ot-timeline-content { flex: 1; padding-top: 8px; }
.pd-ot-timeline-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--pd-text-faint);
    margin: 0 0 4px 0;
}
.pd-ot-timeline-item.completed .pd-ot-timeline-title,
.pd-ot-timeline-item.current .pd-ot-timeline-title { color: var(--pd-text); }

.pd-ot-timeline-date {
    display: block;
    font-size: 11px;
    color: var(--pd-text-muted);
    margin: -2px 0 6px 0;
}

.pd-ot-timeline-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
}
.pd-ot-timeline-badge.current { background: color-mix(in srgb, var(--pd-primary) 18%, transparent); color: var(--pd-primary); }
.pd-ot-timeline-badge.completed { background: color-mix(in srgb, var(--pd-success) 18%, transparent); color: var(--pd-success); }

/* ======== Order Details Table ======== */
.pd-ot-order-details { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--pd-line); }
.pd-ot-section-title { margin: 0 0 14px 0; font-size: 15px; color: var(--pd-text); display: flex; align-items: center; gap: 6px; }
.pd-ot-table-scroll { overflow-x: auto; }
.pd-ot-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 420px; }
.pd-ot-table th {
    padding: 10px;
    text-align: right;
    background: var(--pd-bg);
    color: var(--pd-text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--pd-line);
    white-space: nowrap;
}
.pd-ot-table td { padding: 10px; border-bottom: 1px solid var(--pd-line); color: var(--pd-text); }
.pd-ot-product-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: block; }
.pd-ot-product-variation { font-size: 11px; color: var(--pd-text-muted); }

/* ======== Courier Card ======== */
.pd-ot-courier-card {
    background: var(--pd-bg);
    border-radius: var(--pd-radius-sm);
    padding: 18px 20px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    border: 1px solid var(--pd-border);
}
.pd-ot-courier-info { display: flex; flex-direction: column; gap: 4px; }
.pd-ot-courier-label { font-size: 12px; color: var(--pd-text-muted); }
.pd-ot-courier-value { font-weight: 700; color: var(--pd-text); font-size: 15px; }
.pd-ot-courier-code { font-family: monospace; font-size: 13px; background: var(--pd-card-bg); border: 1px solid var(--pd-border); padding: 3px 8px; border-radius: 8px; width: fit-content; }

.pd-ot-track-btn {
    background: var(--pd-button-bg);
    color: var(--pd-primary-contrast);
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s;
}
.pd-ot-track-btn:hover { transform: translateY(-2px); }

/* ======== Summary Row ======== */
.pd-ot-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--pd-line);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.pd-ot-summary-label { display: block; font-size: 12px; color: var(--pd-text-muted); margin-bottom: 4px; }
.pd-ot-summary strong { color: var(--pd-text); font-size: 14px; }

/* ======== Animations ======== */
@keyframes pd-ot-fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pd-ot-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 40%, transparent); }
    70% { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes pd-ot-spin { to { transform: rotate(360deg); } }

/* ======== Responsive ======== */
@media (max-width: 640px) {
    .pd-ot-search-box, .pd-ot-status-card { padding: 20px; }
    .pd-ot-timeline-icon { width: 36px; height: 36px; font-size: 16px; }
    .pd-ot-timeline-icon .dashicons { font-size: 16px; width: 16px; height: 16px; }
    .pd-ot-timeline-line { right: 17px; top: 36px; height: calc(100% - 16px); }
    .pd-ot-courier-card { flex-direction: column; align-items: flex-start; }
    .pd-ot-track-btn { width: 100%; justify-content: center; }
}
