@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0 480px;
    background: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a1a;
    line-height: 1.6;
    font-weight: 400;
}

.technical-background {
    background-color: #fafafa;
}

.report-container, .blueprint-container {
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.report-content {
    padding: 60px 40px 40px 40px;
}

.report-header, .title-block {
    padding-bottom: 20px;
    margin-bottom: 40px;
    text-align: left;
}

.report-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.title-input {
    font-size: 28px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    outline: none;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: inherit;
    height: auto;
    display: block;
}

.report-header .subtitle {
    font-size: 18px;
    font-weight: 400;
    color: #000;
    margin-bottom: 30px;
}

.report-info, .drawing-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    font-size: 12px;
    text-align: left;
}

.info-item, .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.info-label, .label {
    font-weight: 600;
    color: #000;
    font-family: 'Inconsolata', monospace;
    text-transform: uppercase;
}

.info-value, .value {
    color: #000;
    font-family: 'Inconsolata', monospace;
    font-weight: 500;
}

.info-input {
    color: #000;
    font-family: 'Inconsolata', monospace;
    font-weight: 500;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    outline: none;
    width: 100%;
    text-align: right;
    line-height: inherit;
    font-size: inherit;
    height: auto;
}

.report-section {
    margin-bottom: 40px;
    break-inside: avoid;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    border-bottom: 3px solid #000 !important;
    padding-bottom: 10px;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.parameters-input {
    background: white;
    border: none;
    padding: 0;
    margin-bottom: 40px;
    border-radius: 0;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

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

.input-group label {
    font-family: 'Inconsolata', monospace;
    font-weight: 500;
    font-size: 12px;
    color: #333;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.input-group input,
.input-group select {
    padding: 10px 15px;
    border: 2px solid #000;
    border-radius: 0;
    font-family: 'Inconsolata', monospace;
    font-size: 14px;
    background: white;
    color: #000;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #000;
    box-shadow: none;
    background: white;
}


/* Diagrams Stack */
.diagrams-grid {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin-bottom: 40px;
}

.diagram-panel {
    background: white;
    position: relative;
    border: none;
}

.diagram-panel h3 {
    margin: 0 0 15px 0;
    padding: 0 0 6px 0;
    background: none;
    color: #000;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: left;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    border-bottom: 2px solid #000 !important;
}

.diagram-container {
    padding: 0;
    min-height: 400px;
    max-height: 600px;
    position: relative;
    margin-bottom: 20px;
    overflow: hidden;
    width: 100%;
}

.diagram-container:not(.technical-background) {
    background: white;
}

svg {
    width: 100%;
    height: 100%;
    max-height: 500px;
    background: transparent;
    display: block;
    object-fit: contain;
}

.construction-line {
    stroke: #666;
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 4,4;
    opacity: 0.8;
}

.dimension-line {
    stroke: #000;
    stroke-width: 1;
    fill: none;
    marker-end: url(#arrowhead);
    marker-start: url(#arrowhead);
}

.soakaway-outline {
    stroke: #000;
    stroke-width: 2;
    fill: none;
}

.soil-layer {
    fill: #000;
    fill-opacity: 1.0;
    stroke: #000;
    stroke-width: 1;
    stroke-dasharray: 4,2;
}

.water-level {
    fill: #d0d0d0;
    fill-opacity: 0.4;
    stroke: #666;
    stroke-width: 1;
    stroke-dasharray: 8,4;
}

.gravel-fill {
    fill: #f0f0f0;
    fill-opacity: 0.3;
    stroke: #999;
    stroke-width: 4;
    stroke-dasharray: 4,4;
}

.geotextile {
    stroke: #333;
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 4,2;
}

.dimension-text {
    font-family: 'Inconsolata', monospace;
    fill: #000;
    text-anchor: middle;
    dominant-baseline: central;
    font-weight: 500;
}

.dimension-text-bg {
    fill: white;
    stroke: white;
    stroke-width: 3;
    opacity: 0.9;
}

.label-text {
    font-family: 'Inconsolata', monospace;
    fill: #333;
    text-anchor: middle;
    font-weight: 500;
}

.title-text {
    font-family: 'Inconsolata', monospace;
    font-size: 12px;
    fill: #000;
    font-weight: 600;
    text-anchor: middle;
}

.diagram-notes {
    padding: 20px 0;
    border-top: none;
    background: white;
}

.diagram-notes h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-align: left;
    border-bottom: 3px solid #000 !important;
    padding-bottom: 10px;
}

.diagram-notes ul {
    margin: 0;
    padding-left: 15px;
    font-size: 11px;
    line-height: 1.5;
}

.diagram-notes li {
    margin-bottom: 8px;
    color: #000;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.editable-notes {
    list-style: none;
    padding-left: 0;
}

.note-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    position: relative;
}

.note-item:before {
    content: "•";
    margin-right: 8px;
    color: #000;
    font-weight: bold;
}

.note-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 2px 4px;
    margin: 0;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: #000;
}

.note-input:focus {
    background: #f9f9f9;
    border: 1px solid #ddd;
}

.delete-note {
    opacity: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    margin-left: 8px;
    padding: 2px 4px;
    font-size: 12px;
    transition: opacity 0.2s;
}

.note-item:hover .delete-note {
    opacity: 1;
}

.delete-note:hover {
    background: #ffebee;
    border-radius: 2px;
}

.add-note {
    background: transparent;
    border: 1px dashed #666;
    color: #666;
    padding: 6px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    cursor: pointer;
    border-radius: 2px;
    margin-top: 10px;
}

.add-note:hover {
    background: #f5f5f5;
    color: #000;
    border-color: #000;
}

.info-button {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #000;
    color: white;
    border: none;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 8px;
    vertical-align: middle;
    line-height: 18px;
    text-align: center;
}

.info-button:hover {
    background: #333;
}

.technical-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 50%;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow: hidden;
}

.technical-panel.open {
    right: 0;
}

.technical-panel-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.technical-panel-header {
    background: #000;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.technical-panel-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.close-panel {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-panel:hover {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.technical-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.technical-section {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.technical-section:last-child {
    border-bottom: none;
}

.technical-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0 0 15px 0;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.technical-section p {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 15px 0;
    font-family: 'Inter', sans-serif;
}

.technical-section ul, .technical-section ol {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 15px 0;
    padding-left: 20px;
    font-family: 'Inter', sans-serif;
}

.technical-section li {
    margin-bottom: 8px;
}

.equation {
    background: #f8f8f8;
    border: 2px solid #000;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
    font-family: 'Inconsolata', monospace;
    font-size: 16px;
    font-weight: 600;
}

.constants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

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

.constant-group label {
    font-family: 'Inconsolata', monospace;
    font-weight: 500;
    font-size: 11px;
    color: #333;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.constant-group input {
    padding: 8px 12px;
    border: 2px solid #000;
    border-radius: 0;
    font-family: 'Inconsolata', monospace;
    font-size: 13px;
    background: white;
    color: #000;
}

.constant-group input:focus {
    outline: none;
    border-color: #000;
    box-shadow: none;
    background: white;
}

.reset-constants-btn {
    background: #666;
    color: white;
    border: none;
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 15px;
}

.reset-constants-btn:hover {
    background: #000;
}

@media (max-width: 1200px) {
    .technical-panel {
        width: 60%;
    }
}

@media (max-width: 768px) {
    .technical-panel {
        width: 90%;
    }
    
    .technical-panel-header h2 {
        font-size: 16px;
    }
    
    .technical-content {
        padding: 15px;
    }
}

.parameters-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
}

.parameters-table, .calculations-table {
    border: 1px solid #000;
    background: white;
}

.table-header {
    background: #000;
    color: white;
    padding: 15px 20px;
    border-bottom: none;
    font-family: 'Inconsolata', monospace;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.table-content {
    padding: 20px;
}

.parameter-row, .calc-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

.parameter-row:last-child, .calc-row:last-child {
    border-bottom: none;
}

.param-name, .calc-name {
    color: #000;
    flex: 1;
    font-family: 'Inter', sans-serif;
    text-align: left;
}

.param-value, .calc-value {
    color: #000;
    font-family: 'Inconsolata', monospace;
    font-weight: 600;
    text-align: right;
}

.param-unit, .calc-unit {
    color: #000;
    margin-left: 4px;
    font-size: 12px;
    font-family: 'Inconsolata', monospace;
}

.legend-panel {
    grid-column: 1 / -1;
}

.legend-container svg {
    height: 200px;
}

.legend-item {
    font-size: 10px;
}

.legend-sample {
    stroke-width: 2;
}

.export-panel {
    text-align: center;
    padding: 40px 0;
    margin-top: 40px;
}

.export-pdf-button {
    background: #000;
    border: none;
    color: white;
    padding: 15px 40px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.export-pdf-button:hover {
    background: #333;
}

.export-pdf-button:active {
    background: #000;
    transform: translateY(1px);
}

@media (min-width: 1400px) {
    body {
        padding: 0 480px;
    }
    
    .diagram-container {
        max-height: 700px;
    }
    
    svg {
        max-height: 600px;
    }
}

@media (max-width: 1200px) {
    .report-info {
        grid-template-columns: 1fr;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .diagram-container {
        min-height: 350px;
        max-height: 450px;
    }
    
    svg {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0 20px;
    }
    
    .report-content {
        padding: 40px 20px 40px 20px;
    }
    
    .control-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .diagram-container {
        min-height: 300px;
        max-height: 400px;
    }
    
    svg {
        max-height: 350px;
    }
    
    .report-header h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0 10px;
    }
    
    .report-content {
        padding: 30px 15px 30px 15px;
    }
    
    .report-header h1 {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@keyframes blueprint-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.glow-effect {
    animation: blueprint-glow 2s ease-in-out infinite;
}

.report-header h1,
.section-title,
h2,
.diagram-panel h2,
.diagram-notes h3,
.diagram-notes h4,
.controls-panel h3 {
    border-bottom: 3px solid #000 !important;
    padding-bottom: 10px !important;
}


@media print {
    @page {
        size: A4;
        margin: 15mm;
    }
    
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body {
        padding: 0;
        font-size: 11pt;
        line-height: 1.6;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
        color: #1a1a1a;
        -webkit-font-feature-settings: "kern" 1;
        font-feature-settings: "kern" 1;
    }
    
    .report-container {
        box-shadow: none;
        max-width: none;
        background: white;
        min-height: auto;
    }
    
    .report-content {
        padding: 40pt 30pt 30pt 30pt;
    }
    
    .export-panel,
    .add-note,
    .delete-note,
    .info-button,
    .technical-panel,
    .note-item button {
        display: none !important;
    }
    
    .parameters-input {
        display: block !important;
        background: white;
        border: none;
        padding: 0;
        margin-bottom: 30pt;
        break-inside: avoid;
    }
    
    .input-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15pt;
    }
    
    .input-group {
        display: flex;
        flex-direction: column;
    }
    
    .input-group label {
        font-family: 'Inconsolata', monospace !important;
        font-weight: 500;
        font-size: 9pt;
        color: #333;
        margin-bottom: 3pt;
        text-transform: uppercase;
    }
    
    .input-group input,
    .input-group select {
        padding: 8pt 11pt;
        border: 2pt solid #000;
        border-radius: 0;
        font-family: 'Inconsolata', monospace !important;
        font-size: 10pt;
        background: white;
        color: #000;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
    }
    
    .input-group select::-ms-expand {
        display: none;
    }
    
    .input-group input[type="number"]::-webkit-outer-spin-button,
    .input-group input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none !important;
        margin: 0;
    }
    
    .input-group input[type="number"] {
        -moz-appearance: textfield !important;
    }
    
    .title-input,
    .info-input {
        border: none !important;
        background: transparent !important;
        outline: none !important;
        box-shadow: none !important;
        font-family: inherit !important;
        font-size: inherit !important;
        font-weight: inherit !important;
        color: inherit !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .report-section {
        break-inside: avoid;
        margin-bottom: 20pt;
    }
    
    .diagram-panel {
        break-inside: avoid;
        margin-bottom: 30pt;
    }
    
    .diagram-container {
        break-inside: avoid;
        min-height: auto;
        max-height: none;
        height: 250pt;
        border: none;
        background: #fafafa;
    }
    
    svg {
        border: none;
        max-height: none;
        height: 100%;
    }
    
    .report-header {
        padding-bottom: 15pt;
        margin-bottom: 30pt;
        text-align: left;
    }
    
    .report-header h1,
    .title-input {
        font-size: 21pt !important;
        font-weight: 700 !important;
        color: #000 !important;
        text-transform: uppercase;
        letter-spacing: 0.7pt;
        margin: 0 0 8pt 0;
    }
    
    .report-header .subtitle {
        font-size: 13pt !important;
        font-weight: 400;
        color: #000;
        margin-bottom: 22pt;
    }
    
    .report-info {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12pt;
        font-size: 9pt;
        text-align: left;
    }
    
    .info-item {
        display: flex;
        justify-content: space-between;
        padding: 6pt 0;
        border-bottom: 1pt solid #ddd;
    }
    
    .info-label {
        font-weight: 600;
        color: #000;
        font-family: 'Inconsolata', monospace !important;
        text-transform: uppercase;
    }
    
    .info-value,
    .info-input {
        color: #000;
        font-family: 'Inconsolata', monospace !important;
        font-weight: 500;
    }
    
    .section-title {
        font-size: 15pt !important;
        font-weight: 600 !important;
        color: #000;
        border-bottom: 2pt solid #000 !important;
        padding-bottom: 8pt;
        margin: 20pt 0 18pt 0;
        text-transform: uppercase;
        letter-spacing: 0.4pt;
        text-align: left;
    }
    
    .diagram-panel h3 {
        font-size: 11pt !important;
        font-weight: 500;
        letter-spacing: 0.4pt;
        text-align: left;
        font-family: 'Inter', sans-serif;
        text-transform: uppercase;
        border-bottom: 1.5pt solid #000 !important;
        margin: 0 0 12pt 0;
        padding: 0 0 4pt 0;
        color: #000;
    }
    
    .parameters-section {
        display: flex;
        flex-direction: column;
        gap: 22pt;
        margin-top: 22pt;
    }
    
    .parameters-table,
    .calculations-table {
        border: 1pt solid #000;
        background: white;
        break-inside: avoid;
        margin-bottom: 12pt;
    }
    
    .table-header {
        background: #000 !important;
        color: white !important;
        padding: 11pt 15pt;
        border-bottom: none;
        font-family: 'Inconsolata', monospace !important;
        font-size: 10pt;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.4pt;
        text-align: left;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .table-content {
        padding: 15pt;
    }
    
    .parameter-row,
    .calc-row {
        display: flex;
        justify-content: space-between;
        padding: 9pt 0;
        border-bottom: 1pt solid #ddd;
        font-size: 10pt;
    }
    
    .parameter-row:last-child,
    .calc-row:last-child {
        border-bottom: none;
    }
    
    .param-name,
    .calc-name {
        color: #000;
        flex: 1;
        font-family: 'Inter', sans-serif !important;
        text-align: left;
    }
    
    .param-value,
    .calc-value {
        color: #000;
        font-family: 'Inconsolata', monospace !important;
        font-weight: 600;
        text-align: right;
    }
    
    .param-unit,
    .calc-unit {
        color: #000;
        margin-left: 3pt;
        font-size: 9pt;
        font-family: 'Inconsolata', monospace !important;
    }
    
    .diagram-notes {
        padding: 15pt 0;
        border-top: none;
        background: white;
    }
    
    .diagram-notes ul {
        margin: 0;
        padding-left: 11pt;
        font-size: 8pt;
        line-height: 1.5;
    }
    
    .diagram-notes li {
        margin-bottom: 6pt;
        color: #000;
        font-family: 'Inter', sans-serif !important;
        font-size: 10pt;
        line-height: 1.6;
    }
    
    .note-item {
        display: list-item !important;
        list-style-type: disc;
        margin-left: 0;
        margin-bottom: 6pt;
        padding-left: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .note-item:before {
        display: none;
    }
    
    .editable-notes {
        list-style-type: disc;
        padding-left: 14pt;
        margin-left: 0;
        overflow: hidden;
    }
    
    .note-input {
        display: inline !important;
        border: none !important;
        background: transparent !important;
        outline: none !important;
        width: 100% !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        line-height: 1.6;
        font-family: 'Inter', sans-serif !important;
        font-size: 10pt;
        color: #000;
    }
}