/* ==========================================================================
   Model details page redesign (product page style)
   Additive stylesheet — scoped under .model-details. Does not modify dashcore.
   ========================================================================== */

/* ---- Page background ---- */
body:has(.model-details) {
    background-color: #F7F9FC;
}
[data-bs-theme="dark"] body:has(.model-details) {
    background-color: #090E15;
}

/* ---- Design tokens ---- */
.model-details {
    --md-card: #FFFFFF;
    --md-border: #E4E8F0;
    --md-text: #172033;
    --md-muted: #687386;
    --md-accent: #635BFF;
    --md-accent-2: #3478F6;
    --md-violet: #7C3AED;
    --md-cyan: #12B7E9;
    --md-green: #0E9F6E;
    --md-hero-bg: #FFFFFF;
    --md-hero-glow: radial-gradient(ellipse 60% 90% at 85% 40%, rgba(99, 91, 255, .08), rgba(18, 183, 233, .05) 55%, transparent 75%);
    --md-callout-bg: rgba(99, 91, 255, .06);
    --md-callout-border: rgba(99, 91, 255, .18);
    --md-stat-bg: #FFFFFF;
    --md-shadow: 0 10px 35px rgba(20, 30, 60, .04);
    --md-divider: #EDF1F7;
    --md-wave-opacity: .8;
    --md-tag-bg: rgba(99, 91, 255, .06);
    --md-tag-border: rgba(99, 91, 255, .16);

    max-width: 1480px;
    margin: 0 auto;
    padding: 56px 24px 64px;
    color: var(--md-text);
}

[data-bs-theme="dark"] .model-details {
    --md-card: #101722;
    --md-border: rgba(255, 255, 255, .10);
    --md-text: #F1F5FA;
    --md-muted: #929CAB;
    --md-hero-bg: #0E1420;
    --md-hero-glow: radial-gradient(ellipse 60% 90% at 85% 40%, rgba(99, 91, 255, .16), rgba(18, 183, 233, .08) 55%, transparent 75%);
    --md-callout-bg: rgba(99, 91, 255, .10);
    --md-callout-border: rgba(124, 58, 237, .28);
    --md-stat-bg: #121923;
    --md-shadow: none;
    --md-divider: rgba(255, 255, 255, .07);
    --md-wave-opacity: 1;
    --md-tag-bg: rgba(99, 91, 255, .12);
    --md-tag-border: rgba(124, 58, 237, .30);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.mdl-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    align-items: stretch;
    min-height: 440px;
    border: 1px solid var(--md-border);
    border-radius: 22px;
    background: var(--md-hero-bg);
    box-shadow: var(--md-shadow);
    overflow: hidden;
    animation: mdl-hero-in .42s ease both;
}

.mdl-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--md-hero-glow);
    pointer-events: none;
}

.mdl-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 4vw, 56px) clamp(28px, 4vw, 56px) 44px;
    min-width: 0;
}

/* ---- Badge ---- */
.mdl-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--md-accent);
    background: rgba(99, 91, 255, .10);
    border: 1px solid rgba(99, 91, 255, .20);
}
[data-bs-theme="dark"] .mdl-badge {
    background: rgba(99, 91, 255, .16);
    border-color: rgba(124, 58, 237, .32);
    color: #A5B4FF;
}

/* ---- Title ---- */
.mdl-title {
    margin: 18px 0 10px;
    max-width: 720px;
    font-size: clamp(34px, 4vw, 60px);
    font-weight: 750;
    line-height: 1.05;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
    background: linear-gradient(92deg, var(--md-accent-2) 0%, var(--md-accent) 55%, var(--md-violet) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
[data-bs-theme="dark"] .mdl-title {
    background: linear-gradient(92deg, #6EA8FF 0%, #8B7CFF 55%, #A78BFA 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ---- Provider / author ---- */
.mdl-provider {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 20px;
    font-size: 14.5px;
    color: var(--md-muted);
}
.mdl-provider-name {
    overflow-wrap: anywhere;
}
.mdl-copy {
    border: 0;
    background: transparent;
    color: var(--md-muted);
    padding: 4px 7px;
    margin-left: 4px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}
.mdl-copy:hover {
    background: rgba(99, 91, 255, .10);
    color: var(--md-accent);
}
.mdl-copy .mdl-copied {
    color: var(--md-green);
}

/* ---- Callout (short description) ---- */
.mdl-callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 660px;
    padding: 15px 18px;
    border-radius: 14px;
    background: var(--md-callout-bg);
    border: 1px solid var(--md-callout-border);
    font-size: 15px;
    line-height: 1.6;
    color: var(--md-text);
}
.mdl-callout-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-top: 1px;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--md-accent), var(--md-violet));
    font-size: 13px;
}

/* ---- Stats (price / context) ---- */
.mdl-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
}
.mdl-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 232px;
    min-height: 76px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--md-border);
    background: var(--md-stat-bg);
    box-shadow: var(--md-shadow);
}
.mdl-stat-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    font-size: 16px;
}
.mdl-stat-icon--price {
    color: var(--md-accent);
    background: rgba(99, 91, 255, .12);
}
.mdl-stat-icon--context {
    color: var(--md-cyan);
    background: rgba(18, 183, 233, .12);
}
[data-bs-theme="dark"] .mdl-stat-icon--price { color: #A5B4FF; background: rgba(99, 91, 255, .20); }
[data-bs-theme="dark"] .mdl-stat-icon--context { color: #67E8F9; background: rgba(18, 183, 233, .16); }

.mdl-stat-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.mdl-stat-label {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--md-muted);
}
.mdl-stat-value {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--md-text);
    overflow-wrap: anywhere;
}

/* ---- Tags ---- */
.mdl-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 19px;
}

.mdl-hero-actions {
    display: flex;
    margin-top: 24px;
}

.mdl-try-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #7C3AED, #3478F6);
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(52, 120, 246, .22);
    transition: transform .18s ease, box-shadow .18s ease;
}

.mdl-try-button:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(124, 58, 237, .3);
}
.mdl-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--md-muted);
    background: var(--md-tag-bg);
    border: 1px solid var(--md-tag-border);
}
.mdl-tag i {
    font-size: 10px;
    opacity: .7;
}

/* ==========================================================================
   AI wave (decorative, CSS-only animation)
   ========================================================================== */
.mdl-hero-wave {
    position: absolute;
    right: -2%;
    bottom: -3%;
    top: auto;
    width: 58%;
    height: 76%;
    pointer-events: none;
    overflow: visible;
    opacity: var(--md-wave-opacity);
    animation: mdl-wave-in .7s ease both;
    /* soft fade into hero background on the content side + dissolve at the right edge */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 20%, #000 82%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 20%, #000 82%, transparent 100%);
}
.mdl-wave-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    will-change: transform, opacity;
}
.mdl-wave-back {
    animation: mdl-wave-back 16s ease-in-out infinite alternate;
}
.mdl-wave-middle {
    animation: mdl-wave-middle 13s ease-in-out infinite alternate;
}
.mdl-wave-front {
    animation: mdl-wave-front 18s ease-in-out infinite alternate;
}
.mdl-wave-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 55% 60% at 70% 45%, rgba(124, 58, 237, .16), rgba(18, 183, 233, .07) 55%, transparent 78%);
    animation: mdl-wave-glow 12s ease-in-out infinite alternate;
    will-change: opacity;
}
[data-bs-theme="dark"] .mdl-wave-glow {
    background: radial-gradient(ellipse 55% 60% at 70% 45%, rgba(124, 58, 237, .22), rgba(18, 183, 233, .10) 55%, transparent 78%);
}

@keyframes mdl-wave-back {
    from { transform: translate(0, 0) scale(1); opacity: .65; }
    to   { transform: translate(7px, -4px) scale(1.012); opacity: .8; }
}
@keyframes mdl-wave-middle {
    from { transform: translate(0, 0) scale(1); opacity: .75; }
    to   { transform: translate(-6px, -5px) scale(1.015); opacity: .88; }
}
@keyframes mdl-wave-front {
    from { transform: translate(0, 0) scale(1); opacity: .8; }
    to   { transform: translate(8px, 4px) scale(1.01); opacity: .92; }
}
@keyframes mdl-wave-glow {
    from { opacity: .15; }
    to   { opacity: .25; }
}

@keyframes mdl-hero-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes mdl-wave-in {
    from { opacity: 0; }
    to   { opacity: var(--md-wave-opacity); }
}

/* ==========================================================================
   Information grid: About + Advantages
   ========================================================================== */
.mdl-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, .9fr);
    gap: 22px;
    margin-top: 22px;
}
.mdl-card {
    border: 1px solid var(--md-border);
    border-radius: 20px;
    background: var(--md-card);
    box-shadow: var(--md-shadow);
    padding: clamp(22px, 3vw, 36px);
    min-width: 0;
}
.mdl-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--md-text);
}
.mdl-card-title-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 15px;
    color: var(--md-accent);
    background: rgba(99, 91, 255, .12);
}
[data-bs-theme="dark"] .mdl-card-title-icon { color: #A5B4FF; background: rgba(99, 91, 255, .20); }

/* ---- About text ---- */
.mdl-description {
    max-width: 78ch;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--md-text);
}
.mdl-description p { margin-bottom: 1rem; }
.mdl-description h1, .mdl-description h2, .mdl-description h3, .mdl-description h4 {
    margin: 1.6rem 0 .9rem;
    font-weight: 650;
    color: var(--md-text);
    line-height: 1.3;
}
.mdl-description h2 { font-size: 1.35rem; }
.mdl-description h3 { font-size: 1.15rem; }
.mdl-description ul, .mdl-description ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.mdl-description li { margin-bottom: .4rem; }
.mdl-description strong { font-weight: 650; color: var(--md-accent); }
.mdl-description em { font-style: italic; opacity: .9; }
.mdl-description a { color: var(--md-accent-2); text-decoration: none; }
.mdl-description a:hover { text-decoration: underline; }
.mdl-description code {
    background: rgba(99, 91, 255, .08);
    color: var(--md-violet);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: .9em;
}
.mdl-description pre {
    background: rgba(99, 91, 255, .06);
    border: 1px solid var(--md-border);
    padding: 14px 16px;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 1rem;
}
.mdl-description pre code { background: transparent; padding: 0; color: inherit; }
.mdl-description blockquote {
    border-left: 3px solid var(--md-accent);
    padding-left: 1rem;
    margin: 0 0 1rem;
    color: var(--md-muted);
    font-style: italic;
}
.mdl-description img { max-width: 100%; border-radius: 10px; }

/* ---- Advantages ---- */
.mdl-adv-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.mdl-adv {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 74px;
    padding: 12px 10px;
    border-radius: 12px;
    transition: background-color .18s ease, transform .18s ease;
}
.mdl-adv + .mdl-adv {
    border-top: 1px solid var(--md-divider);
}
.mdl-adv:hover {
    background: rgba(99, 91, 255, .05);
    transform: translateX(2px);
}
.mdl-adv-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    font-size: 16px;
}
.mdl-adv-icon--violet { color: var(--md-violet); background: rgba(124, 58, 237, .12); }
.mdl-adv-icon--blue   { color: var(--md-accent-2); background: rgba(52, 120, 246, .12); }
.mdl-adv-icon--cyan   { color: var(--md-cyan); background: rgba(18, 183, 233, .12); }
.mdl-adv-icon--green  { color: var(--md-green); background: rgba(14, 159, 110, .12); }
[data-bs-theme="dark"] .mdl-adv-icon--violet { color: #C4B5FD; background: rgba(124, 58, 237, .22); }
[data-bs-theme="dark"] .mdl-adv-icon--blue   { color: #93C5FD; background: rgba(52, 120, 246, .20); }
[data-bs-theme="dark"] .mdl-adv-icon--cyan   { color: #67E8F9; background: rgba(18, 183, 233, .16); }
[data-bs-theme="dark"] .mdl-adv-icon--green  { color: #6EE7B7; background: rgba(14, 159, 110, .18); }

.mdl-adv-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.mdl-adv-title {
    font-size: 15px;
    font-weight: 650;
    color: var(--md-text);
}
.mdl-adv-desc {
    font-size: 13px;
    line-height: 1.45;
    color: var(--md-muted);
}

/* ---- Footer (back link) ---- */
.mdl-footer {
    display: flex;
    justify-content: flex-start;
    margin-top: 26px;
}
.mdl-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid var(--md-border);
    background: var(--md-card);
    color: var(--md-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.mdl-back:hover {
    color: var(--md-accent);
    border-color: var(--md-accent);
    background: rgba(99, 91, 255, .06);
}

/* ---- Copy toast ---- */
.copy-toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    padding: 10px 18px;
    border-radius: 10px;
    background: #172033;
    color: #fff;
    font-size: 13.5px;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.copy-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199px) {
    .model-details {
        /* fixed navbar is 90px tall — clear it */
        padding-top: 106px;
    }
    .mdl-hero {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    }
    .mdl-hero-content {
        padding-bottom: 36px;
    }
    .mdl-title {
        font-size: clamp(30px, 3.4vw, 44px);
    }
    .mdl-grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
    }
}

@media (max-width: 900px) {
    .mdl-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .model-details {
        /* fixed navbar is 90px tall — clear it */
        padding: 104px 14px 48px;
    }
    .mdl-hero {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .mdl-hero-content {
        padding: 26px 20px 32px;
    }
    .mdl-hero-wave {
        right: 0;
        width: 100%;
        height: 62%;
        opacity: .32;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 40%, #000 85%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, #000 40%, #000 85%, transparent 100%);
    }
    .mdl-title {
        font-size: clamp(26px, 7.4vw, 36px);
    }
    .mdl-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .mdl-stat {
        width: auto;
        min-height: 68px;
        padding: 10px 12px;
    }
    .mdl-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    .mdl-stat-value {
        font-size: 18px;
    }
    .mdl-callout {
        font-size: 14px;
        padding: 13px 15px;
    }
    .mdl-card {
        padding: 20px 16px;
        border-radius: 16px;
    }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .mdl-hero,
    .mdl-hero-wave,
    .mdl-wave-layer,
    .mdl-wave-glow {
        animation: none;
    }
    .mdl-adv,
    .mdl-copy,
    .mdl-back {
        transition: none;
    }
}
