/* ============================================
   MCP Analytics Website - Card Styles
   Inspired by card-library.css
   ============================================ */

/* ============================================
   CARD BASE STRUCTURE
   ============================================ */
.card-wrapper {
    display: flex;
    gap: 60px;
    align-items: stretch;
    margin: 30px 0;
}

.card-container {
    width: 100%;
    max-width: 400px;
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.2);
}

.card {
    width: 100%;
    height: 100%;
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.card-inner {
    flex: 1;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    overflow: hidden;
}

/* ============================================
   CARD HEADER
   ============================================ */
.card-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
}

.card-badge {
    width: 48px;
    height: 48px;
    background: var(--primary-orange);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

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

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.2;
}

.card-metric {
    text-align: right;
    flex-shrink: 0;
}

.metric-value {
    font-family: 'Geist Mono', monospace;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-orange);
    line-height: 1;
}

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

/* ============================================
   CARD CONTENT
   ============================================ */
.card-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

.card-content::-webkit-scrollbar {
    width: 8px;
}

.card-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.card-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.card-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ============================================
   CARD FOOTER
   ============================================ */
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 8px;
    background: var(--bg-white);
}

.footer-badge {
    padding: 6px 12px;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-badge.primary {
    background: var(--primary-orange);
    color: white;
}

.footer-badge.accent {
    background: var(--accent-blue);
    color: var(--text-primary);
}

/* ============================================
   SPECIALIZED CARD TYPES
   ============================================ */

/* Overview Card */
.card-type-overview .card-visual {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: var(--bg-light);
    border-radius: 12px;
    margin-bottom: 20px;
}

.card-type-overview .metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.metric-item {
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    text-align: center;
}

.metric-item-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-orange);
    font-family: 'Geist Mono', monospace;
}

.metric-item-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 4px;
}

/* Plot Card */
.card-type-plot .plot-container {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-type-plot .plot-stats {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.plot-stat {
    padding: 8px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    text-align: center;
}

.plot-stat-value {
    font-family: 'Geist Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-orange);
}

.plot-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 2px;
}

/* Table Card */
.card-type-table .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.card-type-table .data-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 10;
}

.card-type-table .data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-light);
    background: var(--bg-light);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.card-type-table .data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.card-type-table .data-table tbody tr:hover {
    background: var(--bg-light);
}

/* Summary Card */
.card-type-summary .summary-section {
    margin-bottom: 24px;
}

.summary-heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-orange);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-heading::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--primary-orange);
    border-radius: 2px;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.summary-list li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--accent-blue);
    font-weight: 700;
}

/* ============================================
   CARD INSIGHTS PANEL
   ============================================ */
.insights-panel {
    width: 350px;
    background: var(--bg-dark);
    border-radius: 16px;
    padding: 8px;
    color: white;
    display: flex;
    flex-direction: column;
}

.insights-inner {
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.02);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.insights-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.insights-badge {
    width: 40px;
    height: 40px;
    background: var(--primary-orange);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: white;
}

.insights-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.insights-subtitle {
    font-size: 13px;
    color: var(--primary-orange);
    margin-top: 2px;
}

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

.insight-section {
    margin-bottom: 24px;
}

.insight-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-section h3::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary-orange);
    border-radius: 2px;
}

.insight-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insight-list li {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    padding-left: 20px;
    position: relative;
}

.insight-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-orange);
    font-weight: 700;
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-container {
    animation: cardSlideIn 0.5s ease-out;
}

/* Stagger animation for multiple cards */
.card-container:nth-child(1) { animation-delay: 0.1s; }
.card-container:nth-child(2) { animation-delay: 0.2s; }
.card-container:nth-child(3) { animation-delay: 0.3s; }
.card-container:nth-child(4) { animation-delay: 0.4s; }

/* ============================================
   CARD GRID LAYOUTS
   ============================================ */
.cards-grid {
    display: grid;
    gap: 30px;
    margin: 40px 0;
}

.cards-grid.single {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 40px auto;
}

.cards-grid.double {
    grid-template-columns: repeat(2, 1fr);
}

.cards-grid.triple {
    grid-template-columns: repeat(3, 1fr);
}

.cards-grid.quad {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

/* Card with insights layout */
.card-with-insights {
    display: flex;
    gap: 60px;
    align-items: stretch;
    max-width: 1200px;
    margin: 40px auto;
}

/* ============================================
   RESPONSIVE CARD DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .card-with-insights {
        flex-direction: column;
        gap: 30px;
    }
    
    .insights-panel {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .cards-grid.double,
    .cards-grid.triple,
    .cards-grid.quad {
        grid-template-columns: 1fr;
    }
    
    .card-wrapper {
        flex-direction: column;
        gap: 30px;
    }
    
    .card-container {
        max-width: 100%;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .card-badge {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}