/* Tradator Predictions Frontend Styles */

:root {
    --tradator-primary: #667eea;
    --tradator-secondary: #764ba2;
    --tradator-success: #4facfe;
    --tradator-danger: #fa709a;
    --tradator-warning: #43e97b;
    --tradator-light: #f8f9fa;
    --tradator-dark: #2c3e50;
    --tradator-border: #e1e5e9;
    --tradator-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --tradator-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
    --tradator-radius: 12px;
    --tradator-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container Styles */
.tradator-predictions-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Grid Layout */
.tradator-predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* List Layout */
.tradator-predictions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.tradator-predictions-list .tradator-prediction-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 20px;
}

.tradator-predictions-list .prediction-header {
    flex: 1;
    margin-bottom: 0;
}

.tradator-predictions-list .confidence-section {
    flex: 0 0 200px;
    margin: 0 20px;
}

.tradator-predictions-list .prediction-details {
    flex: 1;
    margin-bottom: 0;
}

/* Prediction Card */
.tradator-prediction-card {
    background: white;
    border-radius: var(--tradator-radius);
    box-shadow: var(--tradator-shadow);
    border: 1px solid var(--tradator-border);
    transition: var(--tradator-transition);
    overflow: hidden;
    position: relative;
}

.tradator-prediction-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tradator-shadow-hover);
}

.tradator-prediction-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--tradator-primary), var(--tradator-secondary));
    opacity: 0;
    transition: var(--tradator-transition);
}

.tradator-prediction-card:hover::before {
    opacity: 1;
}

/* Card Header */
.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 20px 16px;
    margin-bottom: 16px;
}

.symbol-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.symbol-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tradator-primary), var(--tradator-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.symbol-details {
    flex: 1;
}

.symbol-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--tradator-dark);
    margin-bottom: 4px;
}

.company-name {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.3;
}

/* Prediction Badge */
.prediction-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prediction-badge.up {
    background: linear-gradient(135deg, var(--tradator-success), #00f2fe);
}

.prediction-badge.down {
    background: linear-gradient(135deg, var(--tradator-danger), #fee140);
}

.direction-icon {
    font-size: 16px;
    font-weight: bold;
}

/* Confidence Section */
.confidence-section {
    padding: 0 20px 16px;
    margin-bottom: 16px;
}

.confidence-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.confidence-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--tradator-dark);
    margin-bottom: 8px;
}

.confidence-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tradator-primary), var(--tradator-secondary));
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.confidence-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Prediction Details */
.prediction-details {
    padding: 0 20px 16px;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.detail-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 80px;
}

.detail-value {
    color: var(--tradator-dark);
    flex: 1;
}

.detail-item.recommendation {
    flex-direction: column;
    gap: 4px;
}

.detail-item.recommendation .detail-value {
    margin-left: 28px;
    line-height: 1.4;
}

/* AI Insights */
.ai-insights-section {
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid var(--tradator-border);
    margin-bottom: 0;
}

.ai-insights-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--tradator-dark);
}

.ai-icon {
    font-size: 18px;
}

.ai-models {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.ai-model {
    text-align: center;
    padding: 8px 4px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.model-name {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.model-prediction {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 2px;
}

.model-prediction.up {
    color: var(--tradator-success);
}

.model-prediction.down {
    color: var(--tradator-danger);
}

.model-confidence {
    font-size: 11px;
    color: #6c757d;
}

.ai-consensus {
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Card Footer */
.prediction-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--tradator-border);
    background: #fafbfc;
}

.view-details-btn {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--tradator-primary), var(--tradator-secondary));
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--tradator-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.view-details-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.tradator-prediction-card.expanded .btn-icon {
    transform: rotate(180deg);
}

/* Expanded Details */
.prediction-expanded {
    padding: 20px;
    border-top: 1px solid var(--tradator-border);
    background: #fafbfc;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.expanded-section {
    margin-bottom: 20px;
}

.expanded-section:last-child {
    margin-bottom: 0;
}

.expanded-section h4 {
    color: var(--tradator-dark);
    font-size: 16px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--tradator-primary);
    padding-bottom: 4px;
    display: inline-block;
}

.expanded-section p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 12px;
}

.ai-reasoning {
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid var(--tradator-primary);
}

.ai-reasoning strong {
    color: var(--tradator-primary);
    display: block;
    margin-bottom: 6px;
}

.ai-reasoning p {
    margin-bottom: 0;
    font-size: 14px;
}

/* No Predictions State */
.tradator-no-predictions {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-predictions-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.tradator-no-predictions h3 {
    color: var(--tradator-dark);
    margin-bottom: 12px;
}

/* Pagination */
.tradator-pagination {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--tradator-border);
}

.load-more-info {
    color: #6c757d;
    margin: 0;
}

.load-more-info a {
    color: var(--tradator-primary);
    text-decoration: none;
    font-weight: 500;
}

.load-more-info a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tradator-predictions-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .tradator-predictions-list .tradator-prediction-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tradator-predictions-list .confidence-section {
        flex: none;
        margin: 16px 0;
    }
    
    .prediction-header {
        padding: 16px 16px 12px;
    }
    
    .confidence-section,
    .prediction-details {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .ai-insights-section {
        padding: 12px 16px;
    }
    
    .prediction-footer {
        padding: 12px 16px;
    }
    
    .prediction-expanded {
        padding: 16px;
    }
    
    .symbol-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .symbol-name {
        font-size: 16px;
    }
    
    .confidence-value {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .tradator-predictions-container {
        margin: 16px 0;
    }
    
    .ai-models {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .prediction-badge {
        padding: 6px 12px;
        font-size: 12px;
    }
}
