/**
 * Live Market Pattern Recognition Dashboard Styles
 * Revolutionary pattern analysis visualization
 */

.live-pattern-dashboard {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 16px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.live-pattern-dashboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    animation: patternPulse 3s ease-in-out infinite;
}

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

/* Dashboard Header */
.pattern-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
}

.pattern-dashboard-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pattern-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.performance-indicator {
    font-size: 0.9em;
    color: #a0a0a0;
    font-family: 'Courier New', monospace;
}

/* Pattern Filters */
.pattern-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    flex-wrap: wrap;
}

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

.filter-group label {
    font-size: 0.9em;
    color: #b0b0b0;
    font-weight: 500;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.9em;
    min-width: 150px;
}

.filter-group select:focus {
    outline: none;
    border-color: #4ecdc4;
    box-shadow: 0 0 8px rgba(78, 205, 196, 0.3);
}

/* Symbol Cards Grid */
.pattern-symbols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.pattern-symbol-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pattern-symbol-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(78, 205, 196, 0.5);
}

.pattern-symbol-card.error-state {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 107, 107, 0.05));
}

/* Symbol Header */
.symbol-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.symbol-name {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    color: #ffffff;
}

.remove-symbol {
    background: rgba(255, 107, 107, 0.2);
    border: none;
    color: #ff6b6b;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-symbol:hover {
    background: rgba(255, 107, 107, 0.4);
    transform: scale(1.1);
}

/* Pattern Overview */
.pattern-overview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.overall-rating {
    text-align: center;
}

.rating-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 8px;
    border: 3px solid;
    transition: all 0.3s ease;
}

.rating-circle.excellent {
    background: linear-gradient(135deg, #2ecc40, #27ae60);
    border-color: #2ecc40;
    color: white;
    box-shadow: 0 0 20px rgba(46, 204, 64, 0.4);
}

.rating-circle.good {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    border-color: #4ecdc4;
    color: white;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.4);
}

.rating-circle.fair {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-color: #f39c12;
    color: white;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.4);
}

.rating-circle.poor {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
    color: white;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.4);
}

.rating-circle.very-poor {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    border-color: #8e44ad;
    color: white;
    box-shadow: 0 0 20px rgba(142, 68, 173, 0.4);
}

.rating-label {
    font-size: 0.8em;
    color: #b0b0b0;
}

.recommendation-section {
    text-align: center;
}

.recommendation-action {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

.recommendation-action.strong_buy {
    background: linear-gradient(135deg, #2ecc40, #27ae60);
    color: white;
}

.recommendation-action.buy {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    color: white;
}

.recommendation-action.hold {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.recommendation-action.sell {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.recommendation-confidence {
    font-size: 0.9em;
    color: #b0b0b0;
}

/* Pattern Components */
.pattern-components {
    margin-bottom: 16px;
}

.component-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9em;
}

.component-label {
    color: #c0c0c0;
    font-weight: 500;
}

.component-value {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
}

/* Grade-based styling */
.component-value.grade-Aplus {
    background: linear-gradient(135deg, #2ecc40, #27ae60);
    color: white;
}

.component-value.grade-A {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    color: white;
}

.component-value.grade-Bplus {
    background: linear-gradient(135deg, #96ceb4, #85c8a3);
    color: white;
}

.component-value.grade-B {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.component-value.grade-Cplus,
.component-value.grade-C {
    background: linear-gradient(135deg, #ff9f43, #feca57);
    color: white;
}

.component-value.grade-D,
.component-value.grade-F {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

/* Confidence-based styling */
.component-value.confidence-high {
    background: linear-gradient(135deg, #2ecc40, #27ae60);
    color: white;
}

.component-value.confidence-medium {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.component-value.confidence-low {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

/* VWAP State styling */
.component-value.state-breakout {
    background: linear-gradient(135deg, #2ecc40, #27ae60);
    color: white;
}

.component-value.state-false_breakdown {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    color: white;
}

.component-value.state-neutral {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.component-value.state-false_breakout {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.component-value.state-breakdown {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

/* Pattern Details */
.pattern-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.9em;
}

.risk-value {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8em;
}

.size-value {
    font-weight: 600;
    color: #4ecdc4;
}

/* Pattern Timestamp */
.pattern-timestamp {
    font-size: 0.8em;
    color: #888;
    text-align: center;
}

/* Analytics Panel */
.pattern-analytics-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

.pattern-analytics-panel h3 {
    margin: 0 0 16px 0;
    color: #ffffff;
    font-size: 1.2em;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.analytics-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.analytics-card h4 {
    margin: 0 0 12px 0;
    color: #4ecdc4;
    font-size: 1em;
}

.stat-row,
.distribution-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.9em;
}

.distribution-row span:first-child {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 600;
}

/* Signal distribution styling */
.signal-strong_buy {
    background: linear-gradient(135deg, #2ecc40, #27ae60);
    color: white;
}

.signal-buy {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    color: white;
}

.signal-hold {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.signal-sell {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

/* Error Message */
.error-message {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.8em;
    margin-top: 8px;
    text-align: center;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.btn-primary {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .pattern-filters {
        flex-direction: column;
        gap: 12px;
    }
    
    .pattern-symbols-grid {
        grid-template-columns: 1fr;
    }
    
    .pattern-dashboard-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .pattern-controls {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .pattern-overview {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .live-pattern-dashboard {
        padding: 16px;
        margin: 10px 0;
    }
    
    .pattern-symbol-card {
        padding: 16px;
    }
    
    .rating-circle {
        width: 50px;
        height: 50px;
        font-size: 1em;
    }
    
    .component-row {
        font-size: 0.8em;
    }
    
    .pattern-details {
        flex-direction: column;
        gap: 8px;
    }
}

/* Animation for new cards */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pattern-symbol-card {
    animation: cardSlideIn 0.4s ease-out;
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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