/* ============================================================
   DEMO / SHOWCASE PAGE STYLES
   ============================================================ */

/* ---- Hero ---- */
.demo-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e3a5f 100%);
    padding: 4rem 0 3.5rem;
    position: relative;
    overflow: hidden;
    color: #fff;
}
.demo-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 70% 50%, rgba(37,99,235,0.18) 0%, transparent 70%);
    pointer-events: none;
}
.demo-hero-inner {
    display: flex;
    align-items: center;
    gap: 3rem;
    position: relative;
}
.demo-hero-text { flex: 1; }
.demo-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #93c5fd;
}
.demo-hero h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.demo-hero h1 .hl { color: #60a5fa; }
.demo-hero p {
    font-size: 1.05rem;
    color: #94a3b8;
    line-height: 1.7;
    max-width: 540px;
}
.demo-hero-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 2rem;
}
.demo-hero-stat strong {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
}
.demo-hero-stat span {
    font-size: 0.82rem;
    color: #94a3b8;
}
.demo-hero-visual {
    flex-shrink: 0;
    width: 200px;
    height: 160px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: rgba(255,255,255,0.18);
}
@media (max-width: 700px) {
    .demo-hero-visual { display: none; }
    .demo-hero-stats { gap: 1.5rem; }
}

/* ---- Filter Bar ---- */
.demo-filter {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
    position: sticky;
    top: 72px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.demo-filter-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.demo-filter-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}
.demo-filter-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.demo-filter-pill {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.demo-filter-pill:hover { border-color: #2563eb; color: #2563eb; }
.demo-filter-pill.active { background: #2563eb; border-color: #2563eb; color: #fff; }

/* ---- Main Grid ---- */
.demo-main { padding: 3rem 0 5rem; }

.demo-section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.demo-section-title i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}
.demo-count {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    background: #f1f5f9;
    border-radius: 999px;
    color: #6b7280;
}

/* ---- Project Cards Grid ---- */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

/* ---- Project Card ---- */
.demo-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}
.demo-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

/* Card header colored bar */
.demo-card-header {
    padding: 1.4rem 1.4rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
}
.demo-card-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--card-color, #2563eb);
    border-radius: 18px 18px 0 0;
}
.demo-card-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.demo-card-info { flex: 1; min-width: 0; }
.demo-card-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.3rem;
}
.demo-card-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 0.15rem;
}
.demo-card-domain {
    font-size: 0.78rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Browser preview frame */
.demo-preview {
    margin: 0 1rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    position: relative;
}
.demo-preview-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f1f5f9;
    border-bottom: 1px solid #e5e7eb;
}
.demo-preview-dots {
    display: flex;
    gap: 4px;
}
.demo-preview-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-red   { background: #ef4444; }
.dot-yel   { background: #f59e0b; }
.dot-grn   { background: #22c55e; }
.demo-preview-url {
    flex: 1;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.demo-preview-url i { color: #22c55e; font-size: 0.65rem; flex-shrink: 0; }

/* Screenshot preview wrapper */
.demo-screenshot-wrap {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
    cursor: pointer;
}
.demo-screenshot-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.4s ease, opacity 0.3s;
}
.demo-screenshot-wrap:hover img { transform: scale(1.03); }

/* Skeleton loader while image loads */
.demo-screenshot-wrap .img-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* Hover overlay with "Xem trước" */
.demo-screenshot-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}
.demo-screenshot-overlay span {
    background: rgba(255,255,255,0.95);
    color: #111;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    pointer-events: none;
}
.demo-screenshot-wrap:hover .demo-screenshot-overlay { background: rgba(0,0,0,0.28); }
.demo-screenshot-wrap:hover .demo-screenshot-overlay span { opacity: 1; transform: translateY(0); }

/* Card body */
.demo-card-body {
    padding: 1rem 1.4rem;
    flex: 1;
}
.demo-card-tagline {
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.55;
    margin-bottom: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.demo-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}
.demo-card-stat {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
}
.demo-card-stat i { font-size: 0.7rem; opacity: 0.7; }
.demo-card-stat strong { font-weight: 700; color: #111827; }
.demo-card-stat span { color: #6b7280; }

/* Card footer */
.demo-card-footer {
    padding: 0.875rem 1.4rem 1.25rem;
    display: flex;
    gap: 0.6rem;
    border-top: 1px solid #f3f4f6;
    flex-wrap: wrap;
}
.demo-btn-visit {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.15s, transform 0.15s;
    min-width: 0;
}
.demo-btn-visit:hover { opacity: 0.88; transform: translateY(-1px); }
.demo-btn-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #e5e7eb;
    transition: background 0.15s;
}
.demo-btn-detail:hover { background: #e5e7eb; }

/* ---- Fullscreen Modal ---- */
.demo-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
}
.demo-modal-backdrop.open {
    opacity: 1;
    pointer-events: all;
}
.demo-modal {
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    max-height: 820px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s;
    box-shadow: 0 24px 80px rgba(0,0,0,0.35);
}
.demo-modal-backdrop.open .demo-modal { transform: scale(1); }

.demo-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    background: #1e293b;
    flex-shrink: 0;
}
.demo-modal-dots {
    display: flex;
    gap: 6px;
}
.demo-modal-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}
.demo-modal-url-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #0f172a;
    border-radius: 8px;
    padding: 0.4rem 0.875rem;
    font-size: 0.85rem;
    color: #94a3b8;
    overflow: hidden;
}
.demo-modal-url-bar i { color: #22c55e; flex-shrink: 0; font-size: 0.75rem; }
.demo-modal-url-bar span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.demo-modal-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.demo-modal-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.875rem;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s;
}
.demo-modal-btn:hover { opacity: 0.85; }
.demo-modal-btn-close { background: #ef4444; color: #fff; }
.demo-modal-btn-open  { background: #2563eb; color: #fff; }

/* Modal body — screenshot preview */
.demo-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
}
.demo-modal-screenshot {
    width: 100%;
    max-width: 900px;
    max-height: 520px;
    object-fit: contain;
    object-position: top;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    display: block;
}
.demo-modal-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}
.demo-modal-cta a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.15s;
}
.demo-modal-cta a:hover { opacity: 0.88; transform: translateY(-1px); }
.demo-modal-cta-visit { background: #2563eb; color: #fff !important; }
.demo-modal-cta-detail { background: rgba(255,255,255,0.1); color: #e2e8f0 !important; border: 1px solid rgba(255,255,255,0.15); }

/* ---- Hidden cards when filtered ---- */
.demo-card.hidden { display: none; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .demo-grid { grid-template-columns: 1fr; }
    .demo-hero { padding: 2.5rem 0 2rem; }
    .demo-card-stats { grid-template-columns: 1fr; }
}
