/**
 * TCT Watchlist Styles
 */

.tct-watchlist-wrapper {
    margin: 20px 0;
}

.watchlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.watchlist-header h3 {
    margin: 0;
    color: #333;
}

.watchlist-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.watchlist-controls button {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    border-radius: 3px;
    cursor: pointer;
}

.watchlist-controls button:hover {
    background: #e7e7e7;
}

.watchlist-controls button.primary {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

.watchlist-controls button.primary:hover {
    background: #1e5b8a;
}

.watchlist-mainContainer {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.watchlist-table {
    width: 100%;
    border-collapse: collapse;
}

.watchlist-table th,
.watchlist-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.watchlist-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.watchlist-table tr:hover {
    background: #f9f9f9;
}

.watchlist-table .ticker {
    font-weight: bold;
    color: #2271b1;
}

.watchlist-table .price {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    text-align: right;
}

.watchlist-table .notes {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.watchlist-table .actions {
    white-space: nowrap;
    text-align: right;
}

.watchlist-table .actions button {
    margin-left: 5px;
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    border-radius: 3px;
    cursor: pointer;
}

.watchlist-table .actions button:hover {
    background: #e7e7e7;
}

.watchlist-table .actions .delete {
    color: #d63638;
    border-color: #d63638;
}

.watchlist-table .actions .delete:hover {
    background: #fef2f2;
}

.watchlist-form {
    padding: 20px;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    display: none;
}

.watchlist-form.show {
    display: block;
}

.watchlist-form .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: end;
}

.watchlist-form .form-group {
    flex: 1;
}

.watchlist-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.watchlist-form input[type="text"],
.watchlist-form input[type="number"],
.watchlist-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    box-sizing: border-box;
}

.watchlist-form textarea {
    min-height: 60px;
    resize: vertical;
}

.watchlist-form .submit-row {
    text-align: right;
}

.watchlist-form button {
    margin-left: 10px;
    padding: 8px 15px;
    font-size: 14px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    border-radius: 3px;
    cursor: pointer;
}

.watchlist-form button.primary {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

.watchlist-form button:hover {
    background: #e7e7e7;
}

.watchlist-form button.primary:hover {
    background: #1e5b8a;
}

.watchlist-empty {
    padding: 40px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.watchlist-stats {
    padding: 15px;
    background: #f0f4f8;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: #666;
}

.watchlist-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.watchlist-stats .stat-value {
    font-weight: 600;
    color: #333;
}

.price-target {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.price-target.above {
    color: #00a32a;
}

.price-target.below {
    color: #d63638;
}

.price-target.at {
    color: #ff8c00;
}

.price-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.price-indicator.above {
    background: #00a32a;
}

.price-indicator.below {
    background: #d63638;
}

.price-indicator.at {
    background: #ff8c00;
}

.ticker-symbol {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
}

.tct-loading {
    padding: 40px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.error {
    padding: 15px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    color: #991b1b;
    margin: 10px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .watchlist-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .watchlist-controls {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .watchlist-table {
        font-size: 0.9em;
    }
    
    .watchlist-table th,
    .watchlist-table td {
        padding: 8px 10px;
    }
    
    .watchlist-table .notes {
        max-width: 120px;
    }
    
    .watchlist-form .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .watchlist-form .form-group {
        flex: none;
    }
    
    .watchlist-stats {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .watchlist-table .notes {
        display: none;
    }

    .watchlist-table .actions {
        width: 60px;
    }

    .watchlist-table .actions button {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* ========================================
   WATCHLIST UPGRADE V-5 STYLES
   ======================================== */

/* Strategy Pills */
.strategy-swing {
    background-color: #3498db !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strategy-core {
    background-color: #9b59b6 !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strategy-dividend {
    background-color: #27ae60 !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strategy-spec {
    background-color: #f39c12 !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strategy-avoid {
    background-color: #e74c3c !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status Pills */
.status-building {
    background-color: #3498db !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
}

.status-in-play {
    background-color: #27ae60 !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
}

.status-extended {
    background-color: #f39c12 !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
}

.status-avoid {
    background-color: #e74c3c !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
}

.status-invalidated {
    background-color: #95a5a6 !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
    opacity: 0.7;
}

/* Invalidated row styling */
tr.row-invalidated {
    background-color: #f5f5f5 !important;
    opacity: 0.6;
}

tr.row-invalidated td {
    color: #95a5a6 !important;
}

tr.row-invalidated:hover {
    background-color: #eeeeee !important;
}

/* R/R Color Coding */
.rr-green {
    color: #27ae60 !important;
    font-weight: bold;
    font-size: 14px;
}

.rr-yellow {
    color: #f39c12 !important;
    font-weight: bold;
    font-size: 14px;
}

.rr-red {
    color: #e74c3c !important;
    font-weight: bold;
    font-size: 14px;
}

/* R/R Override Icon */
.rr-green i.fa-edit,
.rr-yellow i.fa-edit,
.rr-red i.fa-edit {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.6;
}

/* Invalidated Row Styling */
.watchlist-table tr[data-status="Invalidated"] {
    background-color: #f5f5f5;
    opacity: 0.6;
}

.watchlist-table tr[data-status="Invalidated"]:hover {
    background-color: #ececec;
}

/* Pinned Row Indicator */
.watchlist-table tr[data-pinned="1"] {
    background-color: #fffbf0;
    border-left: 4px solid #f39c12;
}

.watchlist-table tr[data-pinned="1"]:hover {
    background-color: #fff4e0;
}

/* R/R Input Field Styles */
#watchlist-rr-value[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

#watchlist-rr-value:not([readonly]) {
    background-color: #ffffff;
    border-color: #f39c12;
    box-shadow: 0 0 0 1px #f39c12;
}

/* Checkbox Label Spacing */
.tct-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.tct-checkbox input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.tct-checkbox span {
    cursor: pointer;
    user-select: none;
    font-weight: normal;
}

/* Strategy & Status Filter Dropdowns */
#filterStrategy,
#filterStatus {
    min-width: 140px;
}

/* Responsive Pills */
@media (max-width: 768px) {
    .strategy-swing,
    .strategy-core,
    .strategy-dividend,
    .strategy-spec,
    .strategy-avoid,
    .status-building,
    .status-in-play,
    .status-extended,
    .status-avoid,
    .status-invalidated {
        font-size: 10px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .strategy-swing,
    .strategy-core,
    .strategy-dividend,
    .strategy-spec,
    .strategy-avoid,
    .status-building,
    .status-in-play,
    .status-extended,
    .status-avoid,
    .status-invalidated {
        font-size: 9px;
        padding: 2px 6px;
    }

    .rr-green,
    .rr-yellow,
    .rr-red {
        font-size: 12px;
    }
}