/* Stock Data Widget Styles */
.tsi-stock-data {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tsi-stock-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.tsi-stock-field:last-child {
    border-bottom: none;
}

.tsi-stock-field .label {
    color: #666;
    font-weight: 500;
}

.tsi-stock-field .value {
    font-weight: 500;
    color: #333;
}

/* Stock Widget Styles */
.tsi-stock-widget,
.tsi-etf-widget {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tsi-stock-widget h3,
.tsi-etf-widget h3 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
}

.tsi-stock-widget .sector,
.tsi-etf-widget .category {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tsi-stock-widget p,
.tsi-etf-widget p {
    margin: 8px 0;
}

.tsi-stock-widget .change,
.tsi-etf-widget .change {
    font-weight: 600;
    font-size: 16px;
}

.positive {
    color: #2ecc71;
}

.negative {
    color: #e74c3c;
}

.tsi-stock-widget .last-update {
    font-size: 12px;
    color: #999;
    margin-top: 15px;
}

/* Stock Price Widget Styles */
.tsi-stock-price {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.tsi-stock-price .price {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.tsi-stock-price .change {
    font-size: 18px;
    font-weight: 500;
}

/* Stock Chart Widget Styles */
.tsi-stock-chart {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tsi-stock-chart canvas {
    width: 100% !important;
}

/* Responsive Styles */
@media (max-width: 767px) {
    .tsi-stock-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .tsi-stock-price .price {
        font-size: 28px;
    }

    .tsi-stock-price .change {
        font-size: 16px;
    }
    
    .tsi-stock-widget h3,
    .tsi-etf-widget h3 {
        font-size: 20px;
    }
}

/* tsi-archive-widget.css */

/* Archive Page Styles */
.tsi-archive-container {
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Dark Theme */
.tsi-dark-theme {
    background: #0a0e27;
    color: #e0e6ed;
}

.tsi-dark-theme .tsi-filters-bar {
    background: #1e2139;
}

.tsi-dark-theme .tsi-stock-card {
    background: #1e2139;
}

.tsi-dark-theme input,
.tsi-dark-theme select {
    background: #0a0e27;
    border-color: #2d3561;
    color: #e0e6ed;
}

/* Light Theme */
.tsi-light-theme {
    background: #f5f7fa;
    color: #2d3748;
}

.tsi-light-theme .tsi-filters-bar {
    background: #ffffff;
}

.tsi-light-theme .tsi-stock-card {
    background: #ffffff;
}

.tsi-light-theme input,
.tsi-light-theme select {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #2d3748;
}

/* Filters Bar */
.tsi-filters-bar {
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 40px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.tsi-search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.tsi-search-box input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.tsi-search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.tsi-search-box .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0.5;
}

.tsi-filter-dropdown {
    position: relative;
}

.tsi-filter-dropdown select {
    padding: 12px 40px 12px 20px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.tsi-filter-dropdown select:hover {
    border-color: #667eea;
}

.tsi-filter-dropdown:after {
    content: '▼';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #667eea;
}

/* Stock Grid */
.tsi-archive-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

.tsi-stock-card {
    border-radius: 15px;
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tsi-stock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.tsi-stock-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.tsi-stock-card:hover::before {
    transform: translateX(0);
}

.tsi-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tsi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.tsi-stock-info h3 {
    font-size: 1.8em;
    margin: 0 0 5px 0;
    font-weight: 700;
}

.tsi-dark-theme .tsi-stock-info h3 {
    color: #fff;
}

.tsi-company-name {
    font-size: 0.9em;
    opacity: 0.7;
}

.tsi-stock-price {
    text-align: right;
}

.tsi-price-current {
    font-size: 1.8em;
    font-weight: 700;
}

.tsi-dark-theme .tsi-price-current {
    color: #fff;
}

.tsi-price-change {
    font-size: 0.9em;
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
}

.tsi-price-change.positive {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.tsi-price-change.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.tsi-type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.tsi-type-badge.stock {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.tsi-type-badge.etf {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.tsi-stock-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.tsi-metric {
    padding: 15px;
    border-radius: 10px;
}

.tsi-dark-theme .tsi-metric {
    background: #0a0e27;
}

.tsi-light-theme .tsi-metric {
    background: #f7fafc;
}

.tsi-metric-label {
    font-size: 0.85em;
    opacity: 0.7;
    margin-bottom: 5px;
}

.tsi-metric-value {
    font-size: 1.2em;
    font-weight: 600;
}

.tsi-ai-summary-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(45, 53, 97, 0.3);
}

.tsi-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    margin-bottom: 10px;
    color: #fff;
}

.tsi-ai-badge svg {
    width: 16px;
    height: 16px;
}

.tsi-summary-text {
    font-size: 0.95em;
    line-height: 1.6;
    opacity: 0.8;
}

/* Pagination */
.tsi-pagination {
    text-align: center;
    margin-top: 40px;
}

.tsi-pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tsi-dark-theme .tsi-pagination .page-numbers {
    background: #1e2139;
    color: #e0e6ed;
}

.tsi-light-theme .tsi-pagination .page-numbers {
    background: #ffffff;
    color: #2d3748;
}

.tsi-pagination .page-numbers:hover,
.tsi-pagination .page-numbers.current {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .tsi-filters-bar {
        flex-direction: column;
    }
    
    .tsi-search-box {
        min-width: 100%;
    }
    
    .tsi-stock-metrics {
        grid-template-columns: 1fr;
    }
}

/* Single Stock Page Styles */
.tsi-single-stock-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Hero Section */
.tsi-stock-hero {
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 40px;
}

.tsi-dark-theme .tsi-stock-hero {
    background: #1e2139;
}

.tsi-light-theme .tsi-stock-hero {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tsi-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.tsi-hero-info h1 {
    font-size: 3em;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tsi-dark-theme .tsi-hero-info h1 {
    color: #fff;
}

.tsi-full-name {
    font-size: 0.5em;
    font-weight: 400;
    opacity: 0.7;
}

.tsi-taxonomy-info {
    font-size: 1.1em;
    opacity: 0.7;
}

.tsi-hero-price {
    text-align: right;
}

.tsi-current-price {
    font-size: 3.5em;
    font-weight: 700;
    line-height: 1;
}

.tsi-dark-theme .tsi-current-price {
    color: #fff;
}

.tsi-price-details {
    margin-top: 10px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    align-items: center;
}

.tsi-change-badge {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tsi-change-badge.positive {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.tsi-change-badge.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.tsi-last-updated {
    font-size: 0.9em;
    opacity: 0.7;
}

/* Key Metrics Grid */
.tsi-key-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.tsi-key-metric-card {
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.tsi-dark-theme .tsi-key-metric-card {
    background: #0a0e27;
}

.tsi-light-theme .tsi-key-metric-card {
    background: #f7fafc;
}

.tsi-key-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.tsi-metric-label {
    font-size: 0.9em;
    opacity: 0.7;
    margin-bottom: 10px;
}

.tsi-metric-value {
    font-size: 2em;
    font-weight: 700;
}

.tsi-dark-theme .tsi-metric-value {
    color: #fff;
}

/* Content Sections */
.tsi-content-sections {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

@media (max-width: 1024px) {
    .tsi-content-sections {
        grid-template-columns: 1fr;
    }
}

/* Chart Section */
.tsi-chart-section {
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 40px;
}

.tsi-dark-theme .tsi-chart-section {
    background: #1e2139;
}

.tsi-light-theme .tsi-chart-section {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tsi-section-title {
    font-size: 2em;
    margin: 0 0 30px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tsi-section-title svg {
    width: 30px;
    height: 30px;
    color: #667eea;
}

.tsi-chart-container {
    position: relative;
    height: 400px;
}

/* AI Analysis Section */
.tsi-ai-analysis-section {
    padding: 40px;
    border-radius: 20px;
}

.tsi-dark-theme .tsi-ai-analysis-section {
    background: #1e2139;
}

.tsi-light-theme .tsi-ai-analysis-section {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tsi-ai-provider-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    color: #fff;
}

.tsi-ai-provider-badge svg {
    width: 20px;
    height: 20px;
}

.tsi-analysis-content {
    padding: 30px;
    border-radius: 15px;
}

.tsi-dark-theme .tsi-analysis-content {
    background: #0a0e27;
}

.tsi-light-theme .tsi-analysis-content {
    background: #f7fafc;
}

.tsi-analysis-content h3 {
    color: #667eea;
    font-size: 1.5em;
    margin: 30px 0 15px 0;
}

.tsi-analysis-content h3:first-child {
    margin-top: 0;
}

.tsi-analysis-content p {
    line-height: 1.8;
    margin-bottom: 20px;
}

.tsi-analysis-content ul {
    margin: 20px 0;
    padding-left: 20px;
}

.tsi-analysis-content li {
    margin-bottom: 10px;
    list-style: none;
    position: relative;
    padding-left: 25px;
}

.tsi-analysis-content li:before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Sidebar */
.tsi-sidebar-card {
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.tsi-dark-theme .tsi-sidebar-card {
    background: #1e2139;
}

.tsi-light-theme .tsi-sidebar-card {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tsi-sidebar-card h3 {
    font-size: 1.5em;
    margin: 0 0 20px 0;
}

.tsi-dark-theme .tsi-sidebar-card h3 {
    color: #fff;
}

.tsi-data-point {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid rgba(45, 53, 97, 0.2);
}

.tsi-data-point:last-child {
    border-bottom: none;
}

.tsi-data-label {
    opacity: 0.7;
}

.tsi-data-value {
    font-weight: 600;
}

.tsi-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tsi-action-button {
    padding: 15px 25px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tsi-action-button svg {
    width: 20px;
    height: 20px;
}

.tsi-action-button.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.tsi-action-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.tsi-action-button.secondary {
    background: rgba(45, 53, 97, 0.2);
    color: inherit;
}

.tsi-dark-theme .tsi-action-button.secondary {
    background: #2d3561;
    color: #e0e6ed;
}

.tsi-light-theme .tsi-action-button.secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.tsi-action-button.secondary:hover {
    background: rgba(102, 126, 234, 0.2);
}
