@import url("../css/icons.css");

:root {
    --bg-color: #000;
    --sidebar-bg: #070707;
    --surface-color: #0d0d0d;
    --surface-hover: #151515;
    --text-color: #fff;
    --text-light: #a3a3a3;
    --text-muted: #686868;
    --border-color: rgba(255, 255, 255, 0.09);
    --border-soft: rgba(255, 255, 255, 0.05);
    --color-classic-1: rgba(255, 255, 255, 0.035);
    --color-classic-2: rgba(30, 30, 30, 0.34);
    --color-classic-1-eco: rgba(10, 10, 10, 1);
    --color-classic-2-eco: rgba(20, 20, 20, 1);
    --color-pixypurple-dark-transluscent: rgba(47, 27, 54, 0.48);

    --color-pixypurple-light: rgb(180, 0, 255);
    --color-pixypurple-medium: rgb(120, 0, 160);
    --color-pixypurple-dark: rgb(75, 0, 100);

    --radius-xs: 10px;
    --radius-s: 12px;
    --radius-m: 18px;
    --radius-l: 30px;
    --radius-xl: 40px;
    --radius-pill: 50px;
    --radius-round: 999px;

    --site-header-h: 60px;

    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.28);
    --shadow-purple: 0 0 28px rgba(120, 0, 160, 0.16);
}

html {
    font-size: 16px;
}

@font-face {
    font-family: "Oxygen";
    src: url("../css/fonts/Font-Oxygen-Regular.ttf") format("truetype");
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg-color);
}

html,
body {
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: "Oxygen", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    content: "";
    background:
        linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.86)),
        url("../css/bg/bg_r_purple.png") center / cover no-repeat;
    pointer-events: none;
}

main {
    flex: 1;
    padding-top: 60px;
    overflow-y: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.main-content::-webkit-scrollbar {
    display: none;
}


button,
input,
select {
    font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-pixypurple-light);
    outline-offset: 3px;
}

.app-container {
    display: flex;
    flex: 1 0 auto;
}

.sidebar {
    position: fixed;
    z-index: 10;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: 320px;
    min-width: 320px;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border-right: 1px solid var(--border-color);
    background: rgba(8, 8, 8, 0.18);
    color: var(--text-color);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.18);
}

.sidebar::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    content: "";
    pointer-events: none;
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    position: relative;
    color: var(--text-color);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.sidebar-tools {
    position: absolute;
    z-index: 4;
    top: var(--sidebar-header-overlap, var(--site-header-h));
    right: 0;
    left: 0;
    padding: 8px 14px 10px;
    overflow: hidden;
    isolation: isolate;
    background: transparent;
    border-bottom: 1px solid var(--border-soft);
}

.sidebar-tools::before,
.component-pagination::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: rgba(10, 10, 14, 0.42);
    content: "";
    pointer-events: none;
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.sidebar-site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    margin-bottom: 8px;
}

.sidebar-site-nav a {
    color: var(--text-light);
    font-size: 0.7rem;
    text-decoration: none;
    text-underline-offset: 3px;
    transition: color 180ms ease, text-decoration-color 180ms ease;
}

.sidebar-site-nav a:hover {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: #7c2bce;
}

.search-group {
    margin-bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 6px;
}

.search-input,
.category-select {
    width: 100%;
    min-width: 0;
    height: 32px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 0.78rem;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search-input {
    padding: 0 10px;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:hover,
.category-select:hover {
    border-color: rgba(180, 0, 255, 0.35);
    background: var(--surface-hover);
}

.search-input:focus,
.category-select:focus {
    border-color: var(--color-pixypurple-light);
    box-shadow: 0 0 0 3px rgba(180, 0, 255, 0.14);
    outline: none;
}

.category-select {
    padding: 0 7px;
    cursor: pointer;
}

.component-pagination {
    position: absolute;
    z-index: 4;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px 12px;
    overflow: hidden;
    isolation: isolate;
    border-top: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.component-pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xs);
    background: var(--surface-hover);
    color: var(--text-color);
    cursor: pointer;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.component-pagination button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(180, 0, 255, 0.4);
    background: rgba(75, 0, 100, 0.24);
}

.component-pagination .pixy-icon {
    width: 16px;
    height: 16px;
}

.component-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.category-select option {
    background: var(--surface-color);
    color: var(--text-color);
}

.component-list {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    padding: var(--sidebar-tools-h, 180px) 14px var(--sidebar-pager-h, 16px);
}

.component-card {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-s);
    background: rgba(30, 30, 30, 0.18);
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, border-radius 180ms ease, box-shadow 180ms ease;
}

.component-card:hover {
    transform: translateY(-2px);
    border-color: rgba(180, 0, 255, 0.4);
    border-radius: var(--radius-m);
    background: rgba(75, 0, 100, 0.24);
    box-shadow: 0 7px 11px rgba(0, 0, 0, 0.35);
}

.component-card.active {
    border-color: rgba(180, 0, 255, 0.55);
    background: linear-gradient(100deg, var(--color-pixypurple-dark-transluscent), rgba(120, 0, 160, 0.06));
    box-shadow: inset 0 0 0 1px rgba(180, 0, 255, 0.18), var(--shadow-purple);
}

.component-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: var(--radius-xs);
    background: var(--surface-hover);
    color: var(--color-pixypurple-light);
    font-size: 1.1rem;
}

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

.component-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
    min-width: 0;
}

.component-name,
.component-category {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.component-name {
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 650;
}

.ai-badge,
.category-tag.ai-tag {
    flex: 0 0 auto;
    padding: 2px 7px;
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: var(--radius-pill);
    background: rgba(26, 86, 219, 0.28);
    color: #bae6fd;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.category-tag.ai-tag {
    padding: 4px 9px;
    font-size: 0.68rem;
}

.component-category {
    color: var(--text-muted);
    font-size: 0.67rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.main-content {
    width: calc(100% - 320px);
    margin-left: 320px;
    padding: 84px 24px 52px;
}

.studio-top,
.studio-layout,
.preview-header {
    width: 100%;
    max-width: none;
}

/* Composants PDL, recopiés et isolés pour ne pas affecter l'aperçu. */
.site-header {
    position: fixed;
    z-index: 25;
    top: 0;
    left: 0;
    display: flex;
    width: 100%;
    height: 60px;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(8, 8, 8, 0.34);
    backdrop-filter: blur(12px) saturate(125%);
    -webkit-backdrop-filter: blur(12px) saturate(125%);
    isolation: isolate;
}

.site-header img {
    z-index: 1;
    height: 50px;
    border-radius: var(--radius-xs);
}

.site-menu {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 80px 20px 20px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.site-menu.open {
    opacity: 1;
    pointer-events: auto;
}

.site-menu a {
    color: #fff;
    font-size: 28px;
    text-align: center;
    text-decoration: underline;
    text-decoration-color: #7c2bce;
    transition: transform 0.3s ease;
}

.site-menu a:hover {
    transform: translateY(-3px);
}

.menu-btn {
    z-index: 1;
    display: flex;
    width: 35px;
    height: 26px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.menu-btn span {
    display: block;
    height: 4px;
    border-radius: 2px;
    background: #7c2bce;
    transition: 0.15s;
}

.menu-btn.open span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.menu-btn.open span:nth-child(2) {
    visibility: hidden;
    opacity: 0;
    transition-delay: 0.03s;
}

.menu-btn.open span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

.site-footer {
    position: relative;
    z-index: 20;
    flex-shrink: 0;
    width: calc(100% - 320px);
    margin-top: auto;
    margin-left: 320px;
    padding: 6px 0;
    background: rgba(80, 80, 80, 0.2);
    text-align: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.site-footer p,
.site-footer a {
    color: #fff;
    font-size: 0.95rem;
}

.site-footer a {
    text-decoration-color: #7c2bce;
}

.dev-page > .site-footer,
.dev-page .site-footer {
    width: 100%;
    margin-left: 0;
}

/* Pages d'accueil et de licence */
.dev-page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.dev-page > main {
    display: flex;
    flex: 1 0 auto;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 84px 0 36px;
}

.dev-home-page,
.license-page {
    position: relative;
    z-index: 0;
    width: min(100% - 32px, 980px);
    margin: 0 auto;
    padding: 0;
}

.dev-home-page > .dev-hero,
.dev-home-page > .dev-tools,
.license-page > .license-card {
    width: min(100% - 32px, 980px);
}

.dev-hero,
.license-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: rgba(13, 13, 13, 0.42);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px) saturate(115%);
    -webkit-backdrop-filter: blur(10px) saturate(115%);
}

.dev-hero {
    padding: clamp(28px, 6vw, 64px);
    text-align: center;
}

.dev-hero h1,
.license-card h1 {
    color: var(--text-color);
    font-size: clamp(2rem, 6vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -0.07em;
    line-height: 1;
}

.dev-hero p {
    max-width: 650px;
    margin: 20px auto 0;
    color: var(--text-light);
    font-size: 1rem;
}

.dev-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.dev-tool {
    display: block;
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-m);
    background: rgba(13, 13, 13, 0.5);
    color: var(--text-color);
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.dev-tool:hover {
    transform: translateY(-3px);
    border-color: rgba(180, 0, 255, 0.5);
    background: rgba(75, 0, 100, 0.24);
}

.dev-tool h2 {
    color: var(--text-color);
    font-size: 1.2rem;
}

.dev-tool p {
    margin-top: 8px;
    color: var(--text-light);
    font-size: 0.82rem;
}

.license-page {
    max-width: 840px;
}

.license-page > .license-card {
    max-width: 840px;
}

.license-card {
    padding: clamp(24px, 5vw, 52px);
}

.license-card h1 {
    margin-bottom: 22px;
    font-size: clamp(2rem, 5vw, 3.3rem);
}

.license-card p {
    color: var(--text-light);
    font-size: 0.92rem;
}

.license-text {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-s);
    background: rgba(0, 0, 0, 0.35);
    color: #dedede;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    white-space: normal;
}

.dev-back {
    display: inline-block;
    margin-top: 24px;
    padding: 10px 20px;
    border: 1px solid rgba(180, 0, 255, 0.38);
    border-radius: var(--radius-pill);
    background: rgba(120, 0, 160, 0.15);
    color: var(--text-color);
    text-decoration: none;
}

.dev-back:hover {
    background: rgba(120, 0, 160, 0.3);
}

.preview-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    margin: 0 0 24px;
    padding: 20px 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-l);
    background: var(--color-classic-1);
    backdrop-filter: blur(5px);
}

.preview-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
}

.preview-header h2 {
    flex: 1;
    min-width: 0;
    font-size: clamp(1.45rem, 2.6vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
}

.preview-description {
    color: var(--text-light);
    font-size: 0.88rem;
}

.preview-tags:empty {
    display: none;
}

.preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-tag {
    padding: 4px 9px;
    border: 1px solid var(--color-pixypurple-dark);
    border-radius: var(--radius-pill);
    background: var(--color-pixypurple-dark-transluscent);
    color: var(--text-light);
    font-size: 0.68rem;
}

.preview-container,
.studio-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.studio-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.preview-area,
.code-area {
    min-height: 430px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: var(--color-classic-2);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}

.preview-area {
    display: grid;
    min-height: 430px;
    place-items: center;
    padding: 32px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.015) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 2px, transparent 2px),
        rgba(8, 8, 8, 0.20);
    background-size: 32px 32px;
}

.preview-area:hover,
.code-area:hover {
    border-color: rgba(180, 0, 255, 0.34);
}

.code-area {
    padding: 18px;
    background: rgba(10, 10, 10, 0.68);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    padding-bottom: 4px;
}

.code-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.code-copy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-light);
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.code-copy-btn .pixy-icon {
    width: 18px;
    height: 18px;
}

.code-copy-btn:hover {
    border-color: var(--color-pixypurple-medium);
    color: #efcaff;
}

.code-copy-btn.is-copied {
    border-color: rgba(74, 222, 128, 0.55);
    color: #4ade80;
}

.mobile-view-tabs {
    display: none;
}

.mobile-app-title {
    display: none;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.code-language {
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.code-language:hover {
    border-color: var(--border-color);
    color: var(--text-color);
}

.code-language.selected {
    border-color: var(--color-pixypurple-medium);
    background: var(--color-pixypurple-dark-transluscent);
    color: #efcaff;
}

.code-block {
    min-height: 350px;
    max-height: 500px;
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-s);
    background: #050505;
    color: #dedede;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    tab-size: 2;
}

.code-block code {
    white-space: pre;
}

.loading {
    padding: 28px 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
        min-width: 280px;
    }

    .main-content {
        width: calc(100% - 280px);
        margin-left: 280px;
        padding: 84px 28px 40px;
    }

    .site-footer {
        width: calc(100% - 280px);
        margin-left: 280px;
    }

    .preview-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

.library-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-pixypurple-medium, #7c2bce);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.library-menu-btn .pixy-icon {
    width: 24px;
    height: 24px;
}

.library-menu-btn:hover,
.library-menu-btn:focus-visible {
    background: rgba(120, 0, 160, 0.18);
    color: var(--color-pixypurple-light, rgb(180, 0, 255));
}

.library-backdrop {
    display: none;
}

@media (max-width: 760px) {
    .app-container {
        display: block;
    }

    .componland-page .site-header {
        gap: 10px;
    }

    .componland-page .site-logo {
        display: none;
    }

    .componland-page .mobile-app-title {
        display: block;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .componland-page .library-menu-btn {
        display: inline-flex;
    }

    .componland-page .site-menu.open {
        z-index: 30;
    }

    .componland-page .library-backdrop {
        position: fixed;
        z-index: 21;
        inset: 60px 0 0;
        display: none;
        background: rgba(0, 0, 0, 0.45);
        transition: opacity 0.25s ease;
    }

    .componland-page .library-backdrop:not([hidden]) {
        display: block;
    }

    .componland-page.library-open {
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        z-index: 22;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(86vw, 320px);
        min-width: 0;
        max-height: none;
        border-right: 1px solid var(--border-color);
        border-bottom: 0;
        padding: 0;
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.2, 0, 0, 1);
        pointer-events: none;
    }

    .sidebar.open {
        transform: translateX(0);
        pointer-events: auto;
    }

    .sidebar-header {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 76px 16px 28px;
    }

    .site-footer {
        width: 100%;
        margin-left: 0;
    }

    .mobile-view-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 4px;
    }

    .mobile-view-tab {
        min-height: 44px;
        padding: 10px 14px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-pill);
        background: rgba(255, 255, 255, 0.03);
        color: var(--text-muted);
        cursor: pointer;
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
    }

    .mobile-view-tab.on {
        border-color: var(--color-pixypurple-medium);
        background: var(--color-pixypurple-dark-transluscent);
        color: #efcaff;
    }

    .preview-area.mobile-hidden,
    .code-area.mobile-hidden {
        display: none;
    }

    .preview-header {
        margin-bottom: 16px;
        padding: 16px;
    }

    .component-pagination button {
        min-width: 44px;
        min-height: 44px;
    }

    .component-card {
        min-height: 56px;
    }

    .preview-container {
        grid-template-columns: 1fr;
    }

    .preview-area,
    .code-area {
        min-height: 340px;
    }

    .dev-home,
    .dev-home-page,
    .license-page,
    .dev-home-page > .dev-hero,
    .dev-home-page > .dev-tools,
    .license-page > .license-card {
        width: min(100% - 24px, 980px);
    }
}

@media (max-width: 430px) {
    .search-group {
        grid-template-columns: 1fr;
    }

    .preview-header h2 {
        font-size: 1.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}


/* Page A propos - DevTools */
.dev-about-page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.dev-about-page > main {
    display: flex;
    flex: 1 0 auto;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 84px 0 36px;
}

.dev-about-hero,
.dev-about-content {
    width: min(100% - 32px, 980px);
    margin: 0 auto;
}

.dev-about-hero {
    text-align: center;
    margin-bottom: 32px;
}

.dev-about-hero h1 {
    color: var(--text-color);
    font-size: clamp(2rem, 6vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -0.07em;
    line-height: 1;
}

.dev-about-hero p {
    max-width: 650px;
    margin: 20px auto 0;
    color: var(--text-light);
    font-size: 1rem;
}

.dev-about-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.about-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-l);
    background: rgba(13, 13, 13, 0.42);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px) saturate(115%);
    -webkit-backdrop-filter: blur(10px) saturate(115%);
    overflow: hidden;
}

.about-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.015);
}

.about-card-header h2 {
    color: var(--text-color);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.about-card-body {
    padding: 24px;
}

.about-card-body p {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.about-card-body p:last-child {
    margin-bottom: 0;
}

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

.about-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-light);
    font-size: 0.88rem;
    line-height: 1.5;
}

.about-list li:last-child {
    border-bottom: none;
}

.about-list strong {
    color: var(--color-pixypurple-light);
    font-weight: 600;
}

.dev-about-footer {
    margin-top: 32px;
    text-align: center;
}

.dev-about-footer a {
    padding: 12px 24px;
    border: 1px solid rgba(180, 0, 255, 0.38);
    border-radius: var(--radius-pill);
    background: rgba(120, 0, 160, 0.15);
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.92rem;
    transition: background 180ms ease;
}

.dev-about-footer a:hover {
    background: rgba(120, 0, 160, 0.3);
}

/* Ajustements responsive pour les pages about */
@media (max-width: 760px) {
    .dev-about-page > main {
        padding: 30px 16px;
    }
    
    .dev-about-hero {
        margin-bottom: 24px;
    }
}

@media (max-width: 430px) {
    .dev-about-hero h1 {
        font-size: 1.8rem;
    }
    
    .about-card {
        border-radius: var(--radius-m);
    }
    
    .about-card-header {
        padding: 16px 20px;
    }
    
    .about-card-body {
        padding: 20px;
    }
}

/* ==========================================================================
   AI Button styles for ComponLand
   ========================================================================== */
.ai-open-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    background: rgba(180, 0, 255, 0.12);
    border: 1px solid rgba(180, 0, 255, 0.35);
    border-radius: var(--radius-pill);
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    transition: all 0.2s ease;
}

.ai-open-btn .pixy-icon {
    width: 16px;
    height: 16px;
}

.ai-open-btn:hover {
    background: rgba(180, 0, 255, 0.28);
    border-color: var(--color-pixypurple-light);
    box-shadow: 0 0 10px rgba(180, 0, 255, 0.22);
    transform: translateY(-1px);
}

.ai-open-btn.active {
    background: var(--color-pixypurple-light);
    border-color: var(--color-pixypurple-light);
    box-shadow: var(--shadow-purple);
    color: #fff;
}

.ai-open-btn[hidden] {
    display: none !important;
}

/* ==========================================================================
   ComponLand AI workspace — bottom composer + centered loader
   ========================================================================== */

#aiInterface {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 196px);
    padding-bottom: 24px;
}

#standardInterface[hidden],
#aiInterface[hidden],
#aiLoadingOverlay[hidden],
#aiResultContainer[hidden] {
    display: none !important;
}

.ai-workspace {
    position: relative;
    flex: 1;
    min-height: 240px;
    overflow: hidden;
    border-radius: var(--radius-l);
}

.ai-workspace #aiResultContainer {
    position: relative;
    z-index: 2;
}

.ai-result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 8px;
}

.ai-result-actions .dev-back {
    margin-top: 0;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ai-result-actions .pixy-icon {
    width: 16px;
    height: 16px;
}

.ai-result-actions .dev-back:disabled {
    opacity: 0.55;
    cursor: wait;
}

#aiLoadingOverlay {
    position: absolute;
    z-index: 6;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    overflow: hidden;
    background: transparent;
    pointer-events: none;
}

#aiLoadingOverlay .pdl-ai-cancel {
    pointer-events: auto;
}

.ai-loading-label {
    margin: 0;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(8, 8, 12, 0.4);
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    font-family: "Segoe UI", system-ui, sans-serif;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.ai-composer {
    position: sticky;
    z-index: 17;
    bottom: 12px;
    margin-top: 8px;
}

.ai-composer .pdl-ai-prompt {
    max-width: none;
}

#aiInterface #aistatus {
    min-height: 18px;
    margin: 8px auto 0;
    max-width: 860px;
}

#aiInterface:has(#aiLoadingOverlay:not([hidden])) .pdl-ai-send {
    opacity: 0.65;
    pointer-events: none;
}

body:has(#aiInterface:not([hidden])) .site-footer {
    z-index: 8;
}

@media (max-width: 1024px) {
    .ai-composer {
        bottom: 12px;
    }
}

@media (max-width: 760px) {
    #aiInterface {
        min-height: calc(100vh - 220px);
        padding-bottom: 24px;
    }

    .ai-composer {
        bottom: 8px;
    }
}

@media (vertical-viewport-segments: 2),
(spanning: single-fold-horizontal) {
    .componland-page {
        height: 100dvh;
        overflow: hidden;
    }

    .componland-page .site-footer {
        display: none;
    }

    .componland-page .app-container {
        display: grid;
        grid-template-columns: minmax(180px, 34%) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
        flex: 1;
        min-height: 0;
        height: calc(100dvh - 60px);
    }

    .componland-page .sidebar {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        grid-row: 2;
        grid-column: 1;
        width: auto;
        min-width: 0;
        height: auto;
        max-height: none;
        transform: none !important;
        pointer-events: auto;
        z-index: 6;
        border-right: 1px solid var(--border-color);
    }

    .componland-page .sidebar-tools {
        top: 0;
    }

    .componland-page .library-menu-btn,
    .componland-page .library-backdrop {
        display: none !important;
    }

    .componland-page .main-content {
        display: contents;
        width: auto;
        margin: 0;
        padding: 0;
    }

    .componland-page #standardInterface:not([hidden]),
    .componland-page #aiInterface:not([hidden]) {
        display: contents;
    }

    .componland-page .studio-top {
        grid-row: 1;
        grid-column: 1 / -1;
        min-height: 0;
        overflow: auto;
        padding: 10px 12px 8px;
    }

    .componland-page .code-area {
        grid-row: 2;
        grid-column: 2;
        min-height: 0;
        overflow: auto;
        margin: 8px 12px 12px 8px;
    }

    .componland-page .mobile-view-tabs {
        display: none !important;
    }

    .componland-page .preview-area,
    .componland-page .code-area {
        min-height: 0;
    }

    .componland-page .preview-area.mobile-hidden {
        display: grid !important;
    }

    .componland-page .code-area.mobile-hidden {
        display: block !important;
    }

    .componland-page .preview-header {
        margin-bottom: 8px;
        padding: 12px 14px;
    }

    .componland-page .ai-workspace {
        min-height: 120px;
        flex: 1;
    }

    .componland-page .ai-composer {
        position: sticky;
        bottom: 0;
        margin: 0;
        padding: 8px 0 4px;
        background: rgba(8, 8, 12, 0.32);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
}

body.lowperf::before {
    background: #050505;
}

body.lowperf .sidebar,
body.lowperf .sidebar::before,
body.lowperf .sidebar-tools::before,
body.lowperf .component-pagination::before,
body.lowperf .site-header,
body.lowperf .site-menu,
body.lowperf .site-footer,
body.lowperf .preview-header,
body.lowperf .preview-area,
body.lowperf .code-area,
body.lowperf .dev-hero,
body.lowperf .license-card,
body.lowperf .about-card,
body.lowperf .ai-composer,
body.lowperf .componland-page .ai-composer {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.lowperf .sidebar::before,
body.lowperf .sidebar-tools::before,
body.lowperf .component-pagination::before {
    display: none;
}

body.lowperf .sidebar {
    background: var(--color-classic-1-eco);
    box-shadow: none;
}

body.lowperf .sidebar-tools,
body.lowperf .component-pagination {
    background: var(--color-classic-1-eco);
}

body.lowperf .site-header,
body.lowperf .site-menu {
    background: var(--color-classic-1-eco);
}

body.lowperf .site-footer {
    background: var(--color-classic-2-eco);
}

body.lowperf .preview-header {
    background: var(--color-classic-1-eco);
}

body.lowperf .preview-area,
body.lowperf .code-area,
body.lowperf .dev-hero,
body.lowperf .license-card,
body.lowperf .about-card {
    background: var(--color-classic-2-eco);
    box-shadow: none;
}

body.lowperf .component-card.active {
    box-shadow: none;
}

body.lowperf .dev-tool:hover,
body.lowperf .site-menu a:hover,
body.lowperf .component-card:hover,
body.lowperf .component-pagination button:hover:not(:disabled),
body.lowperf .ai-open-btn:hover {
    transform: none;
    box-shadow: none;
}

.ai-style-label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
}

.ai-style-select {
    width: 100%;
    margin-bottom: 10px;
}

#favoriteComponentBtn.is-on {
    color: rgb(255, 210, 80);
    border-color: rgba(255, 210, 80, 0.45);
}

#favoriteComponentBtn .favorite-mark {
    font-size: 1.05rem;
    line-height: 1;
}

.component-card.is-favorite {
    border-color: rgba(255, 210, 80, 0.35);
}

.component-card .favorite-badge {
    margin-left: 6px;
    color: rgb(255, 210, 80);
    font-size: 0.82rem;
}
