/**
 * Market Signals Plugin Styles
 */

/* Override theme padding on pages with market signals */
body.page #main #content-wrap {
    padding-top: 15px !important;
}

/* Reserve space for scrollbar WITHOUT showing it - PREVENT LAYOUT SHIFT */
html {
    scrollbar-gutter: stable !important;
}

/* Main wrapper - MINIMIZED */
.market-signals-wrapper {
    margin: 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Prevent layout shift when content height changes */
    width: 100%;
    box-sizing: border-box;
}

/* Tables - MINIMIZED */
.market-signals-table,
.market-signals-full-table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse;
    margin: 5px 0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.market-signals-table th,
.market-signals-full-table th {
    background: #4a5568;
    color: #fff;
    padding: 4px 3px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid #3a4555;
}

.market-signals-table td,
.market-signals-full-table td {
    padding: 3px 3px;
    border: 1px solid #e2e8f0;
    text-align: center;
    font-size: 13px;
    color: #000;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.market-signals-table td.sector-name,
.market-signals-full-table td.sector-name {
    text-align: left;
    padding-left: 15px;
    font-weight: 600;
    font-size: 11px;
}

.market-signals-table tbody tr:hover,
.market-signals-full-table tbody tr:hover {
    background-color: #f7fafc;
}

/* Signal badges */
.signal-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.signal-badge.signal-bullish {
    background-color: #4caf50;
    color: #fff;
}

.signal-badge.signal-bearish {
    background-color: #f44336;
    color: #fff;
}

.signal-badge.signal-neutral {
    background-color: #ffeb3b;
    color: #000;
}

/* Signal cards (for sector overview) */
.signal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.signal-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.signal-card h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #2d3748;
    border-bottom: 2px solid #4a5568;
    padding-bottom: 10px;
}

.signal-level {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin: 10px 0;
}

.signal-state {
    margin: 15px 0;
}

.signal-info {
    font-size: 13px;
    color: #718096;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

/* Note text */
.market-signals-note {
    font-size: 12px;
    color: #718096;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #f7fafc;
    border-radius: 4px;
}

/* Signal date */
.signal-date {
    font-size: 13px;
    color: #718096;
    margin: 0 0 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .market-signals-table th,
    .market-signals-full-table th,
    .market-signals-table td,
    .market-signals-full-table td {
        padding: 8px 4px;
    }

    .signal-cards {
        grid-template-columns: 1fr;
    }
}

/* Loading state */
.market-signals-loading {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.market-signals-loading::after {
    content: "Loading...";
    font-size: 16px;
}

/* Error state */
.market-signals-error {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

/* ========================================================================
   TABLE SEARCH STYLES
   ======================================================================== */

/* Search container - MINIMIZED */
.table-search-container {
    margin: 5px 0 10px 0;
}

/* Search input wrapper with icon */
.search-input-wrapper {
    position: relative;
    max-width: 500px;
}

/* Search icon */
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    pointer-events: none;
}

/* Search input field - MINIMIZED */
.table-search-input {
    width: 100%;
    padding: 6px 35px 6px 32px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background-color: #fff;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.table-search-input:focus {
    outline: none;
    border-color: #4a5568;
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.1);
}

.table-search-input::placeholder {
    color: #a0aec0;
}

/* Clear button */
.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #718096;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search-btn:hover {
    background-color: #f7fafc;
    color: #2d3748;
}

.clear-search-btn:active {
    background-color: #edf2f7;
}

/* No results message */
.no-results-message {
    text-align: center;
    padding: 40px 20px;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin: 20px 0;
}

.no-results-message p {
    margin: 0;
    color: #718096;
    font-size: 15px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-input-wrapper {
        max-width: 100%;
    }

    .table-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* ========================================================================
   HELP BANNER & EXPANDABLE ROW HINTS
   ======================================================================== */

/* Enhanced help banner */
.help-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 18px;
    background: linear-gradient(135deg, #ebf4ff 0%, #e0f2fe 100%);
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    margin: 15px 0 20px 0;
}

.help-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.help-content {
    flex: 1;
    font-size: 13px;
    color: #1e40af;
}

.help-content strong {
    display: block;
    margin-bottom: 8px;
    color: #1e3a8a;
    font-size: 14px;
}

.help-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.help-content li {
    padding: 3px 0;
    padding-left: 18px;
    position: relative;
}

.help-content li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
}

/* Visual button styling for expand icon - DISABLED per user request */
.expand-icon {
    position: relative;
}

.expand-icon .chevron {
    position: relative;
}

/* Mobile responsive for help banner */
@media (max-width: 768px) {
    .help-banner {
        padding: 12px 15px;
    }

    .help-content {
        font-size: 12px;
    }

    .help-content strong {
        font-size: 13px;
    }

    .help-content li {
        padding: 2px 0;
    }
}

/* ============================================================================
   INDEX SUMMARY TABLE STYLES (v1.5.0+)
   ============================================================================ */

/* Summary container spacing */
.index-summary-container {
    margin-bottom: 30px;
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.index-summary-container .summary-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

/* Summary table wrapper for horizontal scroll */
.summary-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -5px;
    padding: 0 5px;
}

/* Summary table base styles */
.index-summary-table {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    font-size: 11px;
    background: #fff;
}

.index-summary-table thead th {
    background-color: #4a5568;
    color: #fff;
    font-weight: 600;
    padding: 8px 6px;
    text-align: center;
    font-size: 10px;
    white-space: nowrap;
    border: 1px solid #3a4555;
}

.index-summary-table tbody td {
    padding: 6px 4px;
    text-align: center;
    font-size: 13px;
    color: #000;
    font-weight: 400;
    border: 1px solid #e2e8f0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.index-summary-table tbody tr:hover {
    background-color: #f7fafc;
}

/* Sector name column - left aligned and bold */
.index-summary-table .sector-name {
    text-align: left !important;
    font-weight: 600;
    padding-left: 12px !important;
    white-space: nowrap;
    min-width: 180px;
    font-size: 11px;
}

/* Percentage columns - now black and larger */
.index-summary-table .pct-col {
    font-size: 13px;
    color: #000;
    font-weight: 400;
}

/* Change columns - colored based on positive/negative */
.index-summary-table .change-col {
    font-weight: 600;
    font-size: 13px;
}

.index-summary-table .change-col.positive {
    color: #10b981;
}

.index-summary-table .change-col.negative {
    color: #ef4444;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .index-summary-container {
        padding: 10px;
        margin-bottom: 20px;
    }

    .index-summary-container .summary-title {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .index-summary-table {
        min-width: 700px;
    }

    .index-summary-table thead th,
    .index-summary-table tbody td {
        padding: 4px 2px;
    }

    .index-summary-table .sector-name {
        padding-left: 8px !important;
    }
}

/* ============================================================================
   STOCK AND ETF TABLE ENHANCEMENTS (Larger, Black Text for Data Columns)
   ============================================================================ */

/* Keep name, sector, and sub-industry columns at smaller size in full tables */
.market-signals-full-table td.symbol-name,
.market-signals-full-table td.sector-col,
.market-signals-full-table td.sub-industry-col {
    font-size: 11px;
}
