/* ==========================================================================
   CONFIG FOOTER ROW (Offset + Bottleneck)
   ========================================================================== */

.config-footer-row,
.fps-results-footer {
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    padding-top: clamp(0.75rem, 2vw, 1.5rem);
    border-top: 1px solid var(--border);
}

@media (min-width: 480px) {
    .config-footer-row,
    .fps-results-footer {
        flex-direction: row;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: clamp(1rem, 3vw, 2rem);
        margin-top: clamp(1rem, 2vw, 1.5rem);
    }
}

@media (min-width: 768px) {
    .config-footer-row,
    .fps-results-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Offset Section */
.offset-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
    flex: 0 1 auto;
    min-width: clamp(140px, 100%, 220px);
}

@media (min-width: 480px) {
    .offset-section {
        flex-direction: row;
        align-items: center;
        gap: clamp(0.75rem, 1.5vw, 1rem);
    }
}

.offset-label-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    position: relative;
}

.offset-label {
    font-size: clamp(0.75rem, 1.25vw, 0.8125rem);
    color: var(--text-muted);
}

.offset-value {
    font-size: clamp(0.75rem, 1.25vw, 0.8125rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 0.25rem;
}

.offset-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    font-size: clamp(0.6875rem, 1.1vw, 0.75rem);
    color: var(--text-secondary);
}

.offset-toggle input {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
}

.toggle-label {
    font-size: clamp(0.6875rem, 1.1vw, 0.75rem);
}

/* Bottleneck Section */
.bottleneck-section {
    flex: 0 1 100%;
    min-width: clamp(140px, 100%, 280px);
}

@media (min-width: 480px) {
    .bottleneck-section {
        flex: 1;
        min-width: 200px;
        max-width: 280px;
    }
}

@media (min-width: 768px) {
    .bottleneck-section {
        margin-left: auto;
    }
}

.bottleneck-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    position: relative;
}

.bn-chip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: clamp(0.6875rem, 1.1vw, 0.75rem);
    color: var(--text-muted);
}

.bn-chip strong {
    color: var(--text-primary);
}

.bn-gpu svg {
    color: var(--nvidia-green, #76b900);
}

.bn-cpu svg {
    color: var(--intel-blue, #0077c8);
}

.bottleneck-bar {
    display: flex;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
    position: relative;
}

.bn-fill {
    height: 100%;
    transition: width 0.4s ease;
    position: relative;
}

.bn-gpu-fill {
    background: linear-gradient(135deg, var(--nvidia-green, #76b900) 0%, var(--nvidia-green-dark, #6aa800) 100%);
    border-radius: 4px 0 0 4px;
}

.bn-cpu-fill {
    background: linear-gradient(135deg, var(--intel-blue, #0077c8) 0%, var(--intel-blue-dark, #0063a8) 100%);
    border-radius: 0 4px 4px 0;
}

/* Enhanced bottleneck bar with visual emphasis for limiting factors */
.bottleneck-bar.bn-emphasize-cpu .bn-cpu-fill {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.bottleneck-bar.bn-emphasize-gpu .bn-gpu-fill {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.bottleneck-label {
    display: block;
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
}

/* ==========================================================================
   BOTTLENECK SEVERITY INDICATORS
   ========================================================================== */

/* Balanced state - no concerns */
.bottleneck-balanced {
    /* No special styling needed for balanced state */
}

/* CPU Bottleneck - Mild */
.bottleneck-cpu-mild {
    border-left: 3px solid var(--warning);
}

/* CPU Bottleneck - Severe */
.bottleneck-cpu-severe {
    border-left: 3px solid var(--error);
    background-color: var(--error-bg);
}

/* GPU Bottleneck - Mild */
.bottleneck-gpu-mild {
    border-left: 3px solid var(--info);
}

/* GPU Bottleneck - Severe */
.bottleneck-gpu-severe {
    border-left: 3px solid var(--info);
    background-color: var(--info-bg);
}

/* Bottleneck Warning Badge */
.bottleneck-warning {
    display: flex;
    align-items: flex-start;
    gap: clamp(0.5rem, 1vw, 0.75rem);
    margin-top: 1rem;
    padding: clamp(0.625rem, 1.5vw, 0.75rem) clamp(0.875rem, 2vw, 1rem);
    border-radius: 6px;
    font-size: clamp(0.8125rem, 1.25vw, 0.875rem);
    line-height: 1.4;
}

/* CPU Warning - Uses error/warning colors */
.bottleneck-warning.warning-cpu {
    background-color: var(--error-bg);
    border: 1px solid var(--error);
    border-opacity: 0.2;
    color: var(--text-primary);
}

/* GPU Warning - Uses info color (informational, not alarming) */
.bottleneck-warning.warning-gpu {
    background-color: var(--info-bg);
    border: 1px solid var(--info);
    border-opacity: 0.2;
    color: var(--text-primary);
}

.bottleneck-warning .warning-icon {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottleneck-warning .warning-content {
    flex: 1;
}

.bottleneck-warning .warning-content strong {
    display: block;
    margin-bottom: clamp(0.125rem, 0.25vw, 0.25rem);
    color: var(--text-primary);
    font-weight: 600;
}

.bottleneck-warning .warning-content p {
    margin: 0;
    opacity: 0.85;
    color: var(--text-secondary);
}

/* Dark mode: Enhance contrast with theme-aware adjustments */
@media (prefers-color-scheme: dark) {
    /* Dark mode uses slightly different opacity values for better visibility */
    /* No need for dark-mode overrides since var(--error-bg) and var(--info-bg) are theme-aware */
}

/* ==========================================================================
   BOTTLENECK CORNER POSITIONING (Rechtsboven)
   ========================================================================== */

.bottleneck-section--corner {
    position: absolute;
    top: clamp(0.75rem, 2vw, 1.25rem);
    right: clamp(0.75rem, 2vw, 1.25rem);
    background: var(--bg-tertiary, rgba(0, 0, 0, 0.4));
    padding: clamp(0.375rem, 1vw, 0.5rem) clamp(0.5rem, 1.5vw, 0.75rem);
    border-radius: 8px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    z-index: 10;
    min-width: 0;
    max-width: clamp(180px, 35vw, 240px);
}

.bottleneck-section--corner .bottleneck-header {
    gap: clamp(0.25rem, 0.75vw, 0.5rem);
    font-size: clamp(0.625rem, 1vw, 0.75rem);
    margin-bottom: clamp(0.1875rem, 0.5vw, 0.25rem);
}

.bottleneck-section--corner .bottleneck-bar {
    height: clamp(3px, 0.5vw, 5px);
    margin-top: clamp(0.125rem, 0.5vw, 0.25rem);
    margin-bottom: 0;
}

.bottleneck-section--corner .bottleneck-label {
    display: none; /* Hide label in corner mode */
}

.bottleneck-section--corner .bn-chip {
    padding: 0;
    font-size: clamp(0.5625rem, 0.9vw, 0.6875rem);
    gap: 0.125rem;
}

.bottleneck-section--corner .bn-chip svg {
    width: clamp(10px, 1.25vw, 12px);
    height: clamp(10px, 1.25vw, 12px);
}

.bottleneck-section--corner .info-btn {
    width: clamp(12px, 1.25vw, 14px);
    height: clamp(12px, 1.25vw, 14px);
}

.bottleneck-section--corner .bottleneck-tooltip {
    font-size: clamp(0.625rem, 1vw, 0.75rem);
    min-width: 180px;
    right: 0;
    left: auto;
}

/* ==========================================================================
   OFFSET SECTION - BOTTOM POSITIONING (Linksonder)
   ========================================================================== */

.offset-section--bottom {
    margin-top: clamp(0.75rem, 1.5vw, 1rem);
    padding-top: clamp(0.75rem, 1.5vw, 1rem);
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(0.75rem, 1.5vw, 1rem);
    font-size: clamp(0.75rem, 1.25vw, 0.875rem);
}

.offset-section--bottom .offset-label-row {
    gap: clamp(0.25rem, 0.5vw, 0.375rem);
}

.offset-section--bottom .offset-label {
    font-size: clamp(0.6875rem, 1.1vw, 0.8125rem);
}

.offset-section--bottom .offset-value {
    font-size: clamp(0.6875rem, 1.1vw, 0.8125rem);
}

.offset-section--bottom .offset-toggle {
    font-size: clamp(0.625rem, 1vw, 0.75rem);
}

/* Mobile: Stack bottleneck below FPS output */
@media (max-width: 480px) {
    .bottleneck-section--corner {
        position: static;
        margin-bottom: 1rem;
        max-width: 100%;
        background: var(--bg-tertiary);
        border: 1px solid var(--border);
    }

    .bottleneck-section--corner .bottleneck-label {
        display: block;
        margin-top: 0.25rem;
    }
}

