/* ===================================
   EDC Structural - Professional Styling
   =================================== */

/* Root Variables */
:root {
    --primary-color: #1e2a3a;
    --primary-color-alt: #263449;
    --secondary-color: #2c5282;
    --secondary-color-soft: #7ea0c4;
    --accent-color: #3f6f9e;
    --bg-color: #eef1f5;
    --surface-color: #ffffff;
    --text-light: #f5f7fa;
    --text-dark: #1f2937;
    --text-muted: #64748b;
    --warning-color: #b5842a;
    --notice-bg: #fdf3e0;
    --notice-text: #7a5210;
    --success-color: #2f8a4d;
    --border-color: #d7dee7;
    --shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

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

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Header Styles */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-alt) 100%);
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.site-logo {
    width: 200px;
    height: auto;
    margin-right: 30px;
}

.header-text h1 {
    margin: 0;
    color: var(--text-light);
    font-size: 2.2em;
    font-weight: 300;
}

.subtitle {
    margin: 5px 0 0 0;
    color: var(--secondary-color-soft);
    font-size: 1.1em;
    font-weight: 300;
}

/* Disclaimer Banner */
.disclaimer-banner {
    background: var(--notice-bg);
    padding: 12px 20px;
    text-align: center;
    font-weight: 500;
    border-bottom: 1px solid var(--warning-color);
}

.disclaimer-banner p {
    color: var(--notice-text);
    margin: 0;
}

.disclaimer-banner strong {
    font-weight: 700;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Workflow tabs */
.workflow-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 20px 18px 20px;
}

.workflow-tab {
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.workflow-tab:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.workflow-tab.is-active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-light);
}

.workflow-panel {
    display: none;
}

.workflow-panel.is-active {
    display: block;
}

.structure-setup-card {
    margin: 20px;
    padding: 18px;
    background: #f3f6fb;
    border: 1px solid #d6dfeb;
    border-radius: 8px;
    color: #1f2b3d;
}

.structure-setup-card h3 {
    margin-top: 0;
}

.properties-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
}

.structure-properties-fields {
    min-width: 0;
}

.structure-properties-fields .form-row {
    margin: 0 0 12px;
}

.structure-guide-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
    align-items: start;
}

.structure-guide-figure {
    background: #ffffff;
    border: 1px solid #d8dadd;
    border-radius: 3px;
    padding: 6px;
}

.structure-guide-figure img {
    width: 100%;
    height: auto;
    display: block;
}

.structure-properties-drawing {
    width: 100%;
    min-height: 280px;
    background: #ffffff;
}

.structure-properties-drawing svg {
    display: block;
    width: 100%;
    height: auto;
}

.property-structure {
    fill: #f8f8f8;
    stroke: #4b4f54;
    stroke-width: 2;
    stroke-linejoin: round;
}

.property-ground {
    fill: #9a9da1;
}

.property-post,
.property-dimension {
    fill: none;
    stroke: #62666b;
    stroke-width: 1.5;
}

.property-post {
    stroke-width: 2;
}

.property-mast {
    stroke: #4b4f54;
    stroke-width: 4;
}

.property-pole-base {
    fill: #f8f8f8;
    stroke: #4b4f54;
    stroke-width: 2;
}

.property-oblique {
    stroke: #62666b;
    stroke-width: 1.5;
}

.property-angle-base,
.property-angle-arc {
    fill: none;
    stroke: #62666b;
    stroke-width: 1.5;
}

.property-angle-label {
    fill: #3f4348;
    font-size: 12px;
    font-weight: 500;
}

.property-label {
    fill: #3f4348;
    font-size: 12px;
    font-weight: 500;
}

.structure-properties-summary {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    border-radius: 6px;
    color: #334155;
    font-size: 13px;
}

.structure-guide-content h4 {
    margin: 0 0 8px 0;
    color: #19314f;
}

.structure-guide-content p {
    color: #334155;
    margin: 0 0 8px 0;
    padding-left: 0;
}

#structure-guide-dimensions {
    margin: 0;
    padding-left: 18px;
    color: #1f2f46;
}

#structure-guide-dimensions li {
    margin: 6px 0;
}

/* In-app status and notifications */
#toast-host {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}

.app-toast {
    color: #fff;
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    font-size: 13px;
    line-height: 1.35;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-toast.fade-out {
    opacity: 0;
    transform: translateY(-4px);
}

.app-toast-info {
    background: #2d6cdf;
}

.app-toast-success {
    background: #2f8a4d;
}

.app-toast-warning {
    background: #c77700;
}

.app-toast-error {
    background: #b23a3a;
}

.analysis-status {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 13px;
    min-height: 20px;
}

.analysis-status strong {
    color: var(--text-dark);
    margin-right: 8px;
}

.analysis-status.is-busy strong::before {
    content: "● ";
    color: var(--secondary-color);
}

.compatibility-controls {
    display: none;
}

.site-map-columns {
    display: grid;
    grid-template-columns: 3fr 7fr;
    gap: 18px;
    align-items: start;
    margin: 12px 0;
}

.site-map-columns gmp-map {
    margin: 0;
    width: 100%;
}

.site-shielding-panel {
    margin: 0;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #d6dde6;
    border-radius: 4px;
    color: #263342;
    min-width: 0;
}

.site-shielding-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.site-shielding-heading h3 {
    margin: 0;
    color: #263342;
}

.site-shielding-heading span,
.site-shielding-review {
    color: #64748b;
    font-size: 12px;
}

.site-shielding-directions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px;
}

.site-multiplier-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
    border-bottom: 1px solid #cbd5e1;
}

.site-multiplier-tab {
    flex: 1;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    padding: 6px 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.site-multiplier-tab:hover,
.site-multiplier-tab.is-selected {
    border-color: #cbd5e1;
    border-bottom-color: #475569;
    background: #fff;
    color: #1e293b;
}

.site-shielding-direction {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 7px 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.site-shielding-direction:hover,
.site-shielding-direction.is-selected {
    border-color: #64748b;
    background: #eef2f6;
}

.site-shielding-direction strong {
    font-size: 12px;
}

.site-shielding-direction span {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.site-shielding-review {
    margin-top: 10px;
    min-height: 18px;
}

.site-terrain-category-legend {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #334155;
}

.site-terrain-category-legend[hidden] {
    display: none;
}

.tc-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tc-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.tc-swatch-tc1 { background: #0066CC; }
.tc-swatch-tc2 { background: #33AA33; }
.tc-swatch-tc2-5 { background: #FFAA00; }
.tc-swatch-tc3 { background: #FF6600; }
.tc-swatch-tc4 { background: #CC0000; }

@media (max-width: 768px) {
    .site-multiplier-tabs {
        flex-wrap: wrap;
    }

    .site-shielding-directions {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }
}

/* Footer Styles */
.site-footer {
    background: #1a1d2e;
    margin-top: 50px;
    padding: 40px 0 20px 0;
    border-top: 3px solid var(--secondary-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

.footer-section h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.footer-section p, .footer-section li {
    color: var(--text-light);
    margin-bottom: 8px;
}

.footer-section a {
    color: var(--secondary-color-soft);
    text-decoration: none;
}

.footer-section a:hover {
    text-decoration: underline;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    padding: 2px 0;
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #333;
    margin-top: 30px;
    color: #9aa5b8;
    font-size: 0.9em;
}

/* Legacy Styles (keeping for compatibility) */
gmp-map {
    display: block;
    margin: 20px;
    width: 95%;
    height: 500px;
    margin-bottom: 1em;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

h1 {
    color: var(--text-light);
    text-align: center;
}

h2 {
    color: var(--secondary-color);
    text-align: center;
    margin-top: 30px;
}

h3 {
    color: var(--text-dark);
    margin-left: 20px;
}
p{
    color: var(--text-dark);
    text-align: left;
    text-overflow: clip;
    margin:auto;
    padding-left: 20px;
    line-height: 1.5;
}
label{
    color: var(--text-dark);
    text-overflow: clip;
    margin: auto;
    padding-left: 20px;
    line-height: 1.5;
    font-weight: 600;
}
small{
    color: var(--text-muted);
    text-align: left;
    text-overflow: clip;
    margin:auto;
    padding-left: 20px;
    line-height: 1.5;
}

/* Location Info Styling */
#location-info {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 10px 20px;
    padding: 15px;
}

#location-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

#location-details {
    font-size: 14px;
}

#location-details div {
    margin: 5px 0;
    color: #555;
}

#coord-inputs {
    margin: 5px 20px;
    font-family: monospace, sans-serif;
    font-size: 10px;
    padding: 8px 8px;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    
}

/* Form row styling for inline labels and inputs */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 20px;
}

.form-row[hidden] {
    display: none !important;
}

.form-row label {
    flex: 0 0 250px; /* Fixed width for labels */
    margin: 0;
    padding: 0;
    padding-right: 10px;
}

.form-row input,
.form-row select {
    flex: 1;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.field-help {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

/*Building Section*/

#building-section {
    padding: 20px 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    margin: 20px;
    flex: auto; /* Allow it to grow and shrink */
    box-sizing: border-box;
    border-radius: 6px;
    width: 95%; /* Set a width for the section */

}

/* Two columns layout for multipliers */
.two-columns {
    display: flex;
    gap: 24px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.two-columns.single-panel > *:first-child {
    flex: 1 1 100%;
}

#wind-multipliers, #snow-multipliers {
    flex: 1 1 0;
    min-width: 320px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px 0;
    margin: 20px 0;
    box-sizing: border-box;
}

#factors, #snow-factors {
    flex: 1 1 0;
    min-width: 320px;
    padding: 10px;
    color: var(--text-dark);
    margin: 20px;
}

.shielding-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.mini-action-btn {
    border: 1px solid #2d3d55;
    background: #324866;
    color: #fff;
    border-radius: 5px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.mini-action-btn:hover {
    background: #3c567a;
}

#advanced-terrain-status label {
    color: #333 !important;
    font-weight: normal;
    padding-left: 0;
}

#start-terrain-analysis:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#terrain-analysis-result {
    color: #333 !important;
    font-size: 11px;
    line-height: 1.4;
}

/* Analysis progress indicator from terrainCategory.js */
.analysis-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.progress-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    min-width: 300px;
}

.progress-content h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.progress-text {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    width: 0%;
    transition: width 0.3s ease;
}

/* Ring Distance Labels */
.ring-distance-label {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #ccc !important;
    border-radius: 3px !important;
    padding: 2px 4px !important;
    font-family: 'Arial', sans-serif !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #000000 !important;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* Calculate Section */
.calculate-section {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.calculate-btn {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.calculate-btn:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.calculate-btn:active {
    transform: translateY(0);
}

.calculate-btn.secondary {
    background: linear-gradient(135deg, #64748b, #475569);
}

.report-panel-card {
    margin: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    color: var(--text-dark);
    box-shadow: var(--shadow);
}

.report-panel-card p {
    color: #333;
    margin: 0 0 8px 0;
    padding-left: 0;
}

.report-summary {
    background: #f8fafc;
    border: 1px solid #d6e0eb;
    border-radius: 6px;
    padding: 12px;
    margin: 14px 0;
}

.report-summary div {
    color: #1f2937;
    margin: 4px 0;
}

.report-location-block {
    margin: 6px 0 0 0;
    padding: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    white-space: pre-wrap;
    color: #334155;
    font-size: 12px;
    line-height: 1.35;
}

.report-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Wind Results Section */
#wind-results-section {
    margin: 30px 0;
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    color: var(--text-dark);
    box-shadow: var(--shadow);
}

#wind-results-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.results-table th {
    background: var(--primary-color);
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.results-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.results-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.results-table tr:hover {
    background-color: #f0f8ff;
}

.design-wind-speed {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border-radius: 6px;
    margin-top: 20px;
}

.design-wind-speed h4 {
    color: white;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

/* Responsive Table */
@media (max-width: 768px) {
    .workflow-tabs {
        margin-left: 0;
        margin-right: 0;
    }

    .workflow-tab {
        flex: 1 1 calc(50% - 10px);
        text-align: center;
    }

    .structure-guide-grid {
        grid-template-columns: 1fr;
    }

    .properties-two-column {
        grid-template-columns: 1fr;
    }

    .site-map-columns {
        grid-template-columns: 1fr;
    }

    .results-table th,
    .results-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .results-table th {
        font-size: 11px;
    }
}
