/* --- GLOBAL VARIABLES --- */
:root {
    --color-footer-bg: rgba(15, 15, 15, 0.95);
    --color-footer-border: rgba(255, 255, 255, 0.15);
    --color-accordion-bg: rgba(255, 255, 255, 0.05);
    --color-text-white: white;
    --color-text-muted: #ccc;
}

/* --- SCROLL STORY CONTAINER BACKGROUND --- */
#scroll-story-container {
    background: rgba(0, 0, 0, 0.5); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    margin: 3rem 0;
    padding: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.story-section h2 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Replaces inline style on the H4 */
.pipeline-header {
    opacity: 0.8;
    font-weight: 300;
}

/* --- SECTION SEPARATORS --- */
.story-section:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

/* --- SCROLL STORY STYLES --- */
.min-vh-50 { min-height: 50vh; }

/* Common Visual Container */
.visual-box {
    height: 250px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

/* STAGE 1: SCOUT RIPPLE */
.scout-icon-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    display: grid;
    place-items: center;
}

.ripple {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; height: 100%;
    border: 2px solid #ffc107;
    border-radius: 50%;
    opacity: 0;
}

.active-stage .ripple {
    animation: rippleEffect 2s infinite;
}

@keyframes rippleEffect {
    0% { width: 0; height: 0; opacity: 0.8; }
    100% { width: 200%; height: 200%; opacity: 0; }
}

/* STAGE 2: METRIC BARS (The Measurement) */

/* FIX: Add padding to prevent left-side labels from being cut off */
#stage-ping .visual-box {
    padding-left: 60px; /* Push content right to make room for labels */
    align-items: flex-start; /* Align bars to the start of the padded area */
}

.metric-bar {
    width: 90%; /* Use most of the remaining space */
    height: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
}

.metric-bar::before {
    content: attr(data-label);
    position: absolute;
    left: -55px; /* Position label in the padded area we created */
    width: 50px; /* Fixed width for alignment */
    text-align: right;
    color: #aaa;
    font-size: 0.8rem;
    font-weight: bold;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    width: 0; /* Start empty for animation */
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Replaces inline width styles */
.active-stage .w-20 { width: 20% !important; }
.active-stage .w-35 { width: 35% !important; }
.active-stage .w-60 { width: 60% !important; }
.active-stage .w-40 { width: 40% !important; }

/* STAGE 3: DROP BOX */
.file-icon {
    position: absolute;
    top: 20px;
    opacity: 0;
    transition: all 0.5s;
}

.box-icon {
    margin-top: 50px;
}

.active-stage .file-icon {
    animation: dropFile 2s infinite;
}

@keyframes dropFile {
    0% { top: 20px; opacity: 0; transform: scale(0.5); }
    20% { opacity: 1; transform: scale(1); }
    80% { top: 120px; opacity: 1; transform: scale(0.8); }
    100% { top: 130px; opacity: 0; }
}

/* STAGE 4: SECURE BRIDGE */
.proxy-shield {
    position: relative;
    display: inline-block;
}

.active-stage .proxy-shield i {
    animation: shieldPulse 2s infinite alternate;
}

@keyframes shieldPulse {
    from { text-shadow: 0 0 10px rgba(25, 135, 84, 0.5); transform: scale(1); }
    to { text-shadow: 0 0 30px rgba(25, 135, 84, 0.8); transform: scale(1.1); }
}

/* --- CUSTOM FOOTER STYLES --- */
.glass-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--color-footer-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-footer-border);
    color: var(--color-text-white);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
}

.glass-footer.minimized {
    transform: translateY(calc(100% - 50px));
}

.footer-handle {
    height: 50px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.footer-handle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.footer-content {
    padding: 20px 0;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

#toggle-icon {
    transition: transform 0.3s ease;
}

.glass-footer:not(.minimized) #toggle-icon {
    transform: rotate(180deg);
}

/* Accordion Overrides */
.accordion-item {
    background: transparent;
    border: none;
}

.accordion-button {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-text-white);
    box-shadow: none !important;
    border: 1px solid var(--color-footer-border);
    border-radius: 8px !important;
    margin-bottom: 8px;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--color-text-white);
}

.accordion-button::after {
    filter: invert(1);
}

.accordion-body {
    background: var(--color-accordion-bg);
    color: var(--color-text-muted);
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- STATUS CARDS (Original Grid) --- */
.status-card {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.status-time {
    font-size: 0.75rem;
}