/* Intraday Picks Floating Widget Styles */

.picks-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Toggle Button (Chat Icon Style) */
.picks-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.picks-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.picks-toggle i {
    font-size: 24px;
    color: white;
}

.picks-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid white;
}

.picks-label {
    display: none;
}

/* List Panel (Slides up from bottom-left) */
.picks-list-panel {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 350px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(600px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.picks-widget:not(.collapsed) .picks-list-panel {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.picks-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

.picks-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

/* Auto-trade button */
.picks-auto-trade-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.picks-auto-trade-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.picks-auto-trade-btn.active {
    background: #10b981;
    border-color: #059669;
    animation: pulse 2s ease-in-out infinite;
}

.picks-auto-trade-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.picks-refresh {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.picks-refresh:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

.picks-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 8px;
}

.picks-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.picks-filters {
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.picks-filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.picks-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    max-height: 400px;
}

.picks-loading {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.picks-loading i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.picks-empty, .picks-error {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.picks-empty i, .picks-error i {
    font-size: 36px;
    margin-bottom: 15px;
    display: block;
    color: #d1d5db;
}

.picks-empty p, .picks-error p {
    font-size: 16px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 8px;
}

.picks-empty small {
    font-size: 13px;
    color: #9ca3af;
}

.pick-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.pick-item:hover {
    background: white;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

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

.pick-symbol {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.pick-signal {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

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

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

.pick-signal.HOLD {
    background: #fef3c7;
    color: #92400e;
}

.pick-metrics {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.pick-metric {
    font-size: 12px;
    color: #64748b;
}

.pick-metric strong {
    color: #1e293b;
    display: block;
    font-size: 14px;
}

.pick-recommendation {
    margin-top: 8px;
    font-size: 12px;
    color: #475569;
    font-style: italic;
}

/* Detail Panel (Appears next to list, chat-style) */
.picks-detail-panel {
    position: fixed;
    top: 0;
    left: 390px; /* Right next to list panel (350px + 40px gap) */
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 0; /* Full height = no border radius on top/bottom */
    transform: translateX(-100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    /* Prevent overlap with main content - ensure it doesn't extend beyond viewport */
    max-width: calc(100vw - 390px - 50px); /* Left position + margin */
    max-height: 100vh;
    overflow-y: auto;
}

.picks-widget.detail-open .picks-detail-panel {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
}

.picks-detail-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.picks-detail-header h4 {
    flex: 1;
    margin: 0;
    font-size: 18px;
    color: white;
}

.picks-back {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.picks-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.picks-detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.detail-loading {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h5 {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.detail-price-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
    margin-bottom: 20px;
}

.detail-price {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-change {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-change.positive {
    color: #86efac;
}

.detail-change.negative {
    color: #fca5a5;
}

.detail-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}

.detail-stat {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.detail-stat-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.detail-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.detail-recommendation-box {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.detail-recommendation-box strong {
    color: #1e40af;
    display: block;
    margin-bottom: 8px;
}

.detail-action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.detail-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-btn-primary {
    background: #667eea;
    color: white;
}

.detail-btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.detail-btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.detail-btn-secondary:hover {
    background: #f0f4ff;
}

/* Responsive */
@media (max-width: 1200px) {
    .picks-detail-panel {
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
    }
}

@media (max-width: 768px) {
    .picks-list-panel {
        width: 90vw;
        max-width: 350px;
    }
    
    .picks-detail-panel {
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
    }
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.pick-item {
    animation: slideInUp 0.3s ease;
}

.detail-section {
    animation: slideInRight 0.3s ease;
}

/* Scrollbar styling */
.picks-list::-webkit-scrollbar,
.picks-detail-content::-webkit-scrollbar {
    width: 6px;
}

.picks-list::-webkit-scrollbar-track,
.picks-detail-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.picks-list::-webkit-scrollbar-thumb,
.picks-detail-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.picks-list::-webkit-scrollbar-thumb:hover,
.picks-detail-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =================================================================
   CHART PANEL - Slide Up Overlay
   ================================================================= */
.picks-chart-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 80vh;
    background: #f8fafc;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.picks-widget.chart-open .picks-chart-panel {
    transform: translateY(0);
    opacity: 1;
}

.chart-panel-header {
    padding: 12px 20px; /* Reduced from 20px 30px */
    background: white;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-title h4 {
    margin: 0 0 2px 0; /* Reduced from 5px */
    font-size: 16px; /* Reduced from 18px */
    color: #1e293b;
}

.chart-price {
    font-size: 20px; /* Reduced from 24px */
    font-weight: bold;
    color: #10b981;
}

.chart-controls {
    display: flex;
    gap: 8px; /* Reduced from 10px */
    align-items: center;
}

.chart-control-select {
    padding: 6px 12px; /* Reduced from 8px 15px */
    border: 1px solid #e5e7eb;
    border-radius: 6px; /* Reduced from 8px */
    font-size: 13px; /* Reduced from 14px */
    cursor: pointer;
    background: white;
    transition: all 0.2s;
}

.chart-control-select:hover {
    border-color: #3b82f6;
}

.chart-btn {
    padding: 6px 16px; /* Reduced from 8px 20px */
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px; /* Reduced from 8px */
    font-size: 13px; /* Reduced from 14px */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.chart-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chart-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.chart-panel-content {
    flex: 1;
    padding: 12px 20px; /* Reduced from 20px */
    overflow: hidden;
}

.trading-chart-container {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 8px; /* Reduced from 12px */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); /* Reduced shadow */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chart-loading {
    text-align: center;
    color: #9ca3af;
}

.chart-loading i {
    font-size: 36px; /* Reduced from 48px */
    margin-bottom: 12px; /* Reduced from 15px */
    display: block;
}

/* =================================================================
   ORDER PLACEMENT PANEL - Mobile-like Compact Design
   ================================================================= */
.picks-order-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 380px; /* Slightly smaller than chat details panel (400px) */
    max-width: 90vw; /* Responsive max width */
    height: 80vh; /* Fixed height to prevent scrolling */
    max-height: 80vh; /* Prevent overflow */
    background: white;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 20px 20px 0 0;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1003;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.picks-widget.order-open .picks-order-panel {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Backdrop overlay for slide-up panels */
.picks-widget.order-open::before,
.picks-widget.chart-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1001;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
    cursor: pointer;
}

.picks-widget.order-open::before {
    z-index: 1002; /* Behind order panel */
}

.picks-widget.chart-open::before {
    z-index: 1001; /* Behind chart panel */
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Drag handle for slide-up panels */
.picks-chart-panel::before,
.picks-order-panel::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    z-index: 1004;
}

.picks-chart-panel::before {
    top: 8px;
}

.picks-order-panel::before {
    top: 8px;
}

.order-panel-header {
    padding: 15px 20px; /* Reduced from 20px 25px */
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.order-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.order-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.order-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px; /* Reduced from 25px */
}

.order-tabs {
    display: flex;
    gap: 8px; /* Reduced from 10px */
    margin-bottom: 15px; /* Reduced from 25px */
}

.order-tab {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.order-tab.active[data-type="BUY"] {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.order-tab.active[data-type="SELL"] {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.order-tab:not(.active):hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.order-form-group {
    margin-bottom: 15px; /* Reduced from 20px */
}

.order-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.order-input,
.order-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.order-input:focus,
.order-select:focus {
    outline: none;
    border-color: #3b82f6;
    background: #eff6ff;
}

.order-summary {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px; /* Reduced from 20px */
    margin: 15px 0; /* Reduced from 25px 0 */
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-summary-row:last-child {
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 2px solid #e5e7eb;
}

.order-summary-row span {
    color: #64748b;
    font-size: 14px;
}

.order-summary-row strong {
    color: #1e293b;
    font-size: 16px;
}

.order-submit-btn {
    width: 100%;
    padding: 12px; /* Reduced from 15px */
    border: none;
    border-radius: 10px;
    font-size: 14px; /* Reduced from 16px */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* Reduced from 8px */
}

.order-submit-btn[data-type="BUY"],
.order-submit-btn:not([data-type]) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.order-submit-btn[data-type="SELL"] {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.order-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.order-submit-btn:active {
    transform: translateY(0);
}

/* Desktop - Keep detail panel side-by-side, but slide-up for chart/order */
@media (min-width: 1200px) {
    .picks-detail-panel {
        /* Detail panel stays side-by-side on desktop */
        max-width: min(400px, calc(100vw - 400px));
    }
    
    /* Chart and Order panels remain slide-up overlays on desktop */
    .picks-chart-panel {
        /* Already set as slide-up overlay */
        height: 80vh;
    }
    
    .picks-order-panel {
        /* Already set as slide-up overlay */
        height: 50vh; /* Updated to match compact design */
    }
}

/* Responsive for Chart and Order Panels */
@media (max-width: 1600px) {
    /* Reduce panel widths when space is limited (e.g., DevTools open) */
    .picks-list-panel {
        width: 300px;
    }
    
    .picks-detail-panel {
        left: 320px;
        width: 350px;
        max-width: calc(100vw - 320px - 50px); /* Don't overlap main content */
    }
    
    .picks-order-panel {
        left: 670px; /* 320px + 350px */
        width: 350px;
        max-width: calc(100vw - 670px - 50px); /* Don't overlap main content */
    }
    
    .picks-chart-panel {
        left: 670px;
    }
}

@media (max-width: 1400px) {
    /* Further reduce widths for narrower viewports */
    .picks-list-panel {
        width: 280px;
    }
    
    .picks-detail-panel {
        left: 300px;
        width: 320px;
        max-width: calc(100vw - 300px - 50px); /* Don't overlap main content */
    }
    
    .picks-order-panel {
        left: 620px; /* 300px + 320px */
        width: 320px;
        max-width: calc(100vw - 620px - 50px); /* Don't overlap main content */
    }
    
    .picks-chart-panel {
        left: 620px;
    }
}

@media (max-width: 1200px) {
    /* Stack panels when too narrow - make detail panel modal */
    .picks-list-panel {
        width: 280px;
    }
    
    .picks-detail-panel {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        width: 90vw;
        max-width: 500px;
        height: auto;
        max-height: 90vh;
        border-radius: 12px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }
    
    .picks-widget.detail-open .picks-detail-panel {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: all;
    }
    
    .picks-chart-panel {
        left: 0;
        width: 100%;
    }
    
    .picks-order-panel {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    /* Mobile - full width panels */
    .picks-list-panel {
        width: 90vw;
        max-width: 350px;
    }
    
    .picks-detail-panel {
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        transform: translateX(-100%);
        border-radius: 0;
        max-width: none;
        max-height: none;
    }
    
    .picks-widget.detail-open .picks-detail-panel {
        transform: translateX(0);
        opacity: 1;
        pointer-events: all;
    }
    
    .picks-order-panel {
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
    }
    
    .chart-panel-header {
        padding: 10px 15px; /* More compact for mobile */
    }
    
    .order-panel-content {
        padding: 15px 20px; /* Reduced padding for mobile */
    }
}

