/* raid-specific.css - RAID Calculator specific styles */

/* ============= RAID Specifications Table ============= */
.raid-table-wrapper {
    overflow-x: auto;
    margin: 0 -1rem;
    padding: 0 1rem;
}

.raid-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-collapse: separate;
    border-spacing: 0;
}

.raid-table thead {
    background: linear-gradient(135deg, #374151 0%, #6b7280 100%);
    color: white;
}

.raid-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 2px solid #4b5563;
    color: white;
}

.raid-table tbody tr {
    transition: background-color var(--transition-base);
    border-bottom: 1px solid #e7e5e4;
}

.raid-table tbody tr:last-child {
    border-bottom: none;
}

.raid-table tbody tr:hover {
    background: #faf9f8;
}

.raid-table td {
    padding: 1rem;
    font-size: 0.875rem;
}

/* RAID Level column */
.raid-level {
    font-weight: 700;
    color: #7c3aed;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.raid-icon {
    width: 8px;
    height: 24px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Colors for different RAID levels */
.raid-0 { background: #10b981; }
.raid-1 { background: #6366f1; }
.raid-5 { background: #f59e0b; }
.raid-6 { background: #a855f7; }
.raid-10 { background: #0ea5e9; }
.raid-50 { background: #f97316; }
.raid-60 { background: #e11d48; }
.raidz1 { background: #84cc16; }
.raidz2 { background: #65a30d; }
.raidz3 { background: #4d7c0f; }
.jbod { background: #64748b; }

/* Table columns */
.disk-req {
    font-weight: 500;
    color: #57534e;
}

.capacity-cell {
    font-weight: 600;
    color: #292524;
}

.redundancy-cell {
    color: #10b981;
    font-weight: 600;
}

.no-redundancy {
    color: #ef4444;
}

.description {
    color: #78716c;
    line-height: 1.4;
}

/* Mobile card view */
.raid-cards {
    display: none;
}

.raid-card {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 3px solid;
    transition: all var(--transition-base);
}

.raid-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #292524;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.card-title .raid-icon {
    width: 6px;
    height: 18px;
}

.card-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.75rem;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.spec-label {
    color: #a8a29e;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.spec-value {
    font-weight: 600;
    color: #292524;
    font-size: 0.8rem;
}

.card-description {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f4f3f2;
    font-size: 0.75rem;
    color: #78716c;
    line-height: 1.3;
}

/* ============= Comparison Table ============= */
.comparison-panel {
    overflow-x: auto;
}

.comparison-panel h3 {
    margin-bottom: var(--spacing-sm);
    font-size: calc(var(--font-lg) * 1.25);
    font-weight: 600;
    color: var(--gray-800);
}

.comparison-panel > p {
    font-size: var(--font-sm);
    color: var(--gray-500);
    margin-bottom: var(--spacing-md);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.625rem, 1.5vw, 0.875rem);
    border-radius: var(--spacing-sm);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.comparison-table thead {
    position: relative;
}

.comparison-table th {
    background: var(--gray-50);
    padding: var(--spacing-md) 0.625rem;
    text-align: left;
    font-weight: 700;
    color: var(--primary-dark);
    border-bottom: 3px solid var(--primary);
    white-space: nowrap;
    font-size: var(--font-sm);
    letter-spacing: 0.02em;
    position: relative;
}

.comparison-table th.arrow-column {
    width: 20px;
    padding: var(--spacing-md) var(--spacing-xs);
    border-right: none;
}

.comparison-table th:first-child {
    border-radius: var(--spacing-sm) 0 0 0;
}

.comparison-table th:last-child {
    border-radius: 0 var(--spacing-sm) 0 0;
}

.comparison-table td {
    padding: 0.625rem var(--spacing-sm);
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
    white-space: nowrap;
}

.comparison-table td.arrow-cell {
    width: 20px;
    padding: 0.625rem var(--spacing-xs);
    text-align: center;
    color: white;
    font-weight: bold;
}

.comparison-table tbody td:nth-child(2) {
    font-weight: 600;
    color: var(--gray-700);
}

.comparison-table tbody tr {
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    background: white;
    will-change: transform;
}

.comparison-table tbody tr:nth-child(even) {
    background: rgba(249, 250, 251, 0.5);
}

.comparison-table tbody tr:not(.selected):hover {
    background: var(--gray-100);
}

.comparison-table tbody tr:first-child:not(.selected) {
    animation: pulseHint 3s ease-in-out 1s;
}

.comparison-table tbody tr.selected {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.comparison-table tbody tr.selected td {
    color: white;
}

.comparison-table tbody tr.selected td:nth-child(2) {
    font-weight: 700;
}

/* Row animation styles */
.row-moving {
    position: relative;
    z-index: 100;
    pointer-events: none;
}

.row-highlight {
    animation: highlight-pulse var(--transition-smooth);
}

/* Mobile-specific fault tolerance display */
.fault-full {
    display: inline;
}

.fault-mobile {
    display: none;
}

/* RAID grouping selector styles */
.raid-label-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.grouping-selector {
    padding: 2px 4px;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    min-width: 60px;
    transition: border-color 0.2s;
}

.grouping-selector:hover {
    border-color: var(--primary);
}

.grouping-selector:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.comparison-table tbody tr.selected .grouping-selector {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.7);
    color: var(--gray-800);
}

/* ============= Configuration Details ============= */
.current-config {
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    border-top: 2px solid var(--gray-200);
    animation: fadeInUp var(--transition-slow) ease-out;
}

.config-header {
    margin-bottom: var(--spacing-xl);
}

.config-header h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--gray-800);
}

/* Capacity Bar */
.capacity-bar-wrapper {
    margin: var(--spacing-base) 0;
}

.capacity-bar {
    height: 32px;
    border-radius: var(--spacing-sm);
    background: var(--gray-200);
    display: flex;
    overflow: hidden;
    box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.06);
    position: relative;
}

.capacity-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-xs);
    font-weight: 600;
    position: relative;
    transition: all var(--transition-slow) ease-out;
}

.capacity-segment:hover {
    filter: brightness(1.1);
}

.capacity-segment.usable { background: var(--bar-usable); }
.capacity-segment.parity { background: var(--bar-parity); }
.capacity-segment.unused { background: var(--bar-unused); }
.capacity-segment.spare { background: var(--bar-spare); }

/* Legend */
.capacity-legend {
    display: flex;
    gap: var(--spacing-base);
    flex-wrap: wrap;
    margin: var(--spacing-sm) 0 var(--spacing-xl);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-base-sm);
    color: var(--gray-600);
    animation: fadeInUp var(--transition-base) ease-out backwards;
}

.legend-item:nth-child(1) { animation-delay: 0.05s; }
.legend-item:nth-child(2) { animation-delay: 0.1s; }
.legend-item:nth-child(3) { animation-delay: 0.15s; }
.legend-item:nth-child(4) { animation-delay: 0.2s; }

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-base);
}

.stat-item {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--spacing-sm);
    border: 1px solid var(--gray-200);
    cursor: help;
    position: relative;
    transition: all var(--transition-base);
    animation: fadeInScale 0.15s ease-out backwards;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Stagger animation for stat items */
.stat-item:nth-child(1) { animation-delay: 0.025s; }
.stat-item:nth-child(2) { animation-delay: 0.05s; }
.stat-item:nth-child(3) { animation-delay: 0.075s; }
.stat-item:nth-child(4) { animation-delay: 0.1s; }
.stat-item:nth-child(5) { animation-delay: 0.125s; }
.stat-item:nth-child(6) { animation-delay: 0.15s; }
.stat-item:nth-child(7) { animation-delay: 0.175s; }
.stat-item:nth-child(8) { animation-delay: 0.2s; }
.stat-item:nth-child(9) { animation-delay: 0.225s; }
.stat-item:nth-child(10) { animation-delay: 0.25s; }
.stat-item:nth-child(11) { animation-delay: 0.275s; }
.stat-item:nth-child(12) { animation-delay: 0.3s; }

.stat-item:hover {
    background: var(--gray-50);
    border-color: var(--primary);
}

.stat-label {
    font-size: var(--font-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: clamp(0.875rem, 2.5vw, 1.25rem);
    font-weight: 600;
    color: var(--gray-800);
}

.stat-unit {
    font-size: var(--font-base-sm);
    color: var(--gray-500);
    font-weight: 400;
    margin-left: var(--spacing-xs);
}

/* URE Risk styling */
.ure-critical {
    color: var(--danger);
    font-weight: bold;
}

.ure-high {
    color: var(--warning);
    font-weight: bold;
}

.ure-medium {
    color: #f59e0b;
}

/* Critical rebuild time */
.rebuild-critical {
    color: var(--danger);
    font-weight: bold;
}

/* Save/Share Controls */
.save-controls {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-base);
    background: var(--gray-50);
    border-radius: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    align-items: center;
}

.share-url {
    flex: 1;
    min-width: 200px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: var(--font-base-sm);
    background: white;
}

.share-url:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ============= Badges ============= */
.badge {
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 999px;
    font-size: var(--font-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: help;
    position: relative;
    display: inline-block;
    transition: transform 0.2s;
    animation: badgePulse var(--transition-slow) ease-out;
}

/* Badge colors */
.badge-performance { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); color: white; }
.badge-balanced { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); color: white; }
.badge-mirror { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); color: white; }
.badge-redundant { background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%); color: white; }
.badge-capacity { background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%); color: white; }
.badge-simple { background: linear-gradient(135deg, #64748b 0%, #475569 100%); color: white; }
.badge-extreme { background: linear-gradient(135deg, #e11d48 0%, #be123c 100%); color: white; }
.badge-zfs { background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%); color: white; }
.badge-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.badge-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.badge-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; }

/* Mobile badge sizing */
.raid-card .badge {
    padding: 0.15rem 0.35rem;
    font-size: 0.6rem;
}

/* Remove help cursor from ZFS badges in table */
.raid-table .badge-zfs {
    cursor: default;
}

/* ============= Tooltips ============= */

/* Badge tooltips */
.badge[data-tooltip]:hover::after,
.badge[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

.badge[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    background: #111;
    color: white;
    padding: var(--spacing-md) var(--spacing-base);
    border-radius: var(--spacing-sm);
    font-size: var(--font-base-sm);
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    text-align: center;
    line-height: 1.4;
}

/* Default center position */
.badge[data-tooltip]::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Position based on CSS variable set by JavaScript */
.badge[style*="--tooltip-position: left"]::after {
    left: 0;
    transform: none;
}

.badge[style*="--tooltip-position: right"]::after {
    left: auto;
    right: 0;
    transform: none;
}

.badge[style*="--tooltip-position: center"]::after {
    left: 50%;
    transform: translateX(-50%);
}

.badge[data-tooltip]::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 3px);
    border: 5px solid transparent;
    border-top-color: #111;
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

/* Arrow position based on tooltip position */
.badge[data-tooltip]::before {
    left: 50%;
    transform: translateX(-50%);
}

.badge[style*="--tooltip-position: left"]::before {
    left: 20px;
    transform: none;
}

.badge[style*="--tooltip-position: right"]::before {
    left: auto;
    right: 20px;
    transform: none;
}

/* Stat item tooltips */
.stat-item:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.stat-item .tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: white;
    padding: var(--spacing-md) var(--spacing-base);
    border-radius: var(--spacing-sm);
    font-size: var(--font-base-sm);
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--spacing-md);
    min-width: 250px;
    max-width: 350px;
    white-space: normal;
    text-align: left;
    line-height: 1.4;
}

.stat-item .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #111;
}

/* ============= Warnings ============= */
.warnings-card {
    background: white;
    border: 1px solid var(--gray-200);
}

.warnings-card h3 {
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: calc(var(--font-lg) * 1.25);
    font-weight: 600;
}

.warning-item {
    padding: var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-xs) 0;
    background: white;
    border-radius: 0.375rem;
    font-size: var(--font-base-sm);
    color: var(--gray-700);
    display: flex;
    align-items: start;
    gap: var(--spacing-sm);
    border: 1px solid var(--gray-200);
    animation: fadeInUp var(--transition-base) ease-out backwards;
}

/* Stagger warnings */
.warning-item:nth-child(1) { animation-delay: 0.05s; }
.warning-item:nth-child(2) { animation-delay: 0.1s; }
.warning-item:nth-child(3) { animation-delay: 0.15s; }
.warning-item:nth-child(4) { animation-delay: 0.2s; }

.warning-item.disabled {
    background: var(--gray-50);
    border-color: var(--gray-300);
    padding-left: var(--spacing-xl);
    display: block;
}

.warning-item.warning {
    background: var(--gradient-warning);
    border-color: #fbbf24;
    border-left: 3px solid var(--warning);
}

.warning-item.info {
    background: var(--gradient-info);
    border-color: #c084fc;
    border-left: 3px solid var(--primary);
}

.warning-item.validation {
    background: var(--gradient-neutral);
    border-color: #d6d3d1;
    border-left: 3px solid var(--gray-400);
}

.warning-item.error {
    background: var(--gradient-danger);
    border-color: #f87171;
    border-left: 3px solid var(--danger);
}

.warning-item.danger {
    background: linear-gradient(135deg, #fca5a5 0%, #f87171 100%);
    border-color: #dc2626;
    border-left: 3px solid var(--danger);
}

.warning-icon {
    flex-shrink: 0;
    font-size: var(--font-base);
}

/* ============= Alternative Groupings (hidden) ============= */
.alt-groupings {
    display: none;
}

/* ============= Animations ============= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOutScale {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes segmentGrow {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes pulseHint {
    0%, 100% { background: transparent; }
    50% { background: rgba(124, 58, 237, 0.03); }
}

@keyframes highlight-pulse {
    0% {
        background: var(--gradient-primary);
        box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    }
    50% {
        background: linear-gradient(135deg, #ec4899 0%, var(--primary) 100%);
        box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
    }
    100% {
        background: var(--gradient-primary);
        box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    }
}

/* Removing disk group animation */
.disk-group.removing {
    animation: fadeOutScale var(--transition-base) ease-out forwards;
}

/* ============= AI Explain Button & Panel Styles ============= */

/* AI Explain Button as stat item - same size as other stats */
.stat-item.ai-explain-stat {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    color: #111;
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid #e9d5ff;
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

.stat-item.ai-explain-stat .stat-label {
    position: relative;
    z-index: 2;
}

.stat-item.ai-explain-stat .stat-value {
    position: relative;
    z-index: 2;
}

.stat-item.ai-explain-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

.stat-item.ai-explain-stat:active {
    transform: translateY(0);
}

.stat-item.ai-explain-stat.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* AI Einstein icon styling */
.stat-item.ai-explain-stat .ai-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.stat-item.ai-explain-stat .einstein-icon {
    width: 56px;
    height: 56px;
    display: block;
}

.ai-explanation-title .ai-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ai-explanation-title .einstein-icon {
    width: 24px;
    height: 24px;
}

/* Shimmer effect - ONE PASS ONLY to attract attention */
.ai-shimmer-once::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: shimmer 1.5s ease-out 1;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* AI Explanation Area */
.ai-explanation-area {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-radius: var(--spacing-sm);
    border: 1px solid #e9d5ff;
    animation: fadeInUp var(--transition-slow) ease-out;
}

.ai-explanation-content {
    position: relative;
}

.ai-explanation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.ai-explanation-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-base);
    font-weight: 600;
    color: #111;
}

.ai-explanation-title .einstein-icon {
    width: 24px;
    height: 24px;
}

.ai-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-base);
    line-height: 1;
}

.ai-close-btn:hover {
    color: var(--gray-700);
}

.ai-text {
    color: var(--gray-700);
    line-height: 1.6;
    font-size: var(--font-base);
}

.ai-text p {
    margin: 0 0 var(--spacing-md) 0;
}

.ai-text p:last-child {
    margin-bottom: 0;
}

.ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    color: var(--primary);
    font-size: var(--font-base);
}

.ai-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-right: var(--spacing-sm);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-error {
    color: var(--danger);
    padding: var(--spacing-md);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--spacing-xs);
    font-size: var(--font-base);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .stat-item {
        min-height: 80px;
    }
    
    .stat-item.ai-explain-stat {
        padding: var(--spacing-md);
        min-height: 80px;
    }
    
    .stat-item.ai-explain-stat .einstein-icon {
        width: 48px;
        height: 48px;
    }
    
    .ai-explanation-area {
        margin-top: var(--spacing-md);
        padding: var(--spacing-md);
    }
    
    .ai-explanation-title .einstein-icon {
        width: 20px;
        height: 20px;
    }
}
