/* ============================================
   Demo Page - Page-Specific Styles
   ============================================
   Purpose: Custom styles for /demo page only

   Architecture:
   - Tier 1: Global theme (style.css)
   - Tier 2: Component theme (custom.css)
   - Tier 3: Page-specific (THIS FILE)

   DO NOT: Add global styles here
   DO: Add demo-page-specific overrides
   ============================================ */

/* ---------------------------------------------
   0. Demo Page CSS Variables
   --------------------------------------------- */

:root {
    /* Demo-specific brand colors (purple gradient - intentional visual distinction) */
    --demo-primary: #667eea;
    --demo-primary-dark: #764ba2;

    /* Demo-specific info colors (info badges) */
    --demo-info-bg: #e6f7ff;
    --demo-info-border: #91d5ff;
    --demo-info-text: #0050b3;

    /* Custom spacing values not in Bootstrap standard scale */
    --demo-spacing-3: 0.75rem;   /* 12px - between BS spacing-2 (8px) and spacing-3 (16px) */

    /* Custom border radius not in Bootstrap */
    --demo-radius-lg: 12px;

    /* Custom font sizes for Demo page typography */
    --demo-text-sm: 0.85rem;
    --demo-text-base: 0.9rem;
    --demo-text-lg: 1.1rem;
}

/* ---------------------------------------------
   1. Hero Section
   --------------------------------------------- */

.demo-hero {
    background: linear-gradient(135deg, var(--demo-primary) 0%, var(--demo-primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.demo-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.demo-hero .container {
    position: relative;
    z-index: 1;
}

/* Four Pillars Grid */
.four-pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.pillar-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.pillar-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.pillar-card .icon {
    font-size: 2rem;
    margin-bottom: var(--demo-spacing-3);
    display: block;
}

.pillar-card h3 {
    font-size: var(--demo-text-lg);
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--bs-white, #fff);
}

.pillar-card p {
    font-size: var(--demo-text-base);
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* ---------------------------------------------
   2. Demo Cards
   --------------------------------------------- */

.demo-card {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.demo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
}

.demo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--demo-primary) 0%, var(--demo-primary-dark) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.demo-card:hover::before {
    opacity: 1;
}

.demo-icon {
    transition: transform 0.3s ease;
}

.demo-card:hover .demo-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Pillar Badge */
.pillar-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--demo-primary) 0%, var(--demo-primary-dark) 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--bs-border-radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

/* Outcome Focus */
.outcome-badge {
    background: var(--demo-info-bg);
    border: 1px solid var(--demo-info-border);
    color: var(--demo-info-text);
    padding: 0.5rem 1rem;
    border-radius: var(--bs-border-radius-lg);
    font-size: var(--demo-text-sm);
    font-weight: 600;
    margin-top: 1rem;
    display: inline-block;
}

.outcome-badge i {
    color: var(--demo-info-text);
}

/* ---------------------------------------------
   3. BPMN Viewer
   --------------------------------------------- */

.bpmn-viewer-container {
    position: relative;
    background: var(--bs-gray-100);
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
}

#bpmn-canvas {
    position: relative;
    background: var(--bs-white, #fff);
}

#bpmn-canvas img {
    width: 100%;
    height: auto;
    display: block;
}

.bpmn-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.bpmn-error {
    color: var(--bs-danger, #dc3545);
    text-align: center;
    padding: 2rem;
}

/* ---------------------------------------------
   4. CTA Section
   --------------------------------------------- */

.demo-cta-card {
    background: linear-gradient(135deg, var(--demo-primary) 0%, var(--demo-primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.demo-cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.demo-cta-card .btn-light {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.demo-cta-card .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ---------------------------------------------
   5. Responsive Design
   --------------------------------------------- */

@media (max-width: 768px) {
    .four-pillars-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .pillar-card {
        padding: 1rem;
    }

    #bpmn-canvas {
        height: 300px !important;
    }

    .demo-cta-card .card-body {
        padding: 2rem 1.5rem !important;
    }

    .demo-cta-card .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .demo-hero {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .demo-hero h1 {
        font-size: 2rem;
    }

    .demo-hero .lead {
        font-size: 1rem;
    }
}

/* ---------------------------------------------
   6. Print Styles
   --------------------------------------------- */

@media print {
    .demo-hero,
    .demo-cta-card {
        display: none;
    }

    #bpmn-canvas {
        page-break-inside: avoid;
    }
}

/* ---------------------------------------------
   7. Accessibility
   --------------------------------------------- */

.demo-card:focus-visible {
    outline: 3px solid var(--demo-primary);
    outline-offset: 2px;
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.5);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
