/* Minimalist Modern Styling, scoped to the watchlist card so it doesn't
   leak into the shared header/nav or page background from style.css. */

/* Page heading centered, using the same font used elsewhere
   (Arial, sans-serif from pensive_trader.css). */
.page-title {
    font-family: Arial, sans-serif;
    color: #fff;
}

.container {
    background: transparent;
    border-radius: 8px;
    width: 100%;
    max-width: 900px;
    box-sizing: border-box;
    height: fit-content;
    margin: 20px auto;
    padding: 30px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.container:active,
.container:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.container h1:not(.page-heading) {
    color: #fff;
    text-align: center;
    margin-top: 0;
}

/* Input Form Layout: match the ticker-search styling used across the app —
   a centered form with the input+clear button on top and the action button
   below. */
.container .watchlist-search-form {
    max-width: 560px;
    margin: 0 auto;
}

.watchlist-search-container {
    margin: 48px auto 0;
}

.watchlist-search-container .watchlist-status {
    margin-top: 16px;
    margin-bottom: 0;
}

.watchlist-results {
    margin-top: 20px;
}

.watchlist-actions {
    display: flex;
    justify-content: flex-end;
    max-width: 560px;
    margin: 12px auto 0;
}
.watchlist-secondary-actions {
    display: flex;
    justify-content: center;
    max-width: 560px;
    margin: 16px auto 0;
}

.clear-all-button {
    background-color: transparent !important;
    color: #6b7280 !important;
    border: 1px solid #6b7280 !important;
}

.clear-all-button:hover {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.container .search-input {
    position: relative;
}

.container .search-bar .search-input input[type="text"] {
    margin-bottom: 0;
}

.container .search-input input[type="text"] {
    width: 100%;
    padding-right: 42px;
}

.container input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.container .clear-search {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    color: #6b7280;
    font-size: 24px;
    line-height: 1;
}

.container .clear-search:hover,
.container .clear-search:focus-visible {
    background: transparent;
    color: #111827;
}

.container button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.container button:hover {
    background-color: #0069d9;
}

.container .search-bar {
    align-items: center;
}

.container .search-bar #addButton {
    flex-shrink: 0;
}

/* Watchlist Items */
.container ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    border-radius: 4px;
    overflow: hidden;
}

.container li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 16px;
    background-color: #17181c;
    border-bottom: 1px solid #2a2c33;
    gap: 20px;
}

.container li:last-child {
    border-bottom: none;
}

.item-clickable-area {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.item-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.item-text {
    cursor: pointer;
    flex: 1;
    min-width: 0;
    font-size: 16px;
    white-space: normal;
    word-break: break-word;
}

/* Price direction coloring, mirroring the desktop watchlist labels. */
.item-text.positive {
    color: #4ade80;
}

.item-text.negative {
    color: #f87171;
}

.item-text.neutral {
    color: #d1d5db;
}

.watchlist-status {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 4px;
    background-color: #fff3cd;
    color: #664d03;
    font-size: 14px;
}

.container .delete-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    margin-left: 8px;
}

.container .delete-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.container .analyze-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    background-color: #2563eb;
    color: white;
    border: none;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.15s ease;
}

.container .analyze-btn:hover {
    background-color: #1d4ed8;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
        width: calc(100% - 24px);
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    .watchlist-search-container {
        width: calc(100% - 24px);
        max-width: 100%;
    }
    .container .watchlist-search-form {
        max-width: 100%;
    }
    .container .search-bar {
        align-items: center;
        gap: 8px;
    }
    .container .search-bar #addButton {
        flex-shrink: 0;
        width: auto;
    }
    .container input[type="text"] {
        font-size: 14px;
    }
    /* Match the app-wide `.action-button` mobile sizing (see mobile.css) so
       Add/Clear All look identical to Get Quote/Search/etc. */
    .container button.action-button {
        min-height: 36px;
        padding: 7px 12px;
        font-size: 14px;
    }
    .container li {
        flex-wrap: wrap;
    }
    .item-text {
        font-size: 14px;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}
