/* Analytics Cards Component Library */
/* Reusable card definitions for background decorations */

/* Base Analytics Card Structure */
.analytics-card {
    position: absolute;
    background: white !important;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    opacity: 0.25;
    border: 1px solid rgba(229, 231, 235, 0.5);
    transition: opacity 0.3s ease;
    padding: 6px;
    overflow: hidden;
    pointer-events: none;
    z-index: inherit;
}

.analytics-card .card-inner {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a1a;
}

/* Card Header */
.analytics-card .card-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    gap: 8px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    background: rgba(249, 250, 251, 0.5);
    position: relative;
}

/* Certification Stamp - Upper Right Corner - Using Transparent PNG */
.analytics-card .card-certified {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 50px;
    height: 50px;
    background: url('../graphics/accuracy_transparent.png') no-repeat center;
    background-size: contain;
    transform: rotate(22deg);
    cursor: pointer;
    z-index: 10;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));
}

.analytics-card .card-badge {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 10px;
    color: white;
    flex-shrink: 0;
}

/* Badge Color Variants */
.badge-orange { background: linear-gradient(135deg, #FF7B00, #FFA500); }
.badge-blue { background: linear-gradient(135deg, #87CEEB, #4A90E2); }
.badge-green { background: linear-gradient(135deg, #10B981, #059669); }
.badge-purple { background: linear-gradient(135deg, #8B5CF6, #6366F1); }
.badge-yellow { background: linear-gradient(135deg, #F59E0B, #F97316); }
.badge-red { background: linear-gradient(135deg, #EF4444, #DC2626); }
.badge-indigo { background: linear-gradient(135deg, #6366F1, #4F46E5); }
.badge-pink { background: linear-gradient(135deg, #EC4899, #DB2777); }
.badge-teal { background: linear-gradient(135deg, #14B8A6, #0D9488); }
.badge-gray { background: linear-gradient(135deg, #6B7280, #4B5563); }

.analytics-card .card-info {
    flex: 1;
    min-width: 0;
}

.analytics-card .card-title {
    font-size: 11px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analytics-card .card-subtitle {
    font-size: 9px;
    color: #6b7280;
    margin-top: 1px;
}

/* Card Content */
.analytics-card .card-content {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Card Footer */
.analytics-card .card-footer {
    padding: 6px 10px;
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    gap: 6px;
    background: rgba(249, 250, 251, 0.3);
}

.analytics-card .footer-tag {
    padding: 3px 8px;
    background: rgba(255, 123, 0, 0.1);
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    color: #FF7B00;
    flex: 1;
    text-align: center;
}

/* CARD TYPE 1: Overview Cards - Executive Summary Style */
.analytics-card .metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
}

.analytics-card .metric-item {
    background: rgba(249, 250, 251, 0.5);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(229, 231, 235, 0.3);
    text-align: center;
}

.analytics-card .metric-value {
    font-size: 18px;
    font-weight: 700;
    color: #FF7B00;
    margin-bottom: 4px;
}

.analytics-card .metric-label {
    font-size: 9px;
    color: #6b7280;
    text-transform: uppercase;
}

/* CARD TYPE 2: Plot Cards - Data Visualization */
.analytics-card .plot-area {
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: linear-gradient(45deg, rgba(255,123,0,0.05) 0%, rgba(135,206,235,0.05) 100%);
    border-radius: 6px;
    position: relative;
    border: 1px solid rgba(229, 231, 235, 0.2);
}

.analytics-card .scatter-point {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #87CEEB;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.analytics-card .trend-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #FF7B00;
    top: 50%;
    transform: rotate(-10deg);
    opacity: 0.5;
}

.analytics-card .line-chart {
    position: absolute;
    width: 80%;
    height: 2px;
    background: #FF7B00;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
}

.analytics-card .confidence-band {
    position: absolute;
    width: 80%;
    height: 40px;
    background: rgba(255, 123, 0, 0.1);
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
}

/* CARD TYPE 3: Table Cards - Data Tables */
.analytics-card .data-table {
    width: 100%;
    font-size: 10px;
}

.analytics-card .table-header {
    display: flex;
    padding: 6px;
    background: rgba(249, 250, 251, 0.8);
    font-weight: 600;
    border-bottom: 2px solid rgba(229, 231, 235, 0.5);
    gap: 10px;
}

.analytics-card .table-row {
    display: flex;
    padding: 5px 6px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.3);
    gap: 10px;
}

.analytics-card .table-row span:first-child {
    flex: 2;
}

.analytics-card .table-row span {
    flex: 1;
}

.analytics-card .sig-high {
    color: #10B981;
    font-weight: 700;
}

.analytics-card .sig-med {
    color: #F59E0B;
    font-weight: 700;
}

/* CARD TYPE 4: Metric Cards - Single Value Display */
.analytics-card .single-metric {
    text-align: center;
}

.analytics-card .big-value {
    font-size: 32px;
    font-weight: 800;
    color: #FF7B00;
    margin-bottom: 8px;
}

/* CARD TYPE 5: Histogram Cards - Bar Charts */
.analytics-card .histogram {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    width: 100%;
    height: 100px;
    padding: 10px;
    gap: 8px;
}

.analytics-card .bar {
    flex: 1;
    background: linear-gradient(to top, #FF7B00, #FFA500);
    border-radius: 2px 2px 0 0;
    opacity: 0.7;
}

/* CARD TYPE 6: Heatmap Cards - Correlation Matrix */
.analytics-card .heatmap-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 100%;
    padding: 10px;
}

.analytics-card .heat-cell {
    aspect-ratio: 1;
    border-radius: 4px;
}

.analytics-card .heat-high {
    background: rgba(255, 123, 0, 0.6);
}

.analytics-card .heat-med {
    background: rgba(255, 123, 0, 0.3);
}

.analytics-card .heat-low {
    background: rgba(135, 206, 235, 0.2);
}

/* CARD TYPE 7: Performance Cards - Status Lists */
.analytics-card .performance-list {
    width: 100%;
}

.analytics-card .perf-item {
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.analytics-card .perf-item.good {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid #10B981;
    color: #059669;
}

.analytics-card .perf-item.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #F59E0B;
    color: #D97706;
}

/* CARD TYPE 8: Compact Table */
.analytics-card .data-table.compact .table-row {
    padding: 8px;
    background: rgba(249, 250, 251, 0.4);
    margin-bottom: 4px;
    border-radius: 4px;
    border-bottom: none;
}

/* Card Size Presets */
.card-size-overview { width: 360px; height: 480px; } /* Portrait 3:4 */
.card-size-plot { width: 540px; height: 400px; } /* Landscape large */
.card-size-table { width: 630px; height: 240px; } /* Wide format */
.card-size-compact { width: 320px; height: 320px; } /* Square */
.card-size-landscape { width: 480px; height: 320px; } /* Landscape 3:2 */
.card-size-metric-lg { width: 280px; height: 200px; } /* Metric large */
.card-size-metric-sm { width: 200px; height: 150px; } /* Metric small */
.card-size-full { width: 420px; height: 280px; } /* Full card */

/* Responsive adjustments */
@media (max-width: 768px) {
    .analytics-card {
        opacity: 0.15;
        transform: scale(0.7);
    }
    
    /* Hide overflow cards on mobile */
    .card-position-faq-4,
    .card-position-faq-5,
    .card-position-faq-6,
    .card-position-faq-7,
    .card-position-faq-8,
    .card-position-faq-9,
    .card-position-faq-10 {
        display: none;
    }
}