/*
 * Smart Discovery Dashboard Styles
 * TradePro Portfolio Manager - Automated Stock Screening
 */

/* Main Layout */
.smart-discovery-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

/* Live Status Bar */
.live-status-bar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: var(--shadow-lg);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-icon {
    font-size: 1.2rem;
}

.status-text {
    font-weight: 500;
    font-size: 0.95rem;
}

.status-controls {
    display: flex;
    gap: 1rem;
}

.status-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.status-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.status-btn .icon {
    font-size: 1rem;
}

.status-btn .text {
    font-size: 0.9rem;
}

/* Strategy Dashboard */
.strategy-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.strategy-card {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.strategy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Strategy Card Variants */
.can-slim-card {
    border-left: 6px solid var(--primary-color);
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(26, 115, 232, 0.02) 100%);
}

.accumulation-card {
    border-left: 6px solid var(--success-color);
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(52, 168, 83, 0.02) 100%);
}

.breakout-card {
    border-left: 6px solid var(--warning-color);
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(251, 188, 4, 0.02) 100%);
}

/* Strategy Header */
.strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.strategy-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.strategy-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(52, 168, 83, 0.1);
    border: 1px solid rgba(52, 168, 83, 0.3);
    border-radius: 20px;
    color: var(--success-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Strategy Description */
.strategy-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Strategy Metrics */
.strategy-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 12px;
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Strategy Results */
.strategy-results {
    min-height: 200px;
    margin-bottom: 1.5rem;
    background: var(--background-color);
    border-radius: 12px;
    padding: 1rem;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 180px;
    gap: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

/* Stock Results */
.stock-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.stock-item:hover {
    background: rgba(var(--primary-color-rgb), 0.05);
    border-color: var(--primary-color);
}

.stock-info {
    flex: 1;
}

.stock-symbol {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.stock-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stock-metrics {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stock-metric {
    text-align: center;
}

.stock-metric-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.stock-metric-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-actions {
    display: flex;
    gap: 0.5rem;
}

.stock-action-btn {
    padding: 0.5rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.stock-action-btn:hover {
    background: var(--primary-background);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Strategy Actions */
.strategy-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.strategy-btn {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-decoration: none;
    border: none;
    font-size: 0.9rem;
}

.strategy-btn.primary {
    background: var(--primary-color);
    color: white;
}

.strategy-btn.primary:hover {
    background: rgba(var(--primary-color-rgb), 0.9);
    transform: translateY(-1px);
}

.strategy-btn.secondary {
    background: var(--background-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.strategy-btn.secondary:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
    border-color: var(--primary-color);
}

.strategy-btn.accent {
    background: var(--success-color);
    color: white;
}

.strategy-btn.accent:hover {
    background: rgba(52, 168, 83, 0.9);
    transform: translateY(-1px);
}

.strategy-btn .icon {
    font-size: 1rem;
}

.strategy-btn .text {
    font-size: 0.9rem;
}

/* Market Overview */
.market-overview {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.market-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.market-stat-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.market-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2rem;
    background: var(--primary-background);
    padding: 0.75rem;
    border-radius: 12px;
    color: var(--primary-color);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Discovery History */
.discovery-history {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.history-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.history-controls select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.history-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-left: auto;
}

.history-btn:hover {
    background: rgba(var(--primary-color-rgb), 0.9);
    transform: translateY(-1px);
}

.history-timeline {
    min-height: 300px;
    background: var(--background-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.timeline-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 260px;
    gap: 1rem;
}

/* Header Navigation */
.header-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.header-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-nav-btn .icon {
    font-size: 1.1rem;
}

.header-nav-btn .text {
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .strategy-dashboard {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .smart-discovery-main {
        padding: 1rem;
    }
    
    .live-status-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .strategy-card {
        padding: 1.5rem;
    }
    
    .strategy-metrics {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .strategy-actions {
        flex-direction: column;
    }
    
    .strategy-btn {
        min-width: auto;
    }
    
    .market-stats {
        grid-template-columns: 1fr;
    }
    
    .history-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .history-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    .header-nav-btn .text {
        display: none;
    }
    
    .header-nav-btn {
        padding: 0.75rem;
        min-width: 48px;
        justify-content: center;
    }
    
    .status-btn .text {
        display: none;
    }
    
    .status-btn {
        padding: 0.75rem;
        min-width: 48px;
        justify-content: center;
    }
}

/* Dark Theme Adjustments */
[data-theme="dark"] .strategy-card {
    background: rgba(30, 30, 30, 0.8);
    border-color: var(--border-color);
}

[data-theme="dark"] .can-slim-card {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.8) 0%, rgba(26, 115, 232, 0.05) 100%);
}

[data-theme="dark"] .accumulation-card {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.8) 0%, rgba(52, 168, 83, 0.05) 100%);
}

[data-theme="dark"] .breakout-card {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.8) 0%, rgba(251, 188, 4, 0.05) 100%);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

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

/* Success States */
.success-state {
    color: var(--success-color);
    font-weight: 600;
}

.warning-state {
    color: var(--warning-color);
    font-weight: 600;
}

.error-state {
    color: var(--error-color);
    font-weight: 600;
}

/* Live Status States */
.live-active {
    color: #4CAF50;
    font-weight: 600;
    animation: pulse-live 2s infinite;
}

.mock-active {
    color: #FFC107;
    font-weight: 600;
}

.api-data-mode {
    color: #2196F3;
    font-weight: 600;
    animation: pulse-api 3s infinite;
}

.warning-state {
    color: #FF9800;
    font-weight: 600;
}

@keyframes pulse-live {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

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

/* Loading States */
.shimmer {
    background: linear-gradient(90deg, 
        var(--background-color) 25%, 
        rgba(var(--primary-color-rgb), 0.1) 50%, 
        var(--background-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Phase 7.3.5: Live Breakout Alerts Panel */
.live-breakouts-section {
    margin: 2rem 0;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.breakout-alerts-container {
    padding: 1.5rem;
}

.alert-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.control-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-background);
    color: var(--text-color);
    font-size: 0.875rem;
    min-width: 140px;
}

.alert-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-btn:hover {
    background: var(--secondary-color-dark);
    transform: translateY(-1px);
}

.alert-btn .icon {
    font-size: 1rem;
}

.breakouts-feed {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
}

.no-alerts-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.no-alerts-placeholder h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.no-alerts-placeholder p {
    margin-bottom: 1.5rem;
    max-width: 400px;
    line-height: 1.5;
}

.monitoring-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    justify-content: center;
}

.monitoring-stats .stat {
    font-weight: 500;
}

.monitoring-stats .separator {
    color: var(--border-color);
}

/* Live Breakout Alert Items */
.breakout-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
    animation: slideInFromTop 0.3s ease-out;
}

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

.breakout-alert-item:hover {
    background: rgba(var(--primary-color-rgb), 0.05);
}

.breakout-alert-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.breakout-symbol {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    min-width: 60px;
}

.breakout-name {
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breakout-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breakout-price {
    font-weight: 600;
    color: var(--success-color);
}

.breakout-pattern {
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.breakout-confidence {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confidence-badge {
    background: linear-gradient(135deg, var(--success-color), #45a049);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.confidence-badge.medium {
    background: linear-gradient(135deg, var(--warning-color), #f57c00);
}

.confidence-badge.high {
    background: linear-gradient(135deg, var(--success-color), #2e7d32);
}

.breakout-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.breakout-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breakout-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.breakout-action-btn:hover {
    background: var(--secondary-color-dark);
    transform: translateY(-1px);
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Status Indicators */
.enhanced-realtime .status-item {
    position: relative;
}

.enhanced-realtime .connection-quality {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.quality-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--error-color);
}

.quality-indicator.good {
    background: var(--warning-color);
}

.quality-indicator.excellent {
    background: var(--success-color);
    animation: pulse-quality 2s infinite;
}

@keyframes pulse-quality {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.update-frequency {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.universe-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

/* Real-time Stock Item Enhancements */
.stock-item.real-time {
    position: relative;
    border-left: 3px solid var(--success-color);
}

.live-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 8px;
    height: 8px;
    background: var(--error-color);
    border-radius: 50%;
}

.live-indicator.pulse {
    animation: pulse-indicator 1.5s infinite;
}

@keyframes pulse-indicator {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Responsive Design for Breakout Alerts */
@media (max-width: 768px) {
    .alert-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-select, .alert-btn {
        width: 100%;
        justify-content: center;
    }
    
    .breakout-alert-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .breakout-details {
        flex-wrap: wrap;
    }
    
    .breakout-actions {
        align-self: flex-end;
    }
}