/**
 * Order Progress Tracker – Frontend stylesheet.
 *
 * Modern, card-based responsive layout for the [order_tracker] shortcode.
 * Uses CSS custom properties for accent color theming (set via PHP inline style).
 *
 * Theme: Light Pink / Rose
 *
 * @package OrderProgressTracker
 */

/* --------------------------------------------------------------------------
   CSS Custom Properties (overridden inline by PHP via wp_add_inline_style)
   -------------------------------------------------------------------------- */

:root {
    /* Primary pink accent – overridden by the plugin's Primary Color setting */
    --opt-primary: #d4638a;
    --opt-primary-dark: #b84d73;
    --opt-primary-light: #fce4ec;
    --opt-primary-xlight: #fff0f5;

    /* Neutral palette */
    --opt-text: #3b2a31;
    --opt-text-muted: #8d6878;
    --opt-bg: #fff8fa;
    --opt-border: #f2d4de;
    --opt-border-dark: #e8b4c4;

    /* Shapes & shadows */
    --opt-radius: 12px;
    --opt-shadow: 0 4px 28px rgba(212, 99, 138, 0.12);
    --opt-shadow-sm: 0 2px 10px rgba(212, 99, 138, 0.08);

    --opt-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Wrapper
   -------------------------------------------------------------------------- */

.opt-tracker-wrapper,
.opt-result-wrapper {
    font-family: var(--opt-font);
    color: var(--opt-text);
    line-height: 1.6;
    margin: 0 auto;
    max-width: 700px;
}

/* --------------------------------------------------------------------------
   Form Container
   -------------------------------------------------------------------------- */

.opt-form-container {
    background: linear-gradient(135deg, #fff 0%, var(--opt-primary-xlight) 100%);
    border: 1.5px solid var(--opt-border);
    border-radius: var(--opt-radius);
    padding: 36px 36px 32px;
    box-shadow: var(--opt-shadow);
    margin-bottom: 24px;
}

.opt-form-title {
    margin: 0 0 24px;
    font-size: 22px;
    font-weight: 700;
    color: var(--opt-text);
}

.opt-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.opt-input-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--opt-text);
}

.opt-input-row {
    display: flex;
    gap: 10px;
}

.opt-input {
    flex: 1;
    padding: 13px 16px;
    border: 1.5px solid var(--opt-border-dark);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--opt-text);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.opt-input:focus {
    border-color: var(--opt-primary);
    box-shadow: 0 0 0 3.5px rgba(212, 99, 138, 0.18);
}

.opt-input::placeholder {
    color: #c4a0ae;
}

.opt-input.opt-input--error {
    border-color: #e05c79;
    box-shadow: 0 0 0 3px rgba(224, 92, 121, 0.15);
}

.opt-input-error {
    font-size: 13px;
    color: #c0394f;
    min-height: 18px;
}

.opt-btn {
    padding: 13px 26px;
    background: var(--opt-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.01em;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 10px rgba(212, 99, 138, 0.35);
}

.opt-btn:hover {
    background: var(--opt-primary-dark);
    box-shadow: 0 4px 14px rgba(184, 77, 115, 0.4);
}

.opt-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(184, 77, 115, 0.3);
}

/* --------------------------------------------------------------------------
   Alert Messages
   -------------------------------------------------------------------------- */

.opt-alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.opt-alert-error {
    background: #fff0f3;
    color: #b0253c;
    border: 1px solid #f5c2cc;
}

/* --------------------------------------------------------------------------
   Result Card
   -------------------------------------------------------------------------- */

.opt-result-card {
    background: #fff;
    border: 1.5px solid var(--opt-border);
    border-radius: var(--opt-radius);
    box-shadow: var(--opt-shadow);
    overflow: hidden;
    margin-bottom: 20px;
}

.opt-result-header {
    background: linear-gradient(135deg, var(--opt-primary) 0%, var(--opt-primary-dark) 100%);
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.opt-result-header-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.opt-result-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 600;
}

.opt-result-order-id {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.01em;
}

.opt-current-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    letter-spacing: 0.01em;
}

.opt-customer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--opt-border);
    font-size: 14px;
    color: var(--opt-text-muted);
    background: var(--opt-primary-xlight);
}

.opt-customer-info .dashicons {
    color: var(--opt-primary);
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* --------------------------------------------------------------------------
   Progress Steps
   -------------------------------------------------------------------------- */

.opt-steps-wrapper {
    padding: 28px;
    overflow-x: auto;
    background: #fff;
}

.opt-steps {
    display: flex;
    align-items: flex-start;
    min-width: max-content;
}

.opt-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    min-width: 88px;
}

.opt-step-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2.5px solid var(--opt-border-dark);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.opt-step-number {
    font-size: 14px;
    font-weight: 700;
    color: #c4a0ae;
}

.opt-step-check {
    width: 18px;
    height: 18px;
    color: #fff;
}

.opt-step-label {
    font-size: 11px;
    font-weight: 500;
    color: #c4a0ae;
    text-align: center;
    max-width: 88px;
    line-height: 1.3;
}

/* Completed step */
.opt-step--completed .opt-step-indicator {
    background: var(--opt-primary);
    border-color: var(--opt-primary);
}

.opt-step--completed .opt-step-label {
    color: var(--opt-primary);
    font-weight: 600;
}

/* Active (current) step */
.opt-step--active .opt-step-indicator {
    background: var(--opt-primary);
    border-color: var(--opt-primary);
    box-shadow: 0 0 0 5px rgba(212, 99, 138, 0.2);
}

.opt-step--active .opt-step-number {
    color: #fff;
}

.opt-step--active .opt-step-label {
    color: var(--opt-primary);
    font-weight: 800;
}

/* Connector line between steps */
.opt-step-connector {
    flex: 1;
    height: 3px;
    background: var(--opt-border-dark);
    margin-top: 19px;
    /* Vertically aligns with step circle centre */
    min-width: 24px;
    border-radius: 2px;
    transition: background 0.35s ease;
}

.opt-step-connector--filled {
    background: var(--opt-primary);
}

/* --------------------------------------------------------------------------
   Timeline Card
   -------------------------------------------------------------------------- */

.opt-timeline-card {
    background: #fff;
    border: 1.5px solid var(--opt-border);
    border-radius: var(--opt-radius);
    box-shadow: var(--opt-shadow-sm);
    padding: 28px;
}

.opt-timeline-heading {
    margin: 0 0 22px;
    font-size: 16px;
    font-weight: 700;
    color: var(--opt-text);
    padding-bottom: 14px;
    border-bottom: 1.5px solid var(--opt-border);
}

.opt-timeline {
    position: relative;
    padding-left: 30px;
}

.opt-timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: linear-gradient(to bottom, var(--opt-primary), var(--opt-border-dark));
    border-radius: 2px;
}

.opt-timeline-item {
    position: relative;
    margin-bottom: 22px;
}

.opt-timeline-item:last-child {
    margin-bottom: 0;
}

.opt-timeline-marker {
    position: absolute;
    left: -26px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--opt-primary);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--opt-primary);
}

.opt-timeline-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.opt-timeline-status-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--opt-text);
}

.opt-timeline-time {
    font-size: 12px;
    color: var(--opt-text-muted);
}

.opt-timeline-note {
    margin: 5px 0 0;
    font-size: 13px;
    color: var(--opt-text-muted);
    background: var(--opt-primary-xlight);
    padding: 9px 14px;
    border-radius: 7px;
    border-left: 3px solid var(--opt-primary);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
    .opt-form-container {
        padding: 22px 18px;
    }

    .opt-input-row {
        flex-direction: column;
    }

    .opt-btn {
        width: 100%;
        text-align: center;
    }

    .opt-result-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 20px;
    }

    .opt-steps-wrapper {
        padding: 18px 16px;
    }

    .opt-timeline-card {
        padding: 18px;
    }

    .opt-customer-info {
        padding: 12px 20px;
    }
}