.demo-page {
    --demo-primary: #2563eb;
    --demo-primary-soft: rgba(37, 99, 235, 0.12);
    --demo-primary-dark: #1d4ed8;
    --demo-text: #0f172a;
    --demo-muted: #64748b;
    --demo-border: rgba(148, 163, 184, 0.35);
    --demo-surface: rgba(255, 255, 255, 0.82);
    --demo-surface-solid: #ffffff;
    --demo-radius: 1.4rem;
}

.demo-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
    color: var(--demo-text);
    position: relative;
    overflow-x: hidden;
}

.demo-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 100% 80% at 50% -30%, rgba(37, 99, 235, 0.14), transparent 55%),
        radial-gradient(ellipse 60% 50% at 110% 40%, rgba(99, 102, 241, 0.1), transparent 50%),
        radial-gradient(ellipse 50% 45% at -10% 60%, rgba(59, 130, 246, 0.08), transparent 45%),
        linear-gradient(165deg, #f0f4ff 0%, #f8fafc 35%, #eef2ff 100%);
}

.demo-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath fill='%232563eb' fill-opacity='0.035' d='M20 0l3 9h9l-7 6 3 9-8-6-8 6 3-9-7-6h9z'/%3E%3C/svg%3E");
    background-size: 40px 40px;
    pointer-events: none;
}

.demo-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.85rem 1rem;
}

@media (min-width: 768px) {
    .demo-topbar {
        padding: 1rem 1.5rem;
    }
}

.demo-topbar-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
    background: var(--demo-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--demo-border);
    border-radius: 999px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.demo-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.demo-logo-img {
    height: 36px;
    width: auto;
    display: block;
}

@media (min-width: 768px) {
    .demo-logo-img {
        height: 40px;
    }
}

.demo-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
}

.demo-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    border-radius: 999px;
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.9);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.demo-back-link:hover {
    color: var(--demo-primary);
    background: #eff6ff;
    border-color: rgba(37, 99, 235, 0.25);
}

.demo-back-link i {
    font-size: 0.75rem;
    opacity: 0.9;
}

.demo-lang {
    position: relative;
    z-index: 200;
}

.demo-lang .modern-language-selector {
    z-index: 201;
}

.demo-lang .language-options {
    right: 0;
    left: auto;
}

.demo-main {
    position: relative;
    z-index: 1;
    padding: 1.25rem 0 3rem;
}

@media (min-width: 768px) {
    .demo-main {
        padding: 1.75rem 0 3.5rem;
    }
}

.demo-main .demo-container {
    width: 100%;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

@media (min-width: 768px) {
    .demo-main .demo-container {
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }
}

@media (min-width: 1400px) {
    .demo-main .demo-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.demo-hero {
    text-align: center;
    margin-bottom: 2.5rem;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

.demo-hero-title {
    font-size: clamp(1.5rem, 4.2vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--demo-text);
    margin: 0 0 0.5rem;
    line-height: 1.15;
    background: linear-gradient(120deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.demo-hero-sub {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--demo-muted);
    margin: 0;
    font-weight: 400;
}

.designs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .designs-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
        gap: 1.65rem 1.85rem;
    }
}

@media (min-width: 1200px) {
    .designs-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
        gap: 1.85rem 2rem;
    }
}

@media (min-width: 1600px) {
    .designs-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
        gap: 2rem;
    }
}

.design-card {
    background: var(--demo-surface-solid);
    border-radius: var(--demo-radius);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition:
        box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.35s ease;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.design-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 20px 40px -12px rgba(37, 99, 235, 0.18),
        0 8px 16px -8px rgba(15, 23, 42, 0.08);
    border-color: rgba(37, 99, 235, 0.22);
}

.design-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 260px;
    max-height: none;
    overflow: hidden;
    position: relative;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
}

@media (min-width: 768px) {
    .design-image {
        min-height: 300px;
    }
}

@media (min-width: 1200px) {
    .design-image {
        min-height: 340px;
    }
}

@media (min-width: 1600px) {
    .design-image {
        min-height: 380px;
    }
}

.design-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.design-card:hover .design-image img {
    transform: scale(1.05);
}

.design-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.45) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.design-card:hover .design-overlay {
    opacity: 1;
}

.design-info {
    padding: 1.4rem 1.5rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px) {
    .design-info {
        padding: 1.5rem 1.65rem 1.65rem;
    }
}

.design-title {
    color: var(--demo-text);
    font-size: 1.2rem;
    margin: 0 0 0.4rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .design-title {
        font-size: 1.3rem;
    }
}

.design-description {
    color: var(--demo-muted);
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    flex: 1;
}

@media (min-width: 768px) {
    .design-description {
        font-size: 0.95rem;
    }
}

.view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: linear-gradient(135deg, var(--demo-primary) 0%, var(--demo-primary-dark) 100%);
    color: #fff;
    padding: 0.82rem 1.35rem;
    border-radius: 0.9rem;
    font-weight: 600;
    font-size: 0.92rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32);
}

.view-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.38);
}

.view-button:focus-visible {
    outline: 2px solid var(--demo-primary);
    outline-offset: 3px;
}

.modal-overlay.demo-modal {
    z-index: 1055;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--demo-surface-solid);
    padding: 1.85rem 1.45rem 1.45rem;
    border-radius: var(--demo-radius);
    width: 100%;
    max-width: 420px;
    text-align: center;
    transform: translateY(14px) scale(0.97);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 28px 56px -16px rgba(15, 23, 42, 0.4);
    border: 1px solid var(--demo-border);
    position: relative;
}

.demo-modal .modal-content {
    overflow: visible !important;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.demo-modal-x {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 20;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 50%;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    pointer-events: auto;
}

.demo-modal-x:hover {
    background: #e2e8f0;
    color: var(--demo-text);
}

.qr-container {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 1rem;
    padding: 2.35rem 1.2rem 1.65rem;
    margin-top: 0.45rem;
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.95);
    z-index: 1;
}

.qr-info {
    position: absolute;
    top: -0.8rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: var(--demo-text);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--demo-surface-solid);
    padding: 0.48rem 1rem;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.95);
    white-space: nowrap;
    max-width: min(100%, calc(100% - 3.5rem));
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-container img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 0.65rem;
}

.modal-buttons {
    display: flex;
    gap: 0.65rem;
    justify-content: center;
    margin-top: 1.3rem;
    flex-wrap: wrap;
}

.modal-button {
    padding: 0.65rem 1.15rem;
    border-radius: 0.85rem;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-decoration: none;
    border: 1px solid transparent;
    line-height: 1.4;
}

.desktop-view {
    background: var(--demo-primary);
    color: #fff;
    border-color: var(--demo-primary);
}

.desktop-view:hover {
    background: var(--demo-primary-dark);
    border-color: var(--demo-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.38);
}

.close-modal {
    background: var(--demo-surface-solid);
    color: var(--demo-primary);
    border-color: rgba(37, 99, 235, 0.3);
}

.close-modal:hover {
    background: #eff6ff;
    transform: translateY(-1px);
}

@media (max-width: 576px) {
    .demo-topbar-inner {
        border-radius: 1.15rem;
        padding: 0.55rem 0.85rem;
    }

    .demo-topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .demo-back-link span {
        display: none;
    }

    .demo-back-link {
        padding: 0.5rem 0.75rem;
    }

    .designs-grid {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }

    .modal-content {
        padding: 1.5rem 1.1rem 1.25rem;
    }

    .qr-container img {
        width: 180px;
        height: 180px;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-button {
        width: 100%;
    }
}
