/* Updated tsi-archive-widget.css - Matching Stockalize Design */

/* Base Container */
.tsi-archive-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
}

/* Light Theme */
.tsi-light-theme {
    background: #f9fafb;
    color: #111827;
}

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

/* Header Section */
.tsi-archive-header {
    margin-bottom: 2rem;
    text-align: right;
}

.tsi-archive-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.tsi-dark-theme .tsi-archive-header h1 {
    color: #f9fafb;
}

.tsi-archive-header p {
    color: #6b7280;
    font-size: 1rem;
}

.tsi-dark-theme .tsi-archive-header p {
    color: #9ca3af;
}

/* Market Overview Cards */
.tsi-market-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tsi-overview-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.tsi-dark-theme .tsi-overview-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

.tsi-overview-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tsi-overview-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 0.25rem 0;
}

.tsi-dark-theme .tsi-overview-label {
    color: #9ca3af;
}

.tsi-overview-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.tsi-dark-theme .tsi-overview-value {
    color: #f9fafb;
}

.tsi-overview-value.tsi-text-green {
    color: #059669;
}

.tsi-overview-icon {
    width: 3rem;
    height: 3rem;
    padding: 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tsi-overview-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.tsi-icon-blue {
    background: #dbeafe;
    color: #2563eb;
}

.tsi-icon-green {
    background: #d1fae5;
    color: #059669;
}

.tsi-icon-gray {
    background: #f3f4f6;
    color: #6b7280;
}

.tsi-dark-theme .tsi-icon-blue {
    background: #1e3a8a;
    color: #60a5fa;
}

.tsi-dark-theme .tsi-icon-green {
    background: #064e3b;
    color: #34d399;
}

.tsi-dark-theme .tsi-icon-gray {
    background: #374151;
    color: #9ca3af;
}

/* Filter Section */
.tsi-filters-section {
    margin-bottom: 2rem;
    display: flex;
    justify-content: flex-end;
}

.tsi-filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tsi-filter-button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tsi-dark-theme .tsi-filter-button {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

.tsi-filter-button:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.tsi-dark-theme .tsi-filter-button:hover {
    background: #334155;
    border-color: #475569;
}

.tsi-filter-button.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.tsi-dark-theme .tsi-filter-button.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Stock Grid */
.tsi-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(550px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .tsi-archive-grid {
        grid-template-columns: 1fr;
    }
}

/* Stock Card */
.tsi-stock-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.2s ease;
    overflow: hidden;
}

.tsi-dark-theme .tsi-stock-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

.tsi-stock-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tsi-dark-theme .tsi-stock-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

.tsi-card-content {
    padding: 1.5rem;
}

/* Card Header */
.tsi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.tsi-price-section {
    text-align: left;
}

.tsi-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

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

.tsi-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.tsi-change svg {
    width: 1rem;
    height: 1rem;
}

.tsi-change.positive {
    color: #059669;
}

.tsi-change.negative {
    color: #dc2626;
}

.tsi-symbol-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tsi-symbol-info {
    text-align: right;
}

.tsi-symbol-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.125rem 0;
}

.tsi-dark-theme .tsi-symbol-info h3 {
    color: #f9fafb;
}

.tsi-symbol-info p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.tsi-dark-theme .tsi-symbol-info p {
    color: #9ca3af;
}

.tsi-symbol-icon {
    width: 3rem;
    height: 3rem;
    background: #2563eb;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tsi-symbol-icon span {
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
}

/* Metrics Grid */
.tsi-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.tsi-metric-item {
    text-align: right;
}

.tsi-metric-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.125rem;
}

.tsi-dark-theme .tsi-metric-label {
    color: #9ca3af;
}

.tsi-metric-value {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

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

/* Recommendation Badge */
.tsi-recommendation-badge {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tsi-recommendation-badge.buy {
    background: #d1fae5;
    color: #065f46;
}

.tsi-recommendation-badge.hold {
    background: #fef3c7;
    color: #92400e;
}

.tsi-recommendation-badge.sell {
    background: #fee2e2;
    color: #991b1b;
}

.tsi-dark-theme .tsi-recommendation-badge.buy {
    background: #064e3b;
    color: #34d399;
}

.tsi-dark-theme .tsi-recommendation-badge.hold {
    background: #78350f;
    color: #fbbf24;
}

.tsi-dark-theme .tsi-recommendation-badge.sell {
    background: #7f1d1d;
    color: #f87171;
}

/* AI Summary */
.tsi-ai-summary {
    margin-bottom: 1rem;
}

.tsi-ai-summary h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    margin: 0 0 0.5rem 0;
    text-align: right;
}

.tsi-dark-theme .tsi-ai-summary h4 {
    color: #f9fafb;
}

.tsi-ai-summary p {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    text-align: right;
    margin: 0;
}

.tsi-dark-theme .tsi-ai-summary p {
    color: #9ca3af;
}

/* Card Footer */
.tsi-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.tsi-dark-theme .tsi-card-footer {
    border-top-color: #334155;
}

.tsi-update-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.tsi-dark-theme .tsi-update-time {
    color: #9ca3af;
}

.tsi-update-time svg {
    width: 0.75rem;
    height: 0.75rem;
}

.tsi-view-details {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #2563eb;
    text-decoration: none;
    transition: color 0.15s ease;
}

.tsi-view-details:hover {
    color: #1d4ed8;
}

.tsi-dark-theme .tsi-view-details {
    color: #60a5fa;
}

.tsi-dark-theme .tsi-view-details:hover {
    color: #93bbfc;
}

.tsi-view-details svg {
    width: 1rem;
    height: 1rem;
}

/* Pagination */
.tsi-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.tsi-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    transition: all 0.15s ease;
}

.tsi-dark-theme .tsi-pagination .page-numbers {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

.tsi-pagination .page-numbers:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.tsi-dark-theme .tsi-pagination .page-numbers:hover {
    background: #334155;
    border-color: #475569;
}

.tsi-pagination .page-numbers.current {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* RTL Support */
[dir="rtl"] .tsi-card-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .tsi-price-section {
    text-align: right;
}

[dir="rtl"] .tsi-symbol-section {
    flex-direction: row-reverse;
}

[dir="rtl"] .tsi-symbol-info {
    text-align: left;
}

[dir="rtl"] .tsi-metric-item {
    text-align: left;
}

[dir="rtl"] .tsi-change {
    flex-direction: row-reverse;
}

[dir="rtl"] .tsi-update-time {
    flex-direction: row-reverse;
}

[dir="rtl"] .tsi-view-details {
    flex-direction: row-reverse;
}

/* Responsive */
@media (max-width: 640px) {
    .tsi-archive-grid {
        grid-template-columns: 1fr;
    }
    
    .tsi-metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .tsi-filter-buttons {
        width: 100%;
        justify-content: center;
    }
}
