/* ===== cantilever-master.css - FULLY RESPONSIVE VERSION ===== */
/* REPLACE ALL PREVIOUS CSS WITH THIS VERSION */

/* ==== General Styling ==== */
body {
    font-family: 'Inter', 'Helvetica', sans-serif;
    background: #f7f9fc;
    color: #212529;
}

/* Main content area */
.main-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Card Styling */
.card {
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

/* Input Fields - FULLY RESPONSIVE */
.form-control, .form-select {
    width: 100% !important;
    border-radius: 8px;
    font-size: 0.95rem;
    padding: 0.55rem 0.75rem;
    height: 42px;
    box-sizing: border-box;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 6px rgba(13,110,253,0.2);
}

/* Form labels */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

/* Tables - RESPONSIVE */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table {
    width: 100%;
    margin-bottom: 1rem;
}

.table th, .table td {
    vertical-align: middle;
    font-size: 0.95rem;
    padding: 0.75rem;
}

.table-sm th, .table-sm td {
    padding: 0.5rem;
}

/* Table inputs (keep smaller in tables) */
.table .form-control {
    width: 80px !important;
    min-width: 60px;
    display: inline-block;
    margin: 0;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    min-height: auto;
}

.btn-outline-primary {
    border-color: #0d6efd;
    color: #0d6efd;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white;
}

.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
}

/* Graph Cards */
.graph-wrapper {
    margin: 2rem 0;
}

.graph-wrapper .card {
    border-radius: 14px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    height: 100%;
}

.graph-wrapper .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.graph-wrapper .card-body {
    padding: 1.25rem;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.graph-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Beam diagram */
.beam-diagram {
    width: 100%;
    height: 250px;
    border: 1px solid #ccc;
    border-radius: 12px;
    background: linear-gradient(to bottom, #f9f9f9, #e9ecef);
}

/* Results section */
.output {
    font-weight: 600;
    color: #0d6efd;
}

/* Validation and info boxes */
#validationBox, #analyticBox, #loadSummaryBox {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

#validationBox {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
}

#analyticBox {
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
}

#loadSummaryBox {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
}

/* Export buttons container */
.export-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

/* Text utilities */
.text-muted {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Headings */
.display-6 {
    font-size: 2.5rem;
    font-weight: 700;
}

.fw-semibold {
    font-weight: 600;
}

.fw-medium {
    font-weight: 500;
}

/* Spacing utilities */
.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.p-4 {
    padding: 1.5rem !important;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

/* Grid spacing */
.g-4 {
    gap: 1.5rem !important;
}

/* Fade in animation */
.fade-in {
    animation: fadein 0.4s ease-in-out;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .col-lg-7 {
        flex: 0 0 58.333333%;
        max-width: 58.333333%;
    }
    
    .col-lg-5 {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
    }
    
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

/* Medium devices (tablets, 768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .chart-container {
        height: 280px;
    }
    
    .beam-diagram {
        height: 220px;
    }
}

/* Small devices (landscape phones, 576px to 767px) */
@media (max-width: 767px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .display-6 {
        font-size: 2rem;
    }
    
    .card .p-4 {
        padding: 1rem !important;
    }
    
    /* Stack all columns */
    .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Adjust chart sizes */
    .chart-container {
        height: 250px;
    }
    
    .beam-diagram {
        height: 200px;
    }
    
    /* Table adjustments */
    .table th, .table td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .table .form-control {
        width: 70px !important;
        font-size: 0.85rem;
    }
    
    /* Button adjustments */
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .export-buttons-container .btn {
        width: auto;
        flex: 1;
        min-width: 120px;
    }
    
    /* Reduce spacing */
    .g-4 {
        gap: 1rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1rem !important;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
    .display-6 {
        font-size: 1.8rem;
    }
    
    h4.fw-semibold {
        font-size: 1.2rem;
    }
    
    h5.fw-medium {
        font-size: 1.1rem;
    }
    
    .chart-container {
        height: 220px;
    }
    
    .beam-diagram {
        height: 180px;
    }
    
    /* Further reduce table cell padding */
    .table th, .table td {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .table .form-control {
        width: 60px !important;
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    /* Stack export buttons */
    .export-buttons-container {
        flex-direction: column;
    }
    
    .export-buttons-container .btn {
        width: 100%;
    }
    
    /* Info boxes */
    #validationBox, #analyticBox, #loadSummaryBox {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* Very small devices (less than 400px) */
@media (max-width: 400px) {
    .table th, .table td {
        padding: 0.3rem;
    }
    
    .table .form-control {
        width: 50px !important;
        font-size: 0.75rem;
    }
    
    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .chart-container {
        height: 200px;
    }
}

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Focus states for accessibility */
.form-control:focus,
.form-select:focus,
.btn:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Loading animation */
.fade-in {
    animation-duration: 0.3s;
}

/* Text alignment for outputs */
output {
    font-weight: 600;
    color: #0d6efd;
}

/* Force display properties */
.d-flex {
    display: flex !important;
}

.flex-column {
    flex-direction: column !important;
}

/* Ensure cards take full height */
.card {
    display: flex;
    flex-direction: column;
}

.card-body, .card .p-4 {
    flex: 1 1 auto;
}

/* Debug borders (remove after testing if desired) */
.debug-border {
    border: 1px dashed red;
}