/* stylelint-disable alpha-value-notation, color-function-notation */

.simulations-page {
    position: relative;
}

.simulations-hero {
    background: linear-gradient(
        135deg,
        rgba(var(--bs-primary-rgb), 0.92) 0%,
        rgba(var(--bs-primary-rgb), 0.78) 100%
    );
    box-shadow: 0 20px 45px rgba(var(--bs-primary-rgb), 0.32);
}

.simulations-callout {
    border-radius: 16px;
    border: 1px solid rgba(var(--bs-info-rgb), 0.38);
    background: linear-gradient(
        135deg,
        rgba(var(--bs-info-rgb), 0.18),
        rgba(var(--bs-info-rgb), 0.12)
    );
    color: var(--bs-info);
}

.simulation-insights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.simulations-callout i {
    color: var(--bs-info);
}

.simulations-toolbar {
    background: linear-gradient(135deg, rgb(255 255 255 / 92%), rgb(248 250 252 / 88%));
    border-radius: 18px;
    border: 1px solid rgb(226 232 240 / 65%);
    padding: 1rem 1.5rem;
    box-shadow: 0 12px 28px rgb(15 23 42 / 12%);
}

.toolbar-label {
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.status-badge i {
    font-size: 0.9rem;
}

.btn-slim {
    border-radius: 12px;
    padding: 0.45rem 0.9rem;
    font-weight: 600;
}

.btn-slim i {
    font-size: 0.9rem;
}

.dev-alert {
    border-radius: 16px;
    border: 1px solid rgba(var(--bs-warning-rgb), 0.4);
    background: linear-gradient(
        135deg,
        rgba(var(--bs-warning-rgb), 0.16),
        rgba(var(--bs-warning-rgb), 0.26)
    );
    color: var(--bs-warning-text, #845706);
    box-shadow: 0 10px 24px rgba(var(--bs-warning-rgb), 0.22);
}

.dev-alert i {
    color: rgba(234, 88, 12, 0.95);
}

.simulations-hero .header-icon {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    background: rgba(var(--bs-light-rgb), 0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--bs-light);
    box-shadow: inset 0 0 12px rgba(var(--bs-light-rgb), 0.32);
}


.simulations-hero .btn-action {
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(var(--bs-primary-rgb), 0.2);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.simulations-hero .btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(var(--bs-primary-rgb), 0.26);
}

.stats-row .stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(160deg, rgb(255 255 255 / 94%), rgb(248 250 252 / 88%));
    border-radius: 18px;
    padding: 1.4rem 1.6rem;
    border: 1px solid rgb(148 163 184 / 15%);
    position: relative;
    overflow: hidden;
}

.stat-card.alt {
    display: grid;
    grid-template-columns: auto 1fr;
    row-gap: 0.75rem;
    column-gap: 1rem;
    align-items: center;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 16px 35px rgb(15 23 42 / 18%);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-label {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 600;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: inherit;
    line-height: 1.1;
}

.stat-subtext {
    font-size: 0.88rem;
    color: #64748b;
}

.bg-indigo { background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.9), rgba(var(--bs-primary-rgb), 0.7)); }
.bg-emerald { background: linear-gradient(135deg, #22c55e, #0ea5e9); }
.bg-orange { background: linear-gradient(135deg, #f97316, #facc15); }
.bg-teal { background: linear-gradient(135deg, #14b8a6, #0ea5e9); }

.simulation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.6rem;
}

.simulation-card {
    background: linear-gradient(160deg, rgb(255 255 255 / 95%), rgb(241 245 249 / 92%));
    border-radius: 20px;
    border: 1px solid rgb(226 232 240 / 85%);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    position: relative;
}

.simulation-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.14);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.simulation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 40px rgb(15 23 42 / 12%);
}

.simulation-card:hover::after {
    opacity: 1;
}

.simulation-card-body {
    padding: 1.6rem 1.6rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.simulation-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
}

.simulation-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f1f5f9, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgb(148 163 184 / 25%);
}

.simulation-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}

.simulation-icon .fallback {
    color: #94a3b8;
    font-size: 2rem;
}

.simulation-title h2 {
    font-weight: 700;
    color: var(--indy-text-primary, #111827);
}

html[data-theme="darkly"] .simulation-title h2 {
    color: #f8f9fa;
}

.simulation-title p {
    font-size: 0.95rem;
    color: #64748b;
}

.simulation-meta {
    justify-self: end;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
}

.meta-badge.runs {
    background: rgba(var(--bs-success-rgb), 0.18);
    color: var(--bs-success);
}

.meta-badge.items {
    background: rgba(var(--bs-info-rgb), 0.16);
    color: var(--bs-info);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.metric {
    background: rgb(255 255 255 / 65%);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    border: 1px solid rgb(226 232 240 / 70%);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: inherit;
}

.metric-subtext {
    font-size: 0.82rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.simulation-insights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.insight-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(var(--bs-primary-rgb), 0.14);
    color: var(--bs-primary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.insight-badge i {
    font-size: 0.85rem;
}

.insight-badge.profit {
    background: rgba(var(--bs-success-rgb), 0.2);
    color: var(--bs-success);
}

.insight-badge.tab {
    background: rgba(var(--bs-info-rgb), 0.18);
    color: var(--bs-info);
}

.insight-badge.runs {
    background: rgba(var(--bs-warning-rgb), 0.22);
    color: var(--bs-warning);
}

.simulation-footer {
    padding: 0.85rem 1.6rem 1.4rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    border-top: 1px solid rgb(148 163 184 / 18%);
    background: linear-gradient(180deg, rgb(241 245 249 / 70%), rgb(241 245 249 / 40%));
}

.simulation-footer .timestamp {
    font-size: 0.9rem;
    color: var(--indy-text-secondary, #475569);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.simulation-footer .btn-group .btn {
    border-radius: 12px;
    padding: 0.45rem 0.8rem;
}

.simulation-footer .btn-group .btn i {
    font-size: 0.95rem;
}

.empty-state {
    border-radius: 22px;
    padding: 3rem 2rem;
    background: linear-gradient(160deg, rgb(255 255 255 / 95%), rgb(226 232 240 / 88%));
    text-align: center;
    border: 1px dashed rgb(148 163 184 / 35%);
}

.empty-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgb(59 130 246 / 10%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 2.2rem;
    margin: 0 auto 1.5rem;
}

html[data-theme="darkly"] .simulations-hero {
    background: linear-gradient(
        135deg,
        rgba(var(--bs-primary-rgb), 0.78) 0%,
        rgba(var(--bs-primary-rgb), 0.52) 100%
    );
    box-shadow: 0 20px 45px rgba(var(--bs-primary-rgb), 0.4);
}

html[data-theme="darkly"] .simulations-callout {
    border-color: rgba(var(--bs-info-rgb), 0.42);
    background: linear-gradient(
        135deg,
        rgba(var(--bs-info-rgb), 0.32),
        rgba(var(--bs-info-rgb), 0.22)
    );
    color: rgba(var(--bs-info-rgb), 0.88);
}

html[data-theme="darkly"] .simulations-callout i {
    color: rgba(var(--bs-info-rgb), 0.88);
}

html[data-theme="darkly"] .simulations-toolbar {
    background: linear-gradient(135deg, rgb(30 41 59 / 92%), rgb(15 23 42 / 92%));
    border-color: rgb(51 65 85 / 70%);
    box-shadow: 0 12px 28px rgb(2 6 23 / 65%);
}

html[data-theme="darkly"] .status-badge {
    background: rgba(var(--bs-primary-rgb), 0.26);
    color: rgba(var(--bs-light-rgb), 0.86);
}

html[data-theme="darkly"] .insight-badge {
    background: rgba(var(--bs-primary-rgb), 0.26);
    color: rgba(var(--bs-light-rgb), 0.86);
}

html[data-theme="darkly"] .insight-badge.profit {
    background: rgba(var(--bs-success-rgb), 0.32);
    color: rgba(var(--bs-light-rgb), 0.86);
}

html[data-theme="darkly"] .insight-badge.tab {
    background: rgba(var(--bs-info-rgb), 0.34);
    color: rgba(var(--bs-light-rgb), 0.86);
}

html[data-theme="darkly"] .insight-badge.runs {
    background: rgba(var(--bs-warning-rgb), 0.34);
    color: rgba(var(--bs-light-rgb), 0.9);
}

html[data-theme="darkly"] .simulations-hero .header-icon {
    background: rgb(255 255 255 / 14%);
    color: rgb(241 245 249 / 95%);
    box-shadow: inset 0 0 12px rgb(15 23 42 / 45%);
}

html[data-theme="darkly"] .simulations-hero .btn-action {
    box-shadow: 0 10px 30px rgb(15 23 42 / 45%);
}

html[data-theme="darkly"] .simulations-hero .btn-action:hover {
    box-shadow: 0 18px 38px rgb(15 23 42 / 55%);
}

html[data-theme="darkly"] .dev-alert {
    border-color: rgba(250, 204, 21, 0.35);
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.16), rgba(252, 211, 77, 0.12));
    color: #fde68a;
    box-shadow: 0 12px 28px rgba(250, 204, 21, 0.15);
}

html[data-theme="darkly"] .stats-row .stat-card {
    background: linear-gradient(160deg, rgb(30 41 59 / 92%), rgb(15 23 42 / 88%));
    border: 1px solid rgb(148 163 184 / 22%);
}

html[data-theme="darkly"] .stat-card.alt {
    background: linear-gradient(160deg, rgb(30 41 59 / 92%), rgb(17 24 39 / 90%));
}

html[data-theme="darkly"] .stat-icon {
    box-shadow: 0 16px 35px rgb(0 0 0 / 35%);
}

html[data-theme="darkly"] .stat-label {
    color: rgb(148 163 184 / 85%);
}

html[data-theme="darkly"] .stat-value {
    color: #e2e8f0;
}

html[data-theme="darkly"] .stat-subtext {
    color: rgb(148 163 184 / 75%);
}

html[data-theme="darkly"] .simulation-card {
    background: linear-gradient(160deg, rgb(17 24 39 / 94%), rgb(15 23 42 / 92%));
    border: 1px solid rgb(30 41 59 / 85%);
}

html[data-theme="darkly"] .simulation-card::after {
    border-color: rgba(var(--bs-primary-rgb), 0.26);
}

html[data-theme="darkly"] .simulation-icon {
    background: linear-gradient(180deg, #1e293b, #0f172a);
    box-shadow: inset 0 0 0 1px rgb(148 163 184 / 20%);
}

html[data-theme="darkly"] .simulation-title h2 {
    color: #e2e8f0;
}

html[data-theme="darkly"] .simulation-title p {
    color: #94a3b8;
}

html[data-theme="darkly"] .meta-badge {
    background: rgb(59 130 246 / 16%);
    color: #c7d2fe;
}

html[data-theme="darkly"] .meta-badge.runs {
    background: rgb(34 197 94 / 22%);
    color: #bbf7d0;
}

html[data-theme="darkly"] .meta-badge.items {
    background: rgb(59 130 246 / 20%);
    color: #bfdbfe;
}

html[data-theme="darkly"] .metric {
    background: rgb(15 23 42 / 75%);
    border-color: rgb(30 41 59 / 70%);
}

html[data-theme="darkly"] .metric-label {
    color: rgb(148 163 184 / 85%);
}

html[data-theme="darkly"] .metric-value {
    color: #e2e8f0;
}

html[data-theme="darkly"] .metric-subtext {
    color: rgb(148 163 184 / 75%);
}

html[data-theme="darkly"] .simulation-footer {
    background: linear-gradient(180deg, rgb(15 23 42 / 80%), rgb(15 23 42 / 60%));
    border-top-color: rgb(51 65 85 / 45%);
}

html[data-theme="darkly"] .simulation-footer .timestamp {
    color: #cbd5f5;
}

html[data-theme="darkly"] .empty-state {
    background: linear-gradient(160deg, rgb(17 24 39 / 95%), rgb(30 41 59 / 88%));
    border-color: rgb(71 85 105 / 45%);
}

html[data-theme="darkly"] .empty-icon {
    background: rgb(59 130 246 / 18%);
    color: #bfdbfe;
}

@media (max-width: 991px) {
    .stat-card {
        padding: 1.2rem;
    }

    .simulation-header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .simulation-meta {
        justify-content: center;
    }

    .simulation-icon {
        margin: 0 auto;
    }

    .simulation-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .simulation-footer .btn-group {
        justify-content: center;
    }
}

@media (max-width: 575px) {
    .simulations-hero .btn-action {
        width: 100%;
        justify-content: center;
    }

    .stat-card.alt {
        grid-template-columns: 1fr;
    }
}

/* Bootstrap utility classes overrides */
html[data-theme="darkly"] .bg-body-tertiary,
html[data-theme="darkly"] .bg-body-secondary,
html[data-theme="darkly"] .bg-light,
html[data-theme="darkly"] .bg-white {
    background-color: #303030 !important;
}

html[data-theme="darkly"] [class*="subtle"] {
    background-color: #303030 !important;
}
