/* static/css/civil/advanced-beam-calculator.css */

    /* ===== MOBILE-FIRST RESPONSIVE STYLES ===== */
    /* Base styles (mobile) */
    :root {
        --primary-color: #0d6efd;
        --success-color: #28a745;
        --danger-color: #dc3545;
        --warning-color: #ffc107;
        --info-color: #17a2b8;
        --light-bg: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        --border-radius: 0.5rem;
        --transition: all 0.3s ease;
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
        --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    }

    /* Typography scaling */
    html {
        font-size: 14px;
    }

    /* Container adjustments for mobile */
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Card adjustments for mobile */
    .card {
        margin-bottom: 1rem;
        border-radius: var(--border-radius);
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }

    .card.shadow-sm.p-4 {
        overflow: visible !important;
        padding: 1.25rem !important;
    }

    /* Visualization containers - mobile first */
    .beam-visualization-container {
        height: 300px;
        border: 1px solid #dee2e6;
        border-radius: var(--border-radius);
        overflow: hidden;
        background: var(--light-bg);
        position: relative;
        margin-bottom: 1rem;
    }

    .beam-2d-diagram {
        height: 180px;
        border: 1px solid #dee2e6;
        border-radius: var(--border-radius);
        background: white;
        position: relative;
        overflow: hidden;
        margin-bottom: 1rem;
    }

    /* Form controls mobile optimization */
    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }

    .form-control, .form-select {
        padding: 0.75rem;
        font-size: 16px; /* Prevent zoom on iOS */
        border: 2px solid #dee2e6;
        border-radius: 6px;
    }

    /* Button adjustments for touch devices */
    .btn {
        padding: 0.75rem 1.25rem;
        border-radius: 6px;
        font-weight: 500;
        min-height: 44px; /* Minimum touch target size */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-sm {
        padding: 0.5rem 1rem;
        min-height: 36px;
    }

    /* Grid adjustments for mobile */
    .row.g-3 {
        margin-left: -8px;
        margin-right: -8px;
        margin-bottom: 1rem;
    }

    .row.g-3 > [class^="col-"] {
        padding-left: 8px;
        padding-right: 8px;
        margin-bottom: 1rem;
    }

    /* Results cards for mobile */
    .result-card {
        background: var(--light-bg);
        padding: 1.25rem;
        border-radius: var(--border-radius);
        text-align: center;
        border: 1px solid #e9ecef;
        transition: var(--transition);
        margin-bottom: 1rem;
        height: auto;
    }

    .result-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg);
    }

    .result-value {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary-color);
        margin-bottom: 0.5rem;
    }

    .result-unit {
        font-size: 0.9rem;
        color: #6c757d;
        font-weight: 500;
        margin-bottom: 0.5rem;
    }

    .result-label {
        font-size: 0.95rem;
        color: #495057;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Info grid for mobile */
    .info-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .info-item {
        background: var(--light-bg);
        padding: 1rem;
        border-radius: var(--border-radius);
        text-align: center;
        border: 1px solid #e9ecef;
        transition: var(--transition);
    }

    .info-item:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .info-value {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--primary-color);
        margin-bottom: 0.5rem;
    }

    .info-label {
        font-size: 0.8rem;
        color: #6c757d;
        font-weight: 500;
        line-height: 1.2;
    }

    /* Load items mobile optimization */
    .load-item {
        border-left: 4px solid var(--primary-color);
        transition: var(--transition);
        position: relative;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .load-item:hover {
        box-shadow: var(--shadow-md);
        transform: translateX(3px);
    }

    .load-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: -4px;
        width: 4px;
        height: 100%;
        background: linear-gradient(180deg, var(--primary-color) 0%, #6610f2 100%);
        transition: width 0.3s ease;
    }

    .load-item:hover::before {
        width: 6px;
    }

    .load-item[data-load-type="point"] { border-left-color: var(--danger-color); }
    .load-item[data-load-type="udl"] { border-left-color: var(--success-color); }
    .load-item[data-load-type="uvl"] { border-left-color: var(--warning-color); }
    .load-item[data-load-type="trapezoid"] { border-left-color: #fd7e14; }
    .load-item[data-load-type="moment"] { border-left-color: #6f42c1; }

    /* Chart containers */
    .chart-container {
        height: 250px;
        position: relative;
    }

    .chart-container canvas {
        border-radius: var(--border-radius);
    }

    /* CSV Preview */
    #csvPreview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1060;
    padding: 20px;
    overflow-y: auto;
    display: none;
    }
    
    #csvPreview.show {
        display: block;
        animation: modalFadeIn 0.3s ease-out;
    }
    
    @keyframes modalFadeIn {
        from {
            opacity: 0;
            transform: translate(-50%, -60%);
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%);
        }
    }
    
    /* Add overlay background */
    .csv-preview-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1050;
        display: none;
    }
    
    .csv-preview-overlay.show {
        display: block;
    }
    
    .csv-preview-container {
        max-height: 400px;
        overflow-y: auto;
    }
    
    .preview-table {
        margin-bottom: 0;
        width: 100%;
    }
    
    .preview-table thead th {
        position: sticky;
        top: 0;
        background: #343a40;
        z-index: 10;
        color: white;
    }
    
    .preview-table tr:hover {
        background-color: rgba(13, 110, 253, 0.05);
    }

    /* Status indicators */
    .status-indicators {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .status-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem;
        background: rgba(248, 249, 250, 0.8);
        border-radius: var(--border-radius);
        transition: background-color 0.2s ease;
    }

    .status-text {
        font-size: 0.9rem;
        font-weight: 500;
    }

    /* Visualization controls */
    .visualization-controls {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem;
        background: rgba(248, 249, 250, 0.9);
        border-radius: var(--border-radius);
        margin-top: 0.75rem;
    }

    /* Export notification */
    
    .export-notification {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
            color: white;
            padding: 15px 25px;
            border-radius: 8px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
            z-index: 1050;
            opacity: 0;
            transform: translateY(30px);
            transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
    
    .export-notification.show {
            opacity: 1;
            transform: translateY(0);
        }

    .export-notification.error { background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%); }
    .export-notification.warning { background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%); color: #000; }
    .export-notification.info { background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%); }

    /* ===== TABLET STYLES (768px and up) ===== */
    @media (min-width: 768px) {
        html {
            font-size: 15px;
        }
        
        .container-fluid {
            padding-left: 15px;
            padding-right: 15px;
        }
        
        .beam-visualization-container {
            height: 350px;
        }
        
        .beam-2d-diagram {
            height: 200px;
            margin-bottom: 1.25rem;
        }
        
        .chart-container {
            height: 280px;
        }
        
        .info-grid {
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }
        
        .row.g-3 > [class^="col-"] {
            margin-bottom: 0;
        }
        
        .result-card {
            margin-bottom: 0;
            height: 100%;
        }
        
        .visualization-controls {
            flex-direction: row;
            align-items: center;
            justify-content: center;
        }
    
    }

    /* ===== DESKTOP STYLES (992px and up) ===== */
    @media (min-width: 992px) {
        html {
            font-size: 16px;
        }
        
        .beam-visualization-container {
            height: 400px;
        }
        
        .chart-container {
            height: 300px;
        }
        
        /* More spacious layout for desktop */
        .card.shadow-sm.p-4 {
            padding: 1.5rem !important;
        }
        
        .info-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    /* ===== LARGE DESKTOP STYLES (1200px and up) ===== */
    @media (min-width: 1200px) {
        .container-fluid {
            max-width: 1200px;
            margin: 0 auto;
        }
        
        .info-grid {
            grid-template-columns: repeat(4, 1fr);
        }
        
        /* More spacing for large screens */
        .card.shadow-sm.p-4 {
            padding: 2rem !important;
        }
    }

    /* ===== ACCESSIBILITY IMPROVEMENTS ===== */
    /* Focus styles */
    .btn:focus,
    .form-control:focus,
    .form-select:focus,
    .form-check-input:focus {
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
        border-color: #86b7fe;
        outline: 0;
    }
    
    /* High contrast support */
    @media (prefers-contrast: high) {
        .card {
            border: 2px solid #000;
        }
        
        .btn {
            border: 2px solid;
        }
        
        .result-card, .info-item {
            border: 2px solid #000;
        }
    }
    
    /* Reduced motion support */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;
        }
        
        .result-card:hover,
        .info-item:hover,
        .load-item:hover {
            transform: none;
        }
    }
    
    /* Screen reader only text */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    
    /* Touch device improvements */
    @media (hover: none) and (pointer: coarse) {
        .btn {
            padding: 1rem 1.5rem; /* Larger touch targets */
        }
        
        .form-check-label {
            padding: 0.5rem 0; /* Larger tap areas for checkboxes */
        }
        
        /* Reduce hover effects on touch devices */
        .result-card:hover,
        .info-item:hover,
        .load-item:hover {
            transform: none;
        }
    }

    /* Animation keyframes (unchanged) */
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateX(-30px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Utility classes */
    .fade-in {
        animation: fadeIn 0.6s ease-out;
    }

    .slide-in-left {
        animation: slideInLeft 0.5s ease-out;
    }

    /* Print styles */
    @media print {
        .btn, .visualization-controls {
            display: none !important;
        }
        
        .card {
            box-shadow: none !important;
            border: 1px solid #ddd !important;
        }
        
        .result-card, .info-item {
            break-inside: avoid;
        }
    }
    
    /* SVG Container */
#beamSVG {
    background: linear-gradient(135deg, #f8f9fa 25%, #e9ecef 25%, #e9ecef 50%, 
                               #f8f9fa 50%, #f8f9fa 75%, #e9ecef 75%, #e9ecef 100%);
    background-size: 20px 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Animation for load application */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 1s ease;
}

/* SVG element transitions */
#beamSVG line, #beamSVG rect, #beamSVG polygon, #beamSVG path {
    transition: all 0.3s ease;
}

/* Add these styles to your CSS file or in a style tag */
.beam-line {
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.2));
}

.support {
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));
}

.load-label {
    font-family: 'Arial', sans-serif;
    paint-order: stroke;
    stroke: white;
    stroke-width: 3px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dimension-line {
    stroke: #7f8c8d;
    stroke-width: 1;
}

.dimension-text {
    font-family: 'Arial', sans-serif;
    font-size: 12px;
    fill: #2c3e50;
    font-weight: bold;
}
/* SVG Element Styling */
.beam-line {
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.2));
}

.support {
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));
}

.load-label {
    font-family: 'Arial', sans-serif;
    paint-order: stroke;
    stroke: white;
    stroke-width: 3px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dimension-line {
    stroke: #7f8c8d;
    stroke-width: 1.5;
}

.dimension-text {
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    font-weight: bold;
    fill: #2c3e50;
}

/* Support specific styles */
.support.pinned circle {
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));
}

.support.roller circle {
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));
}

.support.fixed rect {
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));
}

.reinforcement-section {
    transition: all 0.3s ease;
}

.reinforcement-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #0d6efd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.reinforcement-item h6 {
    color: #0d6efd;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.reinforcement-card {
    transition: transform 0.2s ease;
}

.reinforcement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}