/* Demos Page Styles */

/* Color Variables - Synchronized with blog stylesheet */
:root {
    /* Base colors from blog stylesheet - DO NOT MODIFY without updating blog-stylesheet.css */
    --clr-white: #ffffff;
    --clr-white-80: #ffffffc7;
    --clr-white-60: #ffffff99;
    --clr-white-40: #ffffff68;
    --clr-white-20: rgba(255, 255, 255, 0.2);
    --clr-white-10: rgba(255, 255, 255, 0.074);
    --clr-black: #000000;
    --clr-light-background: #0d1014;
    --clr-light-background-blue: #1D242D;
    --clr-secondary-text: var(--clr-white-80);
    --clr-link-blue: #58a0ff;
    --clr-light-border: #22282d;
    
    /* Demo-specific color variables - all mapped to blog stylesheet colors */
    --clr-demo-card-bg: var(--clr-light-background); /* Card backgrounds */
    --clr-demo-border: var(--clr-light-border); /* Default borders */
    --clr-demo-border-hover: var(--clr-white-60); /* Interactive highlights */
    --clr-demo-text-muted: var(--clr-secondary-text); /* Secondary text and labels */
    --clr-demo-tag-bg: rgba(255, 255, 255, 0.074); 
    --clr-demo-tag-font: var(--clr-white-60);
    --clr-demo-tag-border: var(--clr-white-10); 
    --clr-demo-button-primary: linear-gradient(135deg, var(--clr-link-blue) 0%, var(--clr-link-blue) 100%);
    --clr-demo-button-primary-hover: linear-gradient(135deg, var(--clr-link-blue) 0%, var(--clr-light-background-blue) 100%);
    --clr-demo-button-secondary-bg: var(--clr-light-background);
    --clr-demo-button-secondary-border: var(--clr-light-border);
    --clr-demo-button-secondary-hover-bg: var(--clr-light-background-blue);
    --clr-demo-button-secondary-hover-border: var(--clr-secondary-text);
    --clr-demo-detail-gradient: linear-gradient(135deg, var(--clr-link-blue) 0%, var(--clr-secondary-text) 100%);
    
    /* Font variables from blog stylesheet */
    --ff-main: 'Inter', sans-serif;
    --fw-light: 300;
    --fw-normal: 400;
    --fw-semi: 500;
    --fw-bold: 600;
}

.demos-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 10px;
    /* background-color: var(--clr-light-background); */
    min-height: 100vh;
}

.demos-hero {
    color: var(--clr-white);
    margin-bottom: 20px;
}

/* Legacy styles for non-collapsible demos (index page) */
.demos-hero:not(.collapsible-header) h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--clr-white) 0%, var(--clr-white-80) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.demos-hero:not(.collapsible-header) p {
    font-size: 1.2rem;
    color: var(--clr-demo-text-muted);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 400;
}

.demos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.demo-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
}

.demo-card-link:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-5px);
}

.demo-card-link:hover .demo-card {
    border-color: var(--clr-demo-border-hover);
    box-shadow: 0 20px 40px rgba(88, 160, 255, 0.1);
}

.demo-card {
    background: var(--clr-demo-card-bg);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--clr-demo-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    position: relative;
}

/* Blur overlay on hover */
.demo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

/* Launch Demo button overlay */
.demo-card::after {
    content: 'Launch Demo';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--clr-white);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--ff-main);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

/* Show overlay and button on hover */
.demo-card-link:hover .demo-card::before {
    opacity: 1;
}

.demo-card-link:hover .demo-card::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.demo-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.demo-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.demo-card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.demo-card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    font-size: 2rem;
}

.demo-card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--clr-white);
    margin-bottom: 12px;
    line-height: 1.3;
}

.demo-card-description {
    color: var(--clr-demo-text-muted);
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.demo-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 15px;
}

.demo-stat {
    text-align: center;
    flex: 1;
}

.demo-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--clr-white);
    display: block;
    margin-bottom: 4px;
}

.demo-stat-label {
    font-size: 0.8rem;
    color: var(--clr-demo-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.demo-tag {
    background: var(--clr-demo-tag-bg);
    color: var(--clr-demo-tag-font);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--clr-demo-tag-border);
}

.demo-questions {
    margin-bottom: 24px;
    background: var(--clr-black);
    border-radius: 12px;
    padding: 20px;
    /* border: 1px solid var(--clr-light-border); */
}

.demo-questions-title {
    color: var(--clr-demo-text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-question {
    color: var(--clr-white);
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
}

.demo-question::before {
    content: "→";
    margin-right: 8px;
    color: var(--clr-demo-border-hover);
    font-weight: bold;
    flex-shrink: 0;
}

.demo-cta {
    margin-top: auto;
}

.demo-button {
    width: -webkit-fill-available;
    border: 1px solid var(--clr-white-20);
    color: var(--clr-white);
    /* background-color: var(--clr-black); */
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    pointer-events: none; /* Prevents the button from being clickable separately */
}

.no-demos {
    text-align: center;
    color: var(--clr-demo-text-muted);
    font-size: 1.2rem;
    margin-top: 60px;
    padding: 40px;
    background: var(--clr-demo-card-bg);
    border-radius: 16px;
    border: 1px solid var(--clr-demo-border);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* .demos-container {
        padding: 20px 16px;
    } */
    
    /* .demos-hero h1 {
        font-size: 2.2rem;
    } */
    
    .demos-hero p {
        font-size: 1rem;
    }
    
    .demos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .demo-stats {
        gap: 10px;
    }
    
    .demo-stat-value {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .demo-card-content {
        padding: 20px;
    }
    
    .demo-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .demo-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
.demo-stat-value {
        margin-bottom: 0;
    }
}

/* Iframe styling for demo detail */
.demo-iframe-wrapper {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 600px;
    margin-top: 8px;
}

.demo-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Low-Profile Collapsible Header */
.collapsible-header {
    position: relative;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.hero-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--clr-white);
    margin: 0;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-ctas {
    display: flex;
    gap: 8px;
    align-items: center;
    transition: all 0.3s ease;
}

.cta-button {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.collapse-toggle {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--clr-white-60);
    border-radius: 4px;
    flex-shrink: 0;
}

.collapse-toggle:hover {
    color: var(--clr-white);
    background: var(--clr-white-10);
}

/* Toggle visibility based on screen size */
.mobile-toggle {
    display: none;
}

.desktop-toggle {
    display: block;
}

.chevron-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.hero-content {
    max-height: 100px;
    opacity: 1;
    overflow: hidden;
    transition: all 0.3s ease;
    /* padding-top: 8px; */
}

.hero-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.stat-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--clr-white);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--clr-demo-text-muted);
    font-weight: 400;
}

.stat-separator {
    color: var(--clr-demo-text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    opacity: 0.6;
}

.primary-cta {
    background: var(--clr-white);
    color: var(--clr-black);
    border: none;
}

.primary-cta:hover {
    background: #4a90e2;
    text-decoration: none;
    color: var(--clr-white);
}

.secondary-cta {
    background: transparent;
    color: var(--clr-white-80);
    border: 1px solid var(--clr-white-20);
}

.secondary-cta:hover {
    background: var(--clr-white-10);
    border-color: var(--clr-white-40);
    text-decoration: none;
    color: var(--clr-white);
}

.embed-icon {
    width: 10px;
    height: 10px;
}

/* Collapsed State */
.collapsible-header[data-collapsed="true"] .hero-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--clr-white-60);
}

.collapsible-header[data-collapsed="true"] .hero-header {
    padding: 6px 0;
}

.collapsible-header[data-collapsed="true"] .hero-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
}

.collapsible-header[data-collapsed="true"] .hero-ctas {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.collapsible-header[data-collapsed="true"] .chevron-icon {
    transform: rotate(180deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .hero-title-row {
        width: 100%;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .hero-title {
        font-size: 1.3rem;
    }
    
    .collapsible-header[data-collapsed="true"] .hero-title {
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: 16px;
    }
    
    .hero-ctas {
        gap: 6px;
    }
    
    .cta-button {
        padding: 3px 6px;
        font-size: 0.7rem;
    }
    
    /* Show mobile toggle, hide desktop toggle */
    .mobile-toggle {
        display: block;
    }
    
    .desktop-toggle {
        display: none;
    }
    
    /* Hide header actions completely when collapsed on mobile */
    .collapsible-header[data-collapsed="true"] .header-actions {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.2rem;
    }
    
    .collapsible-header[data-collapsed="true"] .hero-title {
        font-size: 0.95rem;
    }
    
    /* .hero-stats {
        flex-direction: column;
        gap: 8px;
    } */
    
    .hero-description {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .cta-button {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* Want More Popup Styles */
.want-more-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    pointer-events: none;
}

.want-more-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.popup-content {
    background: var(--clr-light-background);
    border: 1px solid var(--clr-light-border);
    border-radius: 16px;
    padding: 24px;
    width: 380px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--clr-white-60);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.popup-close:hover {
    color: var(--clr-white);
    background: var(--clr-white-10);
}

.popup-close svg {
    width: 16px;
    height: 16px;
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--clr-white);
    margin: 0 0 20px 0;
    font-family: var(--ff-main);
}

.popup-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popup-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px;
    /* background: var(--clr-light-background-blue); */
    border: 1px solid var(--clr-demo-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
}

.popup-option:hover {
    background: rgba(88, 160, 255, 0.1);
    border-color: var(--clr-link-blue);
    text-decoration: none;
    color: inherit;
}

.option-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-icon svg {
    width: 20px;
    height: 20px;
    color: var(--clr-white);
}

.option-content {
    flex: 1;
}

.option-content h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--clr-white);
    margin: 0 0 4px 0;
    font-family: var(--ff-main);
}

.option-content p {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--clr-secondary-text);
    margin: 0;
    font-family: var(--ff-main);
}

.option-arrow {
    flex-shrink: 0;
    color: var(--clr-white-60);
    transition: all 0.2s ease;
}

.option-arrow svg {
    width: 16px;
    height: 16px;
}

.popup-option:hover .option-arrow {
    color: var(--clr-white);
    transform: translateX(2px);
}

/* Mobile Responsive for Popup */
@media (max-width: 768px) {
    .want-more-popup {
        bottom: 50%;
        right: 50%;
        transform: translate(50%, 50%) translateY(20px) scale(0.95);
        left: 20px;
        right: 20px;
        width: auto;
    }
    
    /* .want-more-popup.show {
        transform: translate(50%, 50%) translateY(0) scale(1);
    } */
    
    .popup-content {
        width: calc(100% - 40px);
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .want-more-popup {
        left: 16px;
        right: 16px;
    }
    
    .popup-content {
        padding: 20px;
    }
    
    .popup-title {
        font-size: 1rem;
    }
    
    .popup-option {
        padding: 14px;
        gap: 12px;
    }
    
    .option-icon {
        width: 36px;
        height: 36px;
    }
    
    .option-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .option-content h4 {
        font-size: 0.9rem;
    }
    
    .option-content p {
        font-size: 0.8rem;
    }
}
