/**
 * MSL Watchlist Styles
 *
 * @package MSL_Tools_Stocks
 * @since 1.1.0
 */

/* ═══════════ Star Button (stock page header) ═══════════ */

.msl-watchlist-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #999;
    transition: all 0.2s ease;
    margin-inline-start: 10px;
    vertical-align: middle;
    flex-shrink: 0;
}

.msl-watchlist-star:hover {
    border-color: #f5a623;
    color: #f5a623;
    transform: scale(1.1);
}

.msl-watchlist-star--active {
    border-color: #f5a623;
    color: #f5a623;
    background: rgba(245, 166, 35, 0.08);
}

.msl-watchlist-star--active:hover {
    border-color: #d48c16;
    color: #d48c16;
}

.msl-watchlist-star__icon {
    pointer-events: none;
}

/* ═══════════ Counter Badge / Link ═══════════ */

.msl-watchlist-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f7f8fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.msl-watchlist-link:hover {
    background: #eef0f4;
    border-color: #c0c0c0;
    text-decoration: none;
    color: #111;
}

.msl-watchlist-count {
    font-weight: 600;
    color: #f5a623;
}

/* ═══════════ Toast ═══════════ */

.msl-watchlist-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    direction: rtl;
}

.msl-watchlist-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ═══════════ Watchlist Page ═══════════ */

.msl-watchlist-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
    direction: rtl;
    text-align: right;
    font-family: 'Heebo', 'Assistant', sans-serif;
}

.msl-watchlist-page__title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1a1a2e;
}

/* Table */
.msl-watchlist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    direction: rtl;
}

.msl-watchlist-table thead th {
    text-align: right;
    padding: 10px 12px;
    border-bottom: 2px solid #e0e0e0;
    color: #666;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.msl-watchlist-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.msl-watchlist-row:hover {
    background: #fafbfc;
}

.msl-watchlist-cell--symbol a {
    text-decoration: none;
    color: #1a1a2e;
}

.msl-watchlist-cell--symbol a:hover {
    color: #2563eb;
}

.msl-watchlist-cell--symbol strong {
    font-size: 15px;
}

.msl-watchlist-name {
    font-size: 12px;
    color: #888;
}

.msl-watchlist-cell--price,
.msl-watchlist-cell--change,
.msl-watchlist-cell--score,
.msl-watchlist-cell--target {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.msl-positive {
    color: #16a34a;
}

.msl-negative {
    color: #dc2626;
}

.msl-watchlist-upside {
    font-size: 12px;
}

/* Remove button */
.msl-watchlist-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.msl-watchlist-remove:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.06);
}

/* Empty / Loading / Error states */
.msl-watchlist-empty,
.msl-watchlist-loading,
.msl-watchlist-error {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

.msl-watchlist-empty p:first-child {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.msl-watchlist-nodata {
    color: #999;
    font-size: 13px;
}

.msl-watchlist-nodata a {
    color: #2563eb;
}

/* Info note */
.msl-watchlist-info {
    margin-top: 20px;
    padding: 12px 16px;
    background: #f7f8fa;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}

.msl-watchlist-info p {
    margin: 0;
}

/* ═══════════ Mobile ═══════════ */

@media (max-width: 600px) {
    .msl-watchlist-page {
        padding: 20px 12px;
    }

    .msl-watchlist-page__title {
        font-size: 22px;
    }

    .msl-watchlist-table {
        font-size: 13px;
    }

    .msl-watchlist-table thead th,
    .msl-watchlist-table tbody td {
        padding: 8px 6px;
    }

    /* Hide target column on narrow screens */
    .msl-watchlist-table thead th:nth-child(5),
    .msl-watchlist-table tbody td:nth-child(5) {
        display: none;
    }

    .msl-watchlist-star {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }
}
