* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
}
body {
  position: relative
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.header {
    background: linear-gradient(135deg, #335d8f 0%, #3a8aa0 100%);
    background-image: url(assets/1976343.jpg);
    background-size: cover;
    background-position: center;
    color: white;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header p {
  font-size: 1.25rem;
  opacity: 0.7;
  font-style: italic;
  font-weight: 100;
}

h2 {
    margin-bottom: 1rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calculator-section, .results-section, .details-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.ad-space {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.form-group input {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

/* Styles for unit of measure indicators on input slements ---------------------------------------------*/
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

/* the first half of the input element */
.input-group > :first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
}

/* the second half of the input element */
.input-group > :nth-child(2) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group-text {
    background-color: white;
}

/* formats the unit of measure component */
.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #333;
    text-align: center;
    white-space: nowrap;
    background-color: #f6f6f6;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
}

/* the first half of the input element where the unit of measure is on the left - makes the remainder of the input expand to fill space */
.input-group-beginning-descriptor > :nth-child(2) {
    flex: 1 1 auto;
}
/*--------------------------------------------------------------------------------------------------------*/

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group .instructions {
    font-size: 14px;
    color: #888;
    margin-top: 5px;
    margin-left: 3px;
    font-style: italic;
}

/* Remove the number incrementing arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0; /* Optional: Removes any default margin */
}
input[type=number] {
    -moz-appearance: textfield;
}

.calculate-btn {
    background: linear-gradient(135deg, #335d8f 0%, #3a8aa0 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    width: 100%;
    margin-top: 20px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.results-section {
    display: none;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

.summary-item h3 {
    color: #428bd5;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.summary-item .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

.details-btn {
    background: #428bd5;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.details-btn:hover {
    background: #5795d3;
}

.details-section {
    display: none;
}


    .details-section {
        max-width: calc(100vw - 60px);
        overflow-x: scroll
    }

.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.details-table th,
.details-table td {
    padding: 10px;
    text-align: right;
    border-bottom: 1px solid #e1e5e9;
}

.details-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.details-table td:first-child,
.details-table th:first-child {
    text-align: left;
}

.error {
    border-color: #dc3545 !important;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
        max-width: 800px;
    }
    
    .sidebar {
        grid-row: 1;
    }
    
    .main-content {
        grid-row: 2;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {

    .header {
        height: 180px;
        padding: 45px 10px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .header p {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .calculator-section, .results-section, .details-section {
        background: white;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 20px;
        margin-left: -20px;
        margin-right: -20px;
        padding: 30px 15px;
    }   
    
    .details-section {
        max-width: 100vw;
        overflow-x: scroll
    }

    .form-group label {
        font-size: 14px;
    }

    .form-group input {
        font-size: 14px;
    }

    .calculate-btn {
        font-size: 16px;
    }

    .summary-item h3 {
        font-size: 0.8rem;
    }

    .summary-item .value {
        font-size: 1.5rem;
    }
}

@media print {
    .container {
        grid-template-columns: 1fr;
        max-width: none;
    }
    
    .sidebar,
    .calculate-btn,
    .details-btn {
        display: none;
    }
    
    .calculator-section {
        display: none;
    }
    
    .results-section,
    .details-section {
        display: block !important;
        box-shadow: none;
        margin: 0;
    }
    
    .results-section {
        page-break-after: always;
    }
    
    .details-section {
        page-break-before: always;
    }
}