/* ==========================================================================
  MAIN PAGE LAYOUT
========================================================================== */
body {
    margin: 0;
    padding: 0;
    display: flex;          
    justify-content: center; 
    align-items: center;     
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;      
    background-color: #f8f9fa; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

main {
    display: flex;
    flex-direction: column; 
    align-items: center;    
    justify-content: center;
    gap: 30px;
    padding: 20px;
    width: 100%;
    max-width: 650px; /* Sweeter spot for readability */
    box-sizing: border-box;
}

h1 {
    margin: 0;
    color: #212529;
    font-weight: 800;
    font-size: 2.5rem;
}

/* ==========================================================================
  CODE WINDOW (VS CODE STYLE)
========================================================================== */
#demo-instructions { width: 100%; }

.code-window {
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.code-window pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
}

.code-window code {
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Syntax Highlighting for the Code Window */
.keyword { color: #569cd6; } /* Blue (new, true, false) */
.string  { color: #ce9178; } /* Orange/Peach ('Success') */
.number  { color: #b5cea8; } /* Light Green (3000, 5) */
.console { color: #4ec9b0; } /* Teal (console) */
.method  { color: #dcdcaa; } /* Yellow (cbToast, .log) */
.comment { color: #6a9955; font-style: italic; } /* Muted Green (Comments) */

/* ==========================================================================
   BUTTON GRID & VARIANTS
========================================================================== */
#btn-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    width: 100%;
}

/* Base style for all action buttons */
#btn-container button {
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    border: none;
    color: white;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

#btn-container button:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

#btn-container button:active {
    transform: translateY(-1px);
}

/* Specific Color Variants */
#defaultBtn   { background-color: #212529; }
#lightModeBtn { background-color: #adb5bd; color: #212529; }
#successBtn   { background-color: #198754; box-shadow: 0 4px 12px rgba(25, 135, 84, 0.2); }
#errorBtn     { background-color: #dc3545; box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2); }
#infoBtn      { background-color: #0dcaf0; color: #212529; box-shadow: 0 4px 12px rgba(13, 202, 240, 0.2); }
#warningBtn   { background-color: #ffc107; color: #212529; box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2); }
#bs5Btn       { background-color: #0d6efd; box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2); }
#noIconBtn    { background-color: #6c757d; }
#stackBtn     { background-color: #6610f2; box-shadow: 0 4px 12px rgba(102, 16, 242, 0.2); }

/* ==========================================================================
   EDITABLE CODE & RUN BUTTON
========================================================================== */

/* Make the code block feel like a real editor */
#editableCode {
    outline: none;
    display: block;
    caret-color: #569cd6; /* Matches keyword color */
    white-space: pre;
}

/* ==========================================================================
   GRADIENT RUN BUTTON
========================================================================== */
#runCodeBtn {
    margin-top: 15px;
    width: 100%;
    
    /* 1. Nice Gradient Background (BS5 Blue -> BS5 Indigo) */
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    
    color: white;
    padding: 16px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    
    /* 2. Transition for smooth effects */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* 3. Deep Indigo 'Glow' Box Shadow */
    box-shadow: 0 4px 15px rgba(102, 16, 242, 0.3);
    
    position: relative;
    overflow: hidden;
}

#runCodeBtn:hover {
    /* 4. Intensify the gradient slightly on hover */
    background: linear-gradient(135deg, #0b5ed7, #520dc2);
    
    /* 5. Elevate and glow stronger */
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(102, 16, 242, 0.5);
}

#runCodeBtn:active {
    /* 6. Push down to feel like a real click */
    transform: translateY(-1px) scale(1);
    box-shadow: 0 4px 10px rgba(102, 16, 242, 0.3);
}

/* 7. Subtle 'Reflection' shimmer effect on hover */
#runCodeBtn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#runCodeBtn:hover::before {
    opacity: 1;
}