/* Roof Pitch Calculator Specific Styles */

/* Mode inputs container */
.mode-inputs {
    transition: opacity 0.2s ease;
}

.mode-inputs.hidden {
    display: none;
}

/* Input Unit Group styles */
.input-unit-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-unit-group .form-input {
    flex: 1;
}

/* Unit label (static text like "/ 12" or "degrees") */
.unit-label {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    min-width: 60px;
    justify-content: center;
}

/* Form hint text */
.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #666;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Results section title */
.results-section-title {
    color: #003049;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Results value styling */
.results-value {
    font-weight: 600;
    color: #003049;
}

/* Pitch Diagram Styles */
.pitch-diagram-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    margin-bottom: 16px;
    background-color: #f8fafc;
    border-radius: 8px;
}

.pitch-diagram {
    position: relative;
    width: 180px;
    height: 120px;
}

.diagram-base {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 140px;
    height: 3px;
    background-color: #003049;
}

.diagram-roof {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 140px;
    height: 3px;
    background-color: #d62828;
    transform-origin: left center;
    transition: transform 0.3s ease;
}

.diagram-rise {
    position: absolute;
    left: 145px;
    bottom: 10px;
    width: 3px;
    height: 70px;
    background-color: #669bbc;
    display: flex;
    align-items: center;
    transition: height 0.3s ease;
}

.diagram-rise .diagram-label {
    position: absolute;
    right: -45px;
    font-size: 12px;
    font-weight: 600;
    color: #669bbc;
    white-space: nowrap;
}

.diagram-run {
    position: absolute;
    bottom: 0;
    left: 10px;
    width: 140px;
    display: flex;
    justify-content: center;
}

.diagram-run .diagram-label {
    font-size: 12px;
    font-weight: 600;
    color: #003049;
}

/* Reference Table Section */
.reference-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-top: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.reference-section h2 {
    margin-bottom: 16px;
    color: #003049;
    font-size: 1.5rem;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.reference-table th,
.reference-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.reference-table th {
    background-color: #003049;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.reference-table th:first-child {
    border-radius: 8px 0 0 0;
}

.reference-table th:last-child {
    border-radius: 0 8px 0 0;
}

.reference-table tbody tr:hover {
    background-color: #f8fafc;
}

.reference-table tbody tr:last-child td {
    border-bottom: none;
}

.reference-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 8px;
}

.reference-table tbody tr:last-child td:last-child {
    border-radius: 0 0 8px 0;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .button-group {
        flex-direction: column;
    }

    .input-unit-group {
        flex-direction: row;
        gap: 8px;
    }

    .unit-label {
        min-width: 50px;
        padding: 0 8px;
        font-size: 13px;
    }

    .pitch-diagram-container {
        padding: 16px;
    }

    .pitch-diagram {
        width: 150px;
        height: 100px;
    }

    .diagram-base {
        width: 120px;
    }

    .diagram-roof {
        width: 120px;
    }

    .diagram-rise {
        left: 125px;
        height: 60px;
    }

    .diagram-run {
        width: 120px;
    }

    .reference-section {
        padding: 16px;
        margin-top: 24px;
    }

    .reference-section h2 {
        font-size: 1.25rem;
        margin-bottom: 12px;
    }

    .reference-table th,
    .reference-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .faq-section {
        padding: 16px;
        margin-top: 24px;
    }

    .faq-section h2 {
        font-size: 20px;
        margin-bottom: 16px;
    }
}

/* Ensure results grid items don't overflow */
.results-item {
    word-wrap: break-word;
    overflow-wrap: break-word;
}
