
.bti-container {
    font-family: iransansx, system-ui, sans-serif;
    color: var(--texts);
    background: transparent;
    direction: rtl;
    box-sizing: border-box;
}

.bti-container * {
    box-sizing: inherit;
}

/* Base resets inside the container */
.bti-container p, .bti-container h1, .bti-container h2, .bti-container h3, .bti-container h4, .bti-container ul, .bti-container li {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Layout for main shortcode */
.bti-layout-main {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.bti-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bti-main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0; /* prevent overflow */
}

/* Sidebar Box */
.bti-filter-box {
    background: var(--card-white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.bti-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bti-filter-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--headings);
}

.bti-clear-btn {
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
}

.bti-clear-btn:hover {
    color: var(--text-danger);
}

.bti-filter-section {
    margin-bottom: 20px;
}

.bti-filter-section:last-child {
    margin-bottom: 0;
}

.bti-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--texts);
    margin-bottom: 12px;
    display: block;
}

/* Checkboxes */
.bti-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bti-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--dark-text);
}

.bti-checkbox-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--button-dark);
    cursor: pointer;
    margin: 0;
}

/* Search Input */
.bti-search-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.bti-search-wrapper input {
    width: 100%;
    background: var(--inner-box-gray);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--dark-text);
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.bti-search-wrapper input:focus {
    border-color: var(--button-dark);
    background: var(--inside-white);
}

.bti-search-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.bti-autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.bti-search-item {
    padding: 12px 16px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    color: var(--dark-text);
    transition: background 0.2s;
}

.bti-search-item:last-child {
    border-bottom: none;
}

.bti-search-item:hover, .bti-search-item.selected {
    background: var(--inner-box-gray);
}

/* Selected Search Chips */
.bti-selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.bti-chip {
    background: var(--inner-box-light-gray);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--dark-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bti-chip-remove {
    cursor: pointer;
    color: var(--text-muted);
    font-weight: bold;
    font-size: 14px;
}

.bti-chip-remove:hover {
    color: var(--text-danger);
}

/* Buttons */
.bti-btn-primary {
    width: 100%;
    background: var(--button-dark);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-family: inherit;
}

.bti-btn-primary:hover {
    opacity: 0.9;
}

.bti-btn-secondary {
    background: var(--inner-box-light-gray);
    color: var(--dark-text);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: block;
    margin: 0 auto;
}

.bti-btn-secondary:hover {
    background: var(--inner-box-gray);
}

/* News List */
.bti-news-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Cards */
.bti-news-card {
    background: var(--card-white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.bti-news-card:hover {
    border-color: var(--text-muted);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.bti-card-source-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 60px;
}

.bti-source-logo {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--inner-box-gray);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 11px;
    font-weight: bold;
    color: var(--text-muted);
}

.bti-source-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bti-time {
    font-size: 11px;
    color: var(--text-muted);
}

.bti-card-body {
    flex: 1;
}

.bti-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bti-source-name {
    font-size: 12px;
    color: var(--text-muted);
}

.bti-headline {
    font-size: 15px;
    font-weight: 600;
    color: var(--headings);
    line-height: 1.5;
}

.bti-sentiment-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.bti-sentiment-positive { background: var(--text-success); color: #fff; }
.bti-sentiment-negative { background: var(--text-danger); color: #fff; }
.bti-sentiment-neutral { background: var(--inner-box-gray); color: var(--text-muted); }

/* Symbol Listing (2 columns) */
.bti-symbol-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.bti-symbol-card {
    background: var(--card-white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.bti-symbol-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.bti-symbol-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.bti-symbol-card-source {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bti-symbol-card-source .bti-source-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.bti-symbol-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--headings);
    line-height: 1.5;
}

/* Related News (1 column, smaller) */
.bti-related-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bti-related-card {
    background: var(--card-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bti-related-card:hover {
    background: var(--inner-box-light-gray);
}

.bti-related-card .bti-source-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.bti-related-card-content {
    flex: 1;
}

.bti-related-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.bti-related-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--headings);
}

/* Skeleton Loaders */
.bti-skeleton {
    background: linear-gradient(90deg, var(--inner-box-light-gray) 25%, var(--inner-box-gray) 50%, var(--inner-box-light-gray) 75%);
    background-size: 200% 100%;
    animation: bti-shimmer 1.5s infinite;
    border-radius: 8px;
}

.bti-skeleton-card {
    height: 90px;
    width: 100%;
    border-radius: 10px;
}

@keyframes bti-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Modal */
.bti-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    backdrop-filter: blur(2px);
}

.bti-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bti-modal-content {
    background: var(--card-white);
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.98);
    transition: all 0.25s ease;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.bti-modal-overlay.active .bti-modal-content {
    transform: translateY(0) scale(1);
}

.bti-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--site-background);
}

.bti-modal-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bti-modal-header-info .bti-source-logo {
    width: 36px;
    height: 36px;
}

.bti-modal-header-meta {
    display: flex;
    flex-direction: column;
}

.bti-modal-header-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--headings);
}

.bti-modal-header-time {
    font-size: 12px;
    color: var(--text-muted);
}

.bti-modal-close {
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bti-modal-close:hover {
    color: var(--text-danger);
}

.bti-modal-body {
    padding: 24px 20px;
    overflow-y: auto;
    flex: 1;
}

.bti-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--headings);
    margin-bottom: 20px;
    line-height: 1.6;
}

.bti-modal-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.bti-modal-meta-item {
    background: var(--site-background);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px;
}

.bti-modal-meta-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
}

.bti-modal-meta-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark-text);
}

.bti-confidence-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.bti-confidence-fill {
    height: 100%;
    background: var(--button-dark);
    border-radius: 3px;
}

.bti-modal-reason {
    background: var(--danger-tint);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--dark-text);
    line-height: 1.6;
}

.bti-modal-reason-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-danger);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bti-modal-content-text {
    font-size: 14px;
    color: var(--texts);
    line-height: 1.8;
    white-space: pre-wrap;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.bti-modal-symbols {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .bti-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        transform: translateY(100%);
    }
    .bti-modal-overlay.active .bti-modal-content {
        transform: translateY(0);
    }
    .bti-modal-body {
        padding-bottom: 40px;
    }
    .bti-layout-main {
        flex-direction: column;
    }
    
    .bti-sidebar {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        background: var(--card-white);
        border-radius: 16px 16px 0 0;
        z-index: 100;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        padding: 0;
        max-height: 85vh;
        border: none;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
    }
    
    .bti-sidebar.active {
        transform: translateY(0);
    }
    
    .bti-filter-box {
        border: none;
        border-radius: 0;
        box-shadow: none;
        overflow-y: auto;
        padding-bottom: 40px;
    }
    
    .bti-mobile-filter-handle {
        width: 40px;
        height: 4px;
        background: var(--border-light);
        border-radius: 2px;
        margin: 12px auto 20px;
        display: block;
    }
    
    .bti-mobile-filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        background: var(--card-white);
        border: 1px solid var(--border-light);
        padding: 12px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        color: var(--headings);
        margin-bottom: 16px;
        cursor: pointer;
    }
    
    .bti-mobile-filter-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .bti-mobile-filter-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .bti-symbol-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .bti-mobile-filter-btn, .bti-mobile-filter-handle, .bti-mobile-filter-overlay {
        display: none;
    }
}
