/* 
DynaPoise - Geartrain Analyzer Stylesheet
Extends style.css
*/

:root {
    --card-bg: rgba(255, 255, 255, 0.02);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: var(--primary-color);
}

.wheels-inputs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

/* Individual Wheel Config Card */
.wheel-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px 14px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wheel-card:hover {
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.05);
}

.wheel-card.active-barrel {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.05);
}

.wheel-card.active-escape {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.05);
}

.wheel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 4px;
}

.wheel-card-title {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.wheel-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-barrel {
    background-color: rgba(255, 215, 0, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.badge-escape {
    background-color: rgba(0, 212, 255, 0.15);
    color: var(--primary-color);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.wheel-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wheel-input-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wheel-input-row label {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-right: 10px;
    text-align: left;
    flex: 1;
}

.wheel-input-row input[type="number"] {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 10px;
    border-radius: 6px;
    width: 100px;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wheel-input-row input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

/* Transitions for hiding Pinion Leaves */
.pinion-row-wrapper {
    max-height: 50px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.pinion-row-wrapper.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

/* Adjustments for right side canvas */
.viz-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 15px;
    padding: 0;
    box-sizing: border-box;
    overflow: auto;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    min-width: 600px; /* Make the output area minimum width 600px */
    border-radius: 0 !important;
}

#geartrainCanvas {
    background-color: #0d0d11;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9);
    width: 100%;
    flex: 1; /* Grow/shrink dynamically to fill the available space */
    max-width: 100%;
    overflow: hidden;
    transform: translateZ(0);
    box-sizing: border-box;
    min-width: 900px; /* Option 2: Set minimum width to 900px, after which it horizontal scrolls */
    min-height: 600px; /* Option 2: Set minimum height to 600px globally to prevent narrow squishing */
}

.viz-panel .status-bar {
    position: static;
    margin-top: 0;
    max-width: 100% !important;
    width: 100%;
    min-width: 600px !important; /* Make the output panel minimum width before horizontal scrolling 600px */
    box-sizing: border-box;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 18px;
    flex: 1;
    flex-shrink: 0; /* Prevent flex engine from squishing the status bar width */
    min-height: 120px;
    overflow: auto; /* Enable both vertical and horizontal scrollbars */
    transform: none !important;
}

/* Force horizontal scrollbar to be always visible and styled nicely */
.viz-panel .status-bar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.viz-panel .status-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
}
.viz-panel .status-bar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

/* Highlight tags in the details output */
.stat-highlight {
    color: var(--primary-color);
    font-weight: bold;
}

/* Demo configuration badge in load dialog */
.demo-badge {
    background-color: rgba(255, 68, 160, 0.15);
    color: #ff44a0;
    border: 1px solid rgba(255, 68, 160, 0.3);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
}

/* Pulsing load config button for new users */
@keyframes pulseAccent {
    0% {
        border-color: var(--primary-color);
        color: var(--primary-color);
        box-shadow: 0 0 0px rgba(0, 212, 255, 0);
    }
    50% {
        border-color: var(--accent-color);
        color: var(--accent-color);
        box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    }
    100% {
        border-color: var(--primary-color);
        color: var(--primary-color);
        box-shadow: 0 0 0px rgba(0, 212, 255, 0);
    }
}

.btn-config.pulse-accent {
    animation: pulseAccent 2.5s infinite ease-in-out;
}

/* Ensure the input panel has position relative so collapse button and title are scoped correctly, and a minimum width of 280px in expanded state */
.input-panel {
    position: relative;
    min-width: 280px;
}

.collapsed-title {
    display: none;
    position: absolute;
    top: 75px; /* Below the toggle button which is at 15px */
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
    transform-origin: center;
    color: var(--text-dim);
    font-weight: bold;
    font-size: 11px;
    letter-spacing: 3px;
    white-space: nowrap;
    pointer-events: none;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .collapsed-title {
    display: block;
    opacity: 0.6;
}

/* Collapsible Config Panel (Option 3) */
.toggle-panel-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    background-color: #1a1a24;
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-panel-btn:hover {
    background-color: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

.input-panel-content {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.sidebar-collapsed .input-panel {
    max-width: 40px !important;
    width: 40px !important;
    min-width: 40px !important; /* Override 280px min-width when collapsed */
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: hidden !important;
    flex: 0 0 40px !important;
}

.sidebar-collapsed .input-panel-content {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .toggle-panel-btn {
    right: 6px;
    transform: rotate(180deg); /* CSS Arrow flip */
}

@media (max-width: 800px) {
    .viz-panel {
        overflow-x: auto;
        width: 100%;
        align-items: flex-start;
    }
    .toggle-panel-btn {
        display: none !important;
    }
    .input-panel {
        min-width: 0; /* Reset minimum width on mobile stack layout */
    }
}