.tradingbull-wrap {
    background-color: #ffffff;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding: 24px;
    border-radius: 12px;
    margin: 20px 20px 20px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.tradingbull-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #2563eb;
    background: linear-gradient(to right, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    margin-top: 0;
}

.tradingbull-header p {
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.tradingbull-settings-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.tradingbull-settings-card h3 {
    margin-top: 0;
    color: #1e293b;
    font-size: 1.3rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.tradingbull-form-group {
    margin-bottom: 15px;
}

.tradingbull-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #475569;
}

.tradingbull-form-group input[type="text"],
.tradingbull-form-group input[type="password"] {
    width: 100%;
    max-width: 400px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 12px;
    color: #1e293b;
    transition: all 0.3s ease;
}

.tradingbull-form-group input[type="text"]:focus,
.tradingbull-form-group input[type="password"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.tradingbull-search-box {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.tradingbull-search-box select,
#tradingbull-exchange {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px;
    color: #1e293b;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
}

.tradingbull-search-box input[type="text"] {
    flex-grow: 1;
    max-width: 300px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 1rem;
    color: #1e293b;
    text-transform: uppercase;
}

.tradingbull-search-box input[type="button"] {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.tradingbull-search-box input[type="button"]:hover {
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.tradingbull-search-box input[type="button"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: tb-spin 1s ease-in-out infinite;
}

@keyframes tb-spin {
    to { transform: rotate(360deg); }
}

.tradingbull-report-container {
    margin-top: 24px;
}

.tb-report {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
}

.tb-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

.undervalued {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.neutral {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.overpriced {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.tb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tb-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.tb-card-title {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.tb-card-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
}

.tb-card-value.highlight {
    color: #2563eb;
}

.tb-blockquote {
    border-left: 4px solid #2563eb;
    background: rgba(37, 99, 235, 0.04);
    padding: 16px;
    margin: 24px 0;
    border-radius: 0 8px 8px 0;
    color: #475569;
    font-style: italic;
}

.tb-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    margin-bottom: 20px;
}

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

.tb-table th {
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.tb-table td {
    color: #475569;
}

.tb-watchlist-panel {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: tb-fade-in 0.4s ease;
}

.tb-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

#tb-btn-add-watchlist:hover {
    background: #f1f5f9 !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2) !important;
}

.tb-remove-watchlist:hover {
    color: #f87171 !important;
}

@keyframes tb-fade-in {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.tb-lang-toggle-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
    gap: 8px;
}

.tb-lang-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tb-lang-btn.active {
    background: rgba(37, 99, 235, 0.1);
    border-color: #2563eb;
    color: #2563eb;
}

.tb-watchlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tb-watchlist-header h3 {
    margin: 0;
    color: #2563eb;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tb-watchlist-header h3 .dashicons-star-filled {
    color: #f59e0b;
}

#tb-compare-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    flex-wrap: wrap;
}

.tb-compare-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

#tb-compare-ticker {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 12px;
    color: #1e293b;
    font-size: 0.9rem;
    outline: none;
}

#tb-compare-exchange {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 10px;
    color: #1e293b;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}

#tb-btn-compare {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

#tb-btn-compare:hover {
    opacity: 0.85;
}

#tb-history-bar {
    display: none;
    margin-top: 10px;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.tb-history-label {
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 4px;
}

.tb-empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 40px 0;
}

.tb-empty-state .dashicons-analytics {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    color: #2563eb;
}

.tb-empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

#tb-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}

.tb-toast {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    animation: tb-toast-in 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.tb-toast-success {
    background: linear-gradient(135deg, #059669, #10b981);
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.tb-toast-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.tb-toast-info {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.tb-toast-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

@keyframes tb-toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes tb-toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

.tb-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.tb-compare-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.tb-simulated-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #b45309;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#tb-openrouter-status {
    transition: opacity 0.3s ease;
}

#tb-test-openrouter .dashicons-update {
    animation: none;
}

#tb-test-openrouter:disabled .dashicons-update {
    animation: tb-spin 1s ease-in-out infinite;
}

/* AI Analysis Sections */
.tb-ai-sections {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tb-ai-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 24px;
    border-left: 4px solid #2563eb;
}

.tb-ai-section h3 {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 1.05rem;
    font-weight: 800;
}

.tb-ai-section p {
    margin: 8px 0;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.7;
}

.tb-ai-section strong {
    color: #1e293b;
}

/* Responsive: tablets */
@media (max-width: 768px) {
    .tradingbull-wrap, .tb-report {
        padding: 12px;
        margin: 10px 0;
    }
    .tb-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .tb-table {
        font-size: 0.8rem;
    }
    .tb-table th, .tb-table td {
        padding: 6px 8px;
    }
    .tradingbull-header h1 {
        font-size: 1.5rem;
    }
    .tb-report-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .tb-report-actions button,
    .tb-report-actions > div {
        width: 100%;
        justify-content: center;
    }
}

/* Responsive: phones */
@media (max-width: 480px) {
    .tradingbull-wrap, .tb-report {
        padding: 8px;
        margin: 5px 0;
    }
    .tb-grid {
        grid-template-columns: 1fr !important;
    }
    .tb-card {
        padding: 12px !important;
    }
    .tb-card-title {
        font-size: 0.7rem;
    }
    .tb-card-value {
        font-size: 1rem;
    }
    .tradingbull-header h1 {
        font-size: 1.2rem;
    }
    .tb-report h2 {
        font-size: 1.3rem !important;
    }
    .tb-report h3 {
        font-size: 1rem !important;
    }
    .tb-badge {
        font-size: 0.65rem !important;
        padding: 3px 10px !important;
    }
    .tb-table {
        font-size: 0.7rem;
    }
    .tb-table th, .tb-table td {
        padding: 4px 6px;
    }
    .tb-simulated-badge {
        font-size: 0.65rem !important;
        padding: 2px 8px !important;
    }
    .tb-action-btn {
        font-size: 0.75rem !important;
        padding: 6px 10px !important;
    }
    #tb-canvas-chart-container {
        min-height: 250px !important;
    }
    canvas#tb-html5-canvas-chart {
        height: 250px !important;
    }
    .tb-ai-section {
        padding: 12px !important;
    }
    .tb-ai-section p {
        font-size: 0.82rem;
    }
}

/* Print styles for PDF export */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .tb-report {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .tb-report-actions,
    #tb-btn-export-pdf,
    #tb-btn-refresh,
    #tb-btn-add-watchlist,
    .tb-report-actions > div {
        display: none !important;
    }
    .tb-card {
        break-inside: avoid;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    .tb-table th {
        background: #f5f5f5 !important;
        color: #000 !important;
    }
    .tb-ai-sections {
        break-inside: avoid;
    }
    canvas {
        max-width: 100% !important;
    }
}
