/* ==========================================================================
   CARD STYLES - Tufte-Inspired Minimalism
   Simple cards with minimal shadows and clean borders
   ========================================================================== */

/* =========================
     Auth Cards - Minimal Design
=========================== */
.auth_card {
    background: var(--fg_color);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 480px;
    width: 100%;
    min-width: 360px;
    box-shadow: var(--shadow-subtle);
}

.auth_card:hover {
    border-color: var(--border-default);
}

/* Dark mode auth card styling */
.dark-mode .auth_card {
    background: var(--fg_color);
    border-color: var(--border-subtle);
}

.dark-mode .auth_card:hover {
    border-color: var(--border-default);
}

/* Auth card responsive design */
@media (max-width: 768px) {
    .auth_card {
        max-width: 90vw;
        margin: var(--spacing-medium);
    }
}

@media (max-width: 576px) {
    .auth_card {
        padding: var(--spacing-large);
        margin: var(--spacing-medium);
        min-width: 300px;
        max-width: 95vw;
    }
}

/* =========================
     Chart Loading Indicators
=========================== */
.chart-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(128, 128, 128, 0.15);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: var(--border_radius_card);
}

.chart-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border_color);
    border-top: 3px solid #999;
    border-radius: 50%;
    animation: chart-loading-spin 1s linear infinite;
    margin-bottom: var(--spacing-small);
}

.chart-loading-text {
    font-size: var(--font-size-small);
    color: var(--text_color_muted);
    font-weight: 500;
}

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

.chart-container {
    position: relative;
}

.chart-loading-delay {
    opacity: 0.5;
}

.chart-loaded {
    opacity: 1;
    /* transition: opacity 0.3s ease-in-out; */
}

/* =========================
     Base Card Foundation - Enhanced Design System
=========================== */
.card {
    padding: 16px;
    border: 1px solid var(--card-border, var(--line_color));
    border-radius: 4px;
    background: var(--card-bg, var(--fg_color));
    margin: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.card:hover {
    /* No hover effects */
}

/* Card variants */
.card-elevated {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(74, 93, 249, 0.08);
}

.card-elevated:hover {
    /* No hover effects */
}

.card-feature {
    padding: var(--spacing-xlarge);
    text-align: center;
    border: 1px solid rgba(74, 93, 249, 0.1);
}

.card-feature:hover {
    /* No hover effects */
}

.card-stat {
    padding: var(--spacing-xlarge);
    text-align: center;
    background: var(--fg_color);
    border: 1px solid rgba(74, 93, 249, 0.08);
}

.card-stat:hover {
    /* No hover effects */
}

.card-pricing {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border_color);
    position: relative;
    /* transition: box-shadow 0.2s ease; */
}

.card-pricing:hover {
    /* No hover effects */
}

.card-pricing.featured {
    border: 2px solid var(--blue_1);
    box-shadow: 0 4px 12px rgba(74, 93, 249, 0.15);
    background: var(--fg_color);
}

.card-pricing.featured:hover {
    /* No hover effects */
}

.card-special {
    background: linear-gradient(to top right, var(--blue_2), var(--blue_1));
    color: var(--primary_1);
    box-shadow: var(--blue_1_shadow);
    border: none;
}

.card-special:hover {
    /* No hover effects */
}

/* =========================
     Card Links
=========================== */
.card-link {
    width: 420px;
    min-height: 200px;
    padding: var(--spacing-xlarge);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--fg_color);
    border: 2px solid transparent;
    border-radius: var(--border_radius_card);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* transition: all 0.2s ease; */
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.card-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--blue_1);
    transform: scaleX(0);
    /* transition: transform 0.2s ease; */
}

.card-link:hover::before {
    transform: scaleX(1);
}

.card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 93, 249, 0.12);
    border-color: var(--blue_1);
}

.card-link h2 {
    font-size: var(--font-card-title-size);
    font-weight: var(--font-card-title-weight);
    margin-bottom: var(--spacing-medium);
    line-height: var(--font-card-title-line-height);
    color: var(--text_color);
    /* transition: color 0.3s ease; */
}

.card-link:hover h2 {
    color: var(--blue_1);
}

.card-link p {
    font-size: var(--font-body-size);
    line-height: var(--font-body-line-height);
    margin: 0;
    color: var(--text_color_shiny);
    /* transition: color 0.3s ease; */
}

.card-link:hover p {
    color: var(--text_color);
}

/* Special Your Data Card */
.card-link.card-special {
    width: 480px;
    min-height: 220px;
    background: var(--blue_1);
    color: var(--primary_1);
    border: 2px solid var(--blue_3);
    box-shadow: 0 8px 32px rgba(74, 93, 249, 0.25);
}

.card-link.card-special::before {
    background: var(--cyan_1);
}

.card-link.card-special:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(74, 93, 249, 0.2);
}

.card-link.card-special h2 {
    font-size: 2rem;
    color: var(--primary_1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-link.card-special:hover h2 {
    color: var(--primary_1);
}

.card-link.card-special p {
    font-size: 1.25rem;
    color: var(--text_color);
}

.card-link.card-special:hover p {
    color: var(--primary_1);
}

/* Responsive card-link adjustments */
@media (max-width: 1400px) {
    .card-link {
        width: 380px;
    }
    
    .card-link.card-special {
        width: 440px;
    }
}

@media (max-width: 1200px) {
    .card-link {
        width: 360px;
    }
    
    .card-link.card-special {
        width: 400px;
    }
}

@media (max-width: 991px) {
    .card-link {
        width: 340px;
        min-height: 180px;
    }
    
    .card-link.card-special {
        width: 380px;
        min-height: 200px;
    }
}

@media (max-width: 767px) {
    .card-link {
        width: 100%;
        max-width: 500px;
        min-height: 180px;
    }
    
    .card-link.card-special {
        width: 100%;
        max-width: 550px;
        min-height: 200px;
    }
}

/* Card-link accessibility */
.card-link:focus {
    outline: 3px solid var(--blue_1);
    outline-offset: 2px;
}

/* Dark mode support */
.dark-mode .card-link {
    background: var(--fg_color);
    border-color: var(--line_color);
}

.dark-mode .card-link:hover {
    border-color: var(--blue_1);
    box-shadow: 0 12px 40px rgba(107, 124, 250, 0.2);
}

/* =========================
     Card Containers
=========================== */
.card-container {
    display: grid;
    gap: var(--spacing-large);
}

/* =========================
     Grid Systems
=========================== */
.features-grid,
.testimonial-grid,
.extended-charts-grid,
.pricing-grid,
.graph-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xlarge);
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 576px) {
    .features-grid,
    .pricing-grid,
    .testimonial-grid,
    .extended-charts-grid,
    .graph-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive auto-fit grid for features */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-xlarge);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* =========================
     Card Content Structure
=========================== */
.card-header {
    margin-bottom: var(--spacing-large);
    padding-bottom: var(--spacing-medium);
    border-bottom: 1px solid var(--border_color);
}

.card-title {
    margin: 0 0 var(--spacing-small) 0;
    color: var(--text_color);
    font-size: var(--font-subheader-small-size);
    font-weight: var(--font-subheader-small-weight);
    line-height: 1.3;
}

.card-subtitle {
    margin: 0;
    color: var(--text_color_shiny);
    font-size: var(--font-body-size);
    line-height: 1.5;
}

.card-body {
    flex: 1;
    margin-bottom: var(--spacing-large);
}

.card-text {
    margin: 0 0 var(--spacing-medium) 0;
    color: var(--text_color_shiny);
    line-height: 1.6;
}

.card-footer {
    margin-top: auto;
    padding-top: var(--spacing-medium);
    border-top: 1px solid var(--border_color);
}

/* =========================
     Specialized Card Types
=========================== */
/* Problem/Solution Cards */
.problem-card,
.demo-card {
    border: none;
    background-color: var(--fg_color);
    border-radius: var(--border_radius_card);
    margin: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--spacing-xlarge);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    /* transition: box-shadow 0.2s ease; */
    border: 1px solid rgba(74, 93, 249, 0.08);
}

.problem-card:hover,
.demo-card:hover {
    /* No hover effects */
}

/* Testimonial Cards */
.testimonial-card {
    border: none;
    background-color: var(--fg_color);
    border-radius: var(--border_radius_card);
    padding: var(--spacing-large);
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Pricing Plan Cards */
.plan,
.comp-roles {
    margin: 0;
    padding: var(--spacing-xlarge);
    display: flex;
    flex-direction: column;
    border: var(--border);
    border-radius: var(--border_radius_card);
    background-color: var(--fg_color);
    /* transition: all 0.2s ease; */
    /* height: 100%; */
    position: relative;
}

.plan:hover {
    /* No hover effects */
}

.comp-roles:hover {
    /* No hover effects */
}

.plan.featured {
    border: 2px solid var(--blue_1);
    box-shadow: 0 4px 12px rgba(74, 93, 249, 0.15);
    background: var(--fg_color);
}

.plan.featured:hover {
    /* No hover effects */
}

/* Value/Feature Cards */
.value-card {
    text-align: center;
    padding: var(--spacing-xlarge);
    background: var(--fg_color);
    border: var(--border);
    border-radius: var(--border_radius_card);
    /* transition: box-shadow 0.2s ease; */
}

.value-card:hover {
    /* No hover effects */
}

/* Stat Cards */
.stat-card {
    border: none;
    background-color: var(--primary_2);
    border-radius: var(--border_radius_card);
    padding: var(--spacing-xlarge);
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    /* transition: box-shadow 0.2s ease; */
    border: 1px solid rgba(74, 93, 249, 0.08);
}

.stat-card:hover {
    /* No hover effects */
}

/* Contact Cards */
.contact-card {
    background: var(--fg_color);
    border: 1px solid var(--border_color);
    border-radius: var(--border_radius_card);
    padding: var(--spacing-xlarge);
    text-align: center;
    max-width: 500px;
    /* transition: background-color 0.2s ease; */
}

.contact-card:hover {
    /* No hover effects */
}

/* Legacy pricing styles */
.price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--blue_1);
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: var(--spacing-large) 0;
    flex: 1;
}

.plan-features li {
    padding: var(--spacing-small) 0;
    color: var(--text_color);
    font-size: var(--font-body-size);
    line-height: 1.5;
}

.plan-features li::before {
    content: "✓";
    color: var(--green_1);
    font-weight: bold;
    width: 16px;
    text-align: center;
    margin-right: var(--spacing-small);
}

.plan-features li.unavailable {
    color: var(--text_color_shiny);
    text-decoration: line-through;
}

.plan-features li.unavailable::before {
    content: "✗";
    color: var(--red_1);
}

/* =========================
     Cost Display
=========================== */
.cost-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.3rem 0;
    position: relative;
    padding-right: 0.5rem;
    color: var(--text_color);
}

.cost-line span {
    z-index: 2;
    padding: 0 0.25rem;
}

.cost-line.total {
    margin-top: 0.5rem;
    border-top: var(--border);
    font-weight: var(--font-subheader-weight);
}

.math-details {
    max-height: 0;
    overflow: hidden;
    /* transition: max-height 0.3s ease; */
}

.math-details.show {
    max-height: 600px;
}

/* =========================
     Feature Cards
=========================== */
.feature-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-small);
    padding: var(--spacing-medium);
    border-radius: var(--border_radius_card);
    background-color: var(--fg_color);
    /* transition: all 0.2s ease; */
}

.feature-item:hover {
    /* No hover effects */
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--blue_1);
    color: var(--primary_1);
}

.feature-icon.dashboard {
    background: none;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.feature-title {
    font-size: var(--font-subheader-small-size);
    font-weight: var(--font-subheader-small-weight);
    margin: 0;
    color: var(--text_color);
}

.feature-text {
    font-size: var(--font-body-size);
    line-height: var(--font-body-line-height);
    margin: 0;
    color: var(--text_color_shiny);
}

/* =========================
     Flow Buttons (Card-like)
=========================== */
#flowButtons,
#flowButtonsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-large);
    margin: var(--spacing-large) 0;
}

#flowButtons .card.plan {
    margin: 0;
    padding: var(--spacing-large);
    text-align: center;
    cursor: pointer;
    /* transition: all 0.2s ease; */
    border: 2px solid transparent;
}

#flowButtons .card.plan:hover {
    /* No hover effects */
}

#flowButtons .card.plan h3 {
    margin-bottom: var(--spacing-small);
    color: var(--text_color);
}

#flowButtons .card.plan p {
    color: var(--text_color_shiny);
    margin: 0;
}

#flowButtons div {
    width: 100%;
}

@media (max-width: 991px) {
    #flowButtons {
        grid-template-columns: 1fr;
    }
    
    #flowButtons .card.plan {
        max-width: none;
    }
}

/* =========================
     Dataset Cards
=========================== */
#datasetCards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-large);
    margin-top: var(--spacing-large);
}

#addDatasetButton {
    order: 0;
}

#datasetCards .card {
    order: 1;
}

/* =========================
     Carousel Cards
=========================== */
.feature-carousel {
    position: relative;
}

.feature-track {
    display: flex;
    overflow-x: auto;
    gap: var(--spacing-large);
    padding: var(--spacing-medium) 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.feature-track::-webkit-scrollbar {
    display: none;
}

/* =========================
     Special Card States
=========================== */
.truncate-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.initially-hidden {
    opacity: 0;
    transform: translateY(20px);
    /* transition: all 0.3s ease; */
}

.initially-hidden.show {
    opacity: 1;
    transform: translateY(0);
}

.snapshot-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-medium);
    padding-top: var(--spacing-small);
    border-top: var(--border);
}

/* =========================
     Composition Cards
=========================== */
.comp-container {
    display: grid;
    gap: var(--spacing-large);
}

.comp-container[data-empty="true"] {
    display: none;
}

.comp-summary-container {
    display: flex;
    gap: var(--spacing-medium);
    margin-bottom: var(--spacing-large);
    flex-wrap: wrap;
}

.comp-trend-container {
    flex: 1;
    min-width: 200px;
}

.comp-trend {
    display: flex;
    align-items: center;
    gap: var(--spacing-small);
    padding: var(--spacing-small);
    background: var(--fg_color);
    border: var(--border);
    border-radius: var(--border_radius_button);
    margin-bottom: var(--spacing-small);
}

.comp-trend:last-child {
    margin-bottom: 0;
}

.comp-trend .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comp-trend .label {
    flex: 1;
    font-size: var(--font-data-size);
    color: var(--text_color);
}

.comp-trend .value {
    font-weight: var(--font-data-weight-bold);
    color: var(--text_color);
}

/* =========================
     Card Icons & Visual Elements
=========================== */
.card-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--blue_1);
    color: var(--primary_1);
    margin-bottom: var(--spacing-medium);
    flex-shrink: 0;
}

.card-icon.lg {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.card-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--blue_1);
    color: var(--primary_1);
    padding: 0.5rem 1rem;
    border-radius: var(--border_radius_button);
    font-size: var(--font-caption-size);
    font-weight: var(--font-body-weight-bold);
    white-space: nowrap;
    z-index: 10;
}

/* =========================
     Card States & Modifiers
=========================== */
.card-loading {
    position: relative;
    pointer-events: none;
}

.card-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border_radius_card);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.card-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.card-selected {
    border-color: var(--blue_1);
    box-shadow: 0 0 0 2px rgba(74, 93, 249, 0.1);
}

/* =========================
     Dark Mode Support - Enhanced Contrast
=========================== */
.dark-mode .card {
    border-color: var(--line_color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dark-mode .card:hover {
    /* No hover effects */
}

.dark-mode .card-elevated {
    border-color: rgba(107, 124, 250, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dark-mode .problem-card,
.dark-mode .demo-card,
.dark-mode .stat-card {
    background-color: var(--primary_5);
    border-color: rgba(107, 124, 250, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}


.dark-mode .card-pricing.featured {
    border-color: var(--blue_1);
    box-shadow: 0 4px 12px rgba(107, 124, 250, 0.2);
}

.dark-mode .card-pricing.featured:hover {
    /* No hover effects */
}

/* =========================
     Card Responsive Design
=========================== */
@media (max-width: 991px) {
    .card {
        padding: var(--spacing-medium);
    }
    
    .card-feature,
    .card-stat,
    .card-pricing,
    .problem-card,
    .demo-card,
    .stat-card,
    .value-card {
        padding: var(--spacing-large);
    }
    
    .plan,
    .comp-roles {
        padding: var(--spacing-large);
    }
}

@media (max-width: 767px) {
    .card,
    .card-feature,
    .card-stat,
    .card-pricing,
    .problem-card,
    .demo-card,
    .stat-card,
    .value-card,
    .plan,
    .comp-roles {
        padding: var(--spacing-large);
    }
    
    .feature-item {
        padding: var(--spacing-medium);
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
    }
    
    .card-icon.lg {
        width: 56px;
        height: 56px;
    }
}

/* =========================
     Accessibility
=========================== */
@media (prefers-reduced-motion: reduce) {
    .card, .card-elevated, .card-feature, .card-stat, .card-pricing,
    .problem-card, .demo-card, .stat-card, .value-card, .feature-item,
    .plan, .comp-roles, .testimonial-card, .contact-card {
        /* transition: none; */
    }
    
    .card:hover, .card-elevated:hover, .card-feature:hover, .card-stat:hover,
    .card-pricing:hover, .problem-card:hover, .demo-card:hover, .stat-card:hover,
    .value-card:hover, .feature-item:hover, .plan:hover, .comp-roles:hover {
        transform: none;
    }
}