/* Trade Planning Page Styles */

/* Planning Tab - Override default tab styles */
#planningTab {
    padding: 0 !important;
    flex: none !important; /* Don't expand with flex */
}

#planningTab.active {
    display: block !important;
    overflow-y: auto !important;
    height: 100% !important;
}

.planning-container {
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    overflow-y: auto;
    height: 100%;
    position: relative;
}

/* Planning Layout (Sidebar + Main) */
.planning-layout {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex: 1;
    min-height: 0;
}

.planning-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 100vh; /* Full viewport height */
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.planning-main {
    flex: 1;
    min-width: 0;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 20px;
}

.filter-section h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-option:hover {
    background: #f5f5f5;
}

.filter-option input[type="radio"] {
    cursor: pointer;
}

.filter-option span {
    font-size: 13px;
    color: #666;
}

.planning-sidebar .filter-input,
.planning-sidebar .filter-select {
    width: 100%;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.planning-sidebar #symbolSearch {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #6366f1;
}

.planning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.planning-header h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Statistics Dashboard */
.planning-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    background: white;
    border-radius: 6px;
    padding: 12px 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

/* Trade Plans Table */
.planning-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
    padding: 15px;
}

.planning-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.planning-table thead {
    background: #f8f9fa;
}

.planning-table th {
    padding: 10px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    font-size: 13px;
}

.planning-table td {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
}

.planning-table tbody tr:hover {
    background: #f8f9fa;
}

.planning-table .empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state h4 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}

.empty-state p {
    color: #6c757d;
    font-size: 14px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-executed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-closed {
    background: #f8d7da;
    color: #721c24;
}

/* Buttons */
.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: white;
    color: #007bff;
    border-color: #007bff;
}

.btn-primary:active {
    background: #e6f2ff;
    color: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.modal-close {
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 12px 16px;
    font-size: 13px;
}

.modal-body p {
    margin: 6px 0;
}

.modal-body h4, .modal-body h5, .modal-body h6 {
    margin: 8px 0 6px 0;
}

.modal-footer {
    padding: 10px 16px;
    border-top: 1px solid #dee2e6;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #dee2e6;
    flex-wrap: wrap;
}

.modal-footer button {
    min-width: 90px;
    height: 36px;
    padding: 8px 16px;
    font-size: 14px;
}

/* Execute Trade Modal */
.execute-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.execute-summary h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #333;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-weight: 600;
    font-size: 16px;
    color: #28a745;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 2px solid #dee2e6;
}

#newPortfolioSection {
    background: #e8f5e9;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #4CAF50;
}

/* Form Styles */
.form-section {
    margin-bottom: 25px;
}

.form-section h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
}

.form-group small {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
}

/* Pagination */
.planning-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

#pageInfo {
    font-size: 14px;
    color: #6c757d;
}

/* Toast Animation */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Plan Details */
.plan-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.detail-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.detail-section h4 {
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 13px;
    color: #6c757d;
}

.detail-value {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.plan-notes {
    background: white;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #c82333;
}


/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
}

.pagination-info {
    margin-right: 15px;
    color: #666;
    font-size: 14px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #6366f1;
}

.pagination-btn.active {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* Loading Spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Symbol Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:hover {
    background: #f5f5f5;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.form-group {
    position: relative;
}


/* Charts Section */
.planning-charts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 15px 0;
}

.chart-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-card h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.chart-card canvas {
    max-height: 150px !important;
    height: 150px !important;
}


.btn-success {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success:hover {
    background: #059669;
}


/* Sortable Table Headers */
.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background: #f5f5f5;
}

.sort-indicator {
    color: #6366f1;
    font-size: 12px;
}


/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle::after {
    content: ' ▼';
    font-size: 10px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 150px;
    z-index: 1000;
    margin-top: 5px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item:first-child {
    border-radius: 4px 4px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 4px 4px;
}


.btn-icon {
    padding: 8px 12px;
    font-size: 16px;
}

/* Help Icons */
.help-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background: #007bff;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    margin-left: 4px;
}

.help-icon:hover {
    background: #0056b3;
}

/* AI Suggestions Button */
.btn-ai-suggest {
    margin-top: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    width: 100%;
}

.btn-ai-suggest:hover {
    opacity: 0.9;
}

/* Assessment Modal Styles */
.assessment-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.progress-step {
    text-align: center;
    flex: 1;
}

.progress-step .step-icon {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

.progress-step .step-label {
    font-size: 11px;
    color: #666;
}

.progress-step.completed .step-label {
    color: #28a745;
    font-weight: 600;
}

.assessment-recommendation {
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 12px;
}

.assessment-recommendation h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.assessment-recommendation p {
    margin: 8px 0 0 0;
    font-size: 13px;
}

.confidence-bar {
    width: 100%;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0;
}
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 1s ease;
}

.assessment-sections {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.assessment-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.assessment-section:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.assessment-section h5 {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    font-size: 14px;
}

.section-content {
    display: none;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
    font-size: 13px;
}

.section-content p {
    margin: 4px 0;
}

.section-content ul {
    margin: 6px 0;
    padding-left: 20px;
}

.section-content li {
    margin: 3px 0;
}

.assessment-section h5 {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-content {
    display: none;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    margin-top: 10px;
}

.section-content.expanded {
    display: block;
}

.toggle-icon {
    transition: transform 0.2s;
    font-size: 12px;
    color: #666;
}

.assessment-section.expanded .toggle-icon {
    transform: rotate(180deg);
}

.assessment-section h5 {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.btn-info {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-info:hover {
    background: #138496;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.modal-large {
    max-width: 900px;
    width: 90%;
}

.assessment-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    padding: 15px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #17a2b8;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: white;
    border-left-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    transform: translateX(2px);
}

.history-item div:first-child {
    font-weight: 600;
    margin-bottom: 5px;
}

.history-item div:last-child {
    font-size: 12px;
    color: #666;
}

/* Expandable Analysis Rows */
.analysis-row {
    background: #f8f9fa;
}

.analysis-container {
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.analysis-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analysis-symbol {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.analysis-type {
    font-size: 14px;
    color: #6b7280;
    padding: 4px 12px;
    background: #f3f4f6;
    border-radius: 12px;
}

.analysis-timestamp {
    font-size: 12px;
    color: #9ca3af;
}

.analysis-actions {
    display: flex;
    gap: 8px;
}

.analysis-tabs {
    margin-top: 15px;
}

.tab-buttons {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 15px;
}

.tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #1f2937;
    background: #f9fafb;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Trade Planning specific tab content */
#tradePlanTab .tab-content {
    min-height: 200px;
    display: block !important;
}

.analysis-content {
    padding: 15px;
}

.no-analysis {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

/* Signal Badges */
.signal-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.signal-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

.signal-badge.large {
    padding: 12px 24px;
    font-size: 18px;
}

.signal-badge.small {
    padding: 4px 10px;
    font-size: 11px;
}

.signal-bullish {
    background: #d1fae5;
    color: #065f46;
}

.signal-bearish {
    background: #fee2e2;
    color: #991b1b;
}

.signal-neutral {
    background: #e5e7eb;
    color: #374151;
}

/* Confidence Bar */
.confidence-bar {
    flex: 1;
}

.confidence-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.confidence-progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.3s;
}

/* Signals Grid */
.signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.signal-item {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #e5e7eb;
}

.signal-item.bullish {
    border-left-color: #10b981;
}

.signal-item.bearish {
    border-left-color: #ef4444;
}

.signal-item.neutral {
    border-left-color: #6b7280;
}

.signal-name {
    font-size: 11px;
    color: #6b7280;
    display: block;
}

.signal-value {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

/* Sections */
.recommendation-section,
.levels-section,
.volume-section,
.sentiment-section {
    margin-top: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.recommendation-section h4,
.levels-section h4,
.volume-section h4,
.sentiment-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #374151;
}

.recommendation-section p {
    margin: 0;
    line-height: 1.6;
    color: #4b5563;
}

/* Levels Grid */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.level-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
}

.level-label {
    font-weight: 600;
    color: #6b7280;
}

.level-value.support {
    color: #10b981;
    font-weight: 600;
}

.level-value.resistance {
    color: #ef4444;
    font-weight: 600;
}

/* Volume Grid */
.volume-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.volume-item {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    font-size: 13px;
}

.volume-item span {
    color: #6b7280;
}

.volume-item strong {
    color: #1f2937;
}

/* Sentiment */
.sentiment-score {
    padding: 12px;
    background: white;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.sentiment-score.positive {
    color: #10b981;
}

.sentiment-score.negative {
    color: #ef4444;
}

.sentiment-score.neutral {
    color: #6b7280;
}

/* Summary */
.summary-consensus {
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
}

.summary-consensus h3 {
    margin: 0 0 15px 0;
    color: #374151;
}

.summary-breakdown {
    margin: 20px 0;
}

.summary-breakdown h4 {
    margin: 0 0 15px 0;
    color: #374151;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.breakdown-item {
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.breakdown-count {
    display: block;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.breakdown-item.bullish .breakdown-count {
    color: #10b981;
}

.breakdown-item.bearish .breakdown-count {
    color: #ef4444;
}

.breakdown-item.neutral .breakdown-count {
    color: #6b7280;
}

.breakdown-label {
    display: block;
    font-size: 14px;
    color: #6b7280;
}

/* Intervals Table */
.intervals-table {
    width: 100%;
    border-collapse: collapse;
}

.intervals-table th,
.intervals-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.intervals-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.analysis-error {
    padding: 20px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    text-align: center;
}

/* Analysis Toolbar */
.analysis-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.toolbar-left {
    display: flex;
    align-items: center;
}

.selected-count {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-analysis {
    padding: 8px 16px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-analysis:hover {
    background: #f0f4ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.3);
    border-radius: 12px;
    transition: background 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #10b981;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    color: white;
    font-weight: 500;
    font-size: 13px;
}

/* Current Price Column Styles */
.current-price-cell {
    padding: 8px !important;
}

.price-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.price-value {
    font-size: 14px;
    font-weight: 600;
}

.price-change {
    font-size: 11px;
    font-weight: 500;
}

.price-up {
    color: #10b981;
}

.price-up .price-change {
    color: #10b981;
}

.price-down {
    color: #ef4444;
}

.price-down .price-change {
    color: #ef4444;
}

.price-loading {
    color: #6b7280;
    font-size: 12px;
}

.price-flash {
    animation: priceFlash 0.5s ease-in-out;
}

@keyframes priceFlash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(59, 130, 246, 0.1); }
}


/* Confidence Badges */
.confidence-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 60px;
}

.confidence-high {
    background: #d1fae5;
    color: #065f46;
}

.confidence-medium {
    background: #fef3c7;
    color: #92400e;
}

.confidence-low {
    background: #fee2e2;
    color: #991b1b;
}

.confidence-pending {
    background: #e5e7eb;
    color: #6b7280;
}


/* Trade Plan Modal - Compact & Clean */
.modal-content .form-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.modal-content .form-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.modal-content .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 0;
}

.modal-content .form-group {
    margin-bottom: 0;
}

.modal-content .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

.modal-content .form-group input,
.modal-content .form-group select,
.modal-content .form-group textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.modal-content .form-group input:focus,
.modal-content .form-group select:focus,
.modal-content .form-group textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.modal-content .form-group small {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

.modal-content .help-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background: #7c3aed;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    cursor: help;
    margin-left: 4px;
}

.modal-content .btn-ai-suggest {
    margin-top: 5px;
    padding: 6px 12px;
    font-size: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-content .btn-ai-suggest:hover {
    transform: translateY(-1px);
}

.modal-content .radio-group {
    display: flex;
    gap: 15px;
}

.modal-content .radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    cursor: pointer;
}


/* Table Header Help Icons */
.planning-table thead th {
    position: relative;
}

.planning-table thead th .help-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    background: #7c3aed;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
    transition: all 0.2s;
}

.planning-table thead th .help-icon:hover {
    background: #6d28d9;
    transform: scale(1.1);
}

/* Multi-line tooltips */
.planning-table thead th .help-icon[title] {
    white-space: pre-line;
}

/* Signal Display Styles */
.signal-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
}

.signal-main {
    font-weight: 600;
    font-size: 12px;
}

.signal-counts {
    color: #666;
    font-size: 10px;
}

.signal-trend {
    font-size: 14px;
}

.signal-strong-buy .signal-main {
    color: #10b981;
}

.signal-buy .signal-main {
    color: #34d399;
}

.signal-neutral .signal-main {
    color: #f59e0b;
}

.signal-sell .signal-main {
    color: #f87171;
}

.signal-strong-sell .signal-main {
    color: #ef4444;
}

.signal-pending {
    color: #9ca3af;
    font-size: 11px;
}

.signal-cell {
    min-width: 120px;
}

/* Signal Details Modal */
.signal-details-modal {
    max-width: 800px;
    margin: 0 auto;
}

.signal-summary-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item .label {
    font-weight: 600;
    color: #666;
}

.summary-item .value {
    font-weight: 700;
}

.signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.signal-card {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: white;
}

.signal-card.signal-strong-buy,
.signal-card.signal-buy {
    border-color: #10b981;
    background: #f0fdf4;
}

.signal-card.signal-sell,
.signal-card.signal-strong-sell {
    border-color: #ef4444;
    background: #fef2f2;
}

.signal-card.signal-neutral {
    border-color: #f59e0b;
    background: #fffbeb;
}

.signal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.signal-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.1);
}

.signal-card-body {
    font-size: 12px;
}

.signal-strength {
    font-weight: 600;
    margin-bottom: 5px;
    color: #666;
}

.signal-reason {
    color: #444;
    line-height: 1.4;
}

.signal-metadata {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    color: #666;
}

/* Signal Charts Section */
.signal-charts-section {
    margin-top: 30px;
}

.signal-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.signal-chart-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.chart-header h4 {
    margin: 0;
    font-size: 18px;
}

.chart-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    color: #666;
}

/* Trade Plan Tabs (Portfolio-style) */
.trade-plan-tabs-row {
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
    margin-bottom: 20px;
}

.trade-plan-tabs {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.trade-plan-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}

.trade-plan-tab:hover {
    color: #3b82f6;
    background: #f3f4f6;
    border-radius: 6px 6px 0 0;
}

.trade-plan-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 600;
}

/* Tab Content */
.trade-plan-tab-content {
    margin-top: 20px;
}

.trade-plan-pane {
    display: none;
}

.trade-plan-pane.active {
    display: block;
}

/* Trade Plan Section Styles */
.trade-plan-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.trade-plan-section .section-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.trade-plan-section .section-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
}

.section-icon {
    margin-right: 8px;
}

/* Performance Metrics */
.performance-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.metric-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

/* Button loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

.btn-loading {
    animation: pulse 1.5s ease-in-out infinite;
    pointer-events: none;
    position: relative;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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