/* ============================================================
   BoleWatch — Tracking Modal Styles
   ============================================================ */

/* Trigger button in header — matches .bw-hdr-btn style for visual consistency */
.bw-tracking-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: #f5f5f5;
    border: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.2s;
    line-height: 1;
    white-space: nowrap;
    height: 40px;
    box-sizing: border-box;
}
.bw-tracking-btn:hover {
    background: #e8e8e8;
}
.bw-tracking-btn svg { flex-shrink: 0; }

/* Floating fallback — fixed position top-right when header injection fails */
.bw-tracking-btn--floating {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 99990;
    box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}

/* Modal overlay — hidden by default */
.bw-tracking-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: bwTrackingFadeIn 0.2s ease;
}
@keyframes bwTrackingFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal box — white base + glass effect */
.bw-tracking-modal {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.4);
    width: 90%;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 28px 24px;
    position: relative;
    animation: bwTrackingSlideUp 0.25s ease;
}
@keyframes bwTrackingSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Close button */
.bw-tracking-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}
.bw-tracking-close:hover {
    background: rgba(0,0,0,0.06);
    color: #222;
}

/* Title */
.bw-tracking-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #111;
    text-align: center;
}

/* Input */
.bw-tracking-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: rgba(255,255,255,0.7);
}
.bw-tracking-input:focus {
    border-color: #c9a96e;
    box-shadow: 0 0 0 3px rgba(201,169,110,0.15);
}

/* Submit button — liquid glass */
.bw-tracking-submit {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 12px 0;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #c9a96e 0%, #b8944f 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.15s, box-shadow 0.2s;
}
.bw-tracking-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201,169,110,0.35);
}

/* Result area */
.bw-tracking-result {
    margin-top: 20px;
}
.bw-tracking-error {
    color: #d9534f;
    text-align: center;
    padding: 16px;
    font-size: 14px;
}
/* Result card — tracking number + note + action button */
.bw-tracking-result-card {
    background: linear-gradient(135deg, rgba(201,169,110,0.06) 0%, rgba(184,148,79,0.03) 100%);
    border: 1px solid rgba(201,169,110,0.20);
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
}
.bw-tracking-result-no {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    letter-spacing: 0.8px;
    word-break: break-all;
    margin-bottom: 8px;
}
.bw-tracking-result-note {
    font-size: 13px;
    color: #888;
    margin: 0 0 20px;
}
.bw-tracking-result-btn {
    display: inline-block;
    padding: 12px 32px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #c9a96e 0%, #b8944f 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}
.bw-tracking-result-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201,169,110,0.35);
}

/* History section */
.bw-tracking-history {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.bw-tracking-history-title {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bw-tracking-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.bw-tracking-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 4px;
}
.bw-tracking-history-item:hover {
    background: rgba(0,0,0,0.03);
}
.bw-tracking-history-item:active {
    background: rgba(0,0,0,0.06);
}
.bw-tracking-history-no {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bw-tracking-history-time {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
    flex-shrink: 0;
}
.bw-tracking-history-del {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
    padding: 0;
    line-height: 1;
}
.bw-tracking-history-del:hover {
    color: #e74c3c;
    background: rgba(231,76,60,0.08);
}
.bw-tracking-history-empty {
    padding: 24px 0;
    text-align: center;
    color: #bbb;
    font-size: 13px;
}

/* Mobile — fullscreen modal */
@media (max-width: 600px) {
    .bw-tracking-modal {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 24px 18px;
        display: flex;
        flex-direction: column;
    }
    .bw-tracking-title { font-size: 18px; margin-bottom: 16px; }
    .bw-tracking-input { font-size: 16px; }
    .bw-tracking-body { flex: 1; overflow-y: auto; }
    /* Hide button text on mobile — matches .bw-hdr-btn behavior */
    .bw-tracking-btn span { display: none; }
    .bw-tracking-btn { padding: 8px 12px; }
}
