/**
 * Dashboard Layout CSS - Glassmorphism Design System
 * Extracted from original index-old.html for modular architecture
 */

/* CSS Custom Properties for Design System */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-blur: blur(20px);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --surface: #0f172a;
        --surface-2: #1e293b;
        --surface-3: #334155;
        --border: #475569;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        --glass-bg: rgba(15, 23, 42, 0.85);
        --glass-border: rgba(255, 255, 255, 0.1);
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: transparent;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Container with Glassmorphism - Optimized for 1920x1080 */
.app-container {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 1rem;
    height: auto;
    max-height: none;
}

.main-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: visible;
    animation: slideUp 0.6s ease-out;
    height: 100%;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header Section */
.app-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.app-icon {
    margin-right: 0.5rem;
}

.app-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

/* Main Content Layout */
.app-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Styles */
.app-sidebar {
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.input-panel { padding: 0.25rem 1rem 1rem 1rem; flex: 1; }

.panel-header { display: flex; align-items: center; margin-bottom: 0.5rem; padding-bottom: 0; border-bottom: none; }

.panel-icon {
    color: var(--primary);
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Main Area Styles */
.app-main {
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* Unified Toolbar */
.unified-toolbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}

.toolbar-title {
    display: flex;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.toolbar-title i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.toolbar-btn:hover {
    background: var(--surface-3);
    color: var(--text-primary);
    border-color: var(--primary);
}

.toolbar-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Live Results Area */
.live-results-area {
    flex: 1;
    overflow: auto;
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
}

.results-panel {
    display: none;
}

.results-panel.results-visible {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Styles */
.form-group-section {
    margin-bottom: 2rem;
}

.form-group-section h3 {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.form-group-section h3 i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.required {
    color: var(--error);
    margin-left: 0.25rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input,
.input-wrapper select {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-unit {
    position: absolute;
    right: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

/* input-status positioning defined in form-extensions.css */

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    margin-right: 0.75rem;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-item input[type="checkbox"]:checked + label .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-item input[type="checkbox"]:checked + label .checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
}

.checkbox-item label {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    user-select: none;
}

/* Calculate Button */
.form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}


/* Removed calculate button styles */

.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Example Buttons */
.section-controls {
    text-align: center;
}

/* Removed example buttons container */


/* Removed example button styles */

/* 95% Target Optimization Buttons */
.target-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(99, 102, 241, 0.92));
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(59, 130, 246, 0.2), 
        0 1px 2px rgba(59, 130, 246, 0.3),
        0 0 0 0 rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
    z-index: 2;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: none;
    will-change: box-shadow, border-color;
}

.target-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: 1;
}

.target-button:hover {
    transform: translateY(-50%) scale(1.08);
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.98), rgba(245, 158, 11, 0.96));
    border-color: rgba(251, 146, 60, 0.6);
    box-shadow: 
        0 4px 20px rgba(251, 146, 60, 0.45), 
        0 2px 8px rgba(251, 146, 60, 0.5),
        0 0 0 3px rgba(251, 146, 60, 0.2),
        0 0 20px rgba(251, 146, 60, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.25);
    animation: none;
}

.target-button:active {
    transform: translateY(-50%) scale(0.95);
    transition: all .1s ease;
}

.target-button:active::after {
    width: 32px;
    height: 32px;
    transition: width .2s, height .2s;
}

.target-button.optimizing {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.92));
    animation: optimizePulse 1.5s ease-in-out infinite, optimizeGlow 2s ease-in-out infinite alternate;
}

@keyframes optimizePulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

@keyframes optimizeGlow {
    0% { 
        box-shadow: 
            0 2px 8px rgba(245, 158, 11, 0.3), 
            0 1px 2px rgba(245, 158, 11, 0.4);
    }
    100% { 
        box-shadow: 
            0 4px 20px rgba(245, 158, 11, 0.5), 
            0 2px 8px rgba(245, 158, 11, 0.6),
            0 0 0 4px rgba(245, 158, 11, 0.1);
    }
}

/* Dezente Aufmerksamkeits-Animation: Subtiler Blau→Orange Fade über Glow */
@keyframes attentionGlow {
    0%, 100% {
        box-shadow:
            0 2px 8px rgba(59, 130, 246, 0.25),
            0 1px 2px rgba(59, 130, 246, 0.35),
            0 0 0 0 rgba(59, 130, 246, 0.00),
            inset 0 1px 0 rgba(255,255,255,0.20);
        border-color: rgba(59, 130, 246, 0.45);
    }

    50% {
        box-shadow:
            0 3px 12px rgba(251, 146, 60, 0.28),
            0 2px 6px rgba(251, 146, 60, 0.32),
            0 0 0 2px rgba(251, 146, 60, 0.12),
            inset 0 1px 0 rgba(255,255,255,0.22);
        border-color: rgba(251, 146, 60, 0.35);
    }
}

.target-text {
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Screen reader only class */
/* sr-only defined in modules/utilities.css */

.results-grid-title {
    grid-column: 1 / -1;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* Results Styles */
.results-section {
    padding: 1.5rem;
}

.results-container {
    max-width: 100%;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.results-header h2 {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.results-header h2 i {
    margin-right: 0.75rem;
    color: var(--primary);
}

.results-controls {
    display: flex;
    gap: 0.5rem;
}

.results-control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.results-control-btn:hover {
    background: var(--surface-3);
    color: var(--text-primary);
    border-color: var(--primary);
}

/* Results Summary */
.results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.utilization-display,
.safety-display {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-md);
}

.utilization-icon,
.safety-icon {
    width: 3rem;
    height: 3rem;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
}

.utilization-content,
.safety-content {
    flex: 1;
}

.utilization-label,
.safety-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.utilization-value,
.safety-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 0.25rem;
}

.utilization-value.green {
    color: var(--success);
}

.utilization-value.yellow {
    color: var(--warning);
}

.utilization-value.red {
    color: var(--error);
}

.utilization-status,
.safety-description {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.result-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.result-card h4 {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.result-card h4 i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.result-grid {
    display: grid;
    gap: 0.75rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-value {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

/* Chart Styles */
.chart-container {
    grid-column: 1 / -1;
    min-height: 500px;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    margin-bottom: 1rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--surface-2);
    border-radius: var(--radius-md);
}

.chart-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Mathematical Documentation */
.math-documentation {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.math-documentation h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.math-section {
    margin-bottom: 1.5rem;
}

.math-section:last-child {
    margin-bottom: 0;
}

.math-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.formula-container {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.formula-container p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.formula-container p:last-child {
    margin-bottom: 0;
}

/* Desktop-/Tablet-Breakpoint (≤1024px) entfernt – Darstellung wird über proportionalen Zoom geregelt. */

@media (max-width: 768px) {
    .app-container {
        margin: 0.5rem auto;
        padding: 0 0.5rem;
        height: auto;
        max-height: none;
    }
    
    .app-header {
        padding: 1.25rem 1rem;
        border-radius: var(--radius-lg);
    }
    
    .app-title {
        font-size: 1.5rem;
    }

    .app-subtitle {
        font-size: 0.95rem;
        line-height: 1.35;
    }

    .main-card {
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
        height: auto;
    }
    
    .input-panel {
        padding: 1rem;
    }
    
    .live-results-area {
        padding: 1rem 0;
    }

    .app-content {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 0 0.25rem 1rem 0.25rem;
    }

    .app-main {
        order: 1;
        border-radius: var(--radius-lg);
        overflow: visible;
    }

    .app-sidebar {
        order: 2;
        border-right: none;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
        background: rgba(255,255,255,0.88);
        backdrop-filter: blur(18px);
    }

    .app-sidebar .input-panel {
        padding: 1rem 1rem 1.5rem 1rem;
    }

    .panel-header {
        padding-inline: 0;
    }

    .form-grid {
        gap: 0.75rem;
    }
    
    .unified-toolbar {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        border-radius: var(--radius-lg);
        position: sticky;
        top: 0;
        z-index: 20;
    }
    
    .toolbar-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .toolbar-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.9rem;
        padding: 0.65rem 0.75rem;
    }
}