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

:root {
    /* PCF brand: green and black */
    --primary-dark: #1a1a1a;
    --primary-black: #1a1a1a;
    --primary-green: #1a472a;
    --accent-green: #2d7d46;
    --primary-light: #e8f0ea;
    --primary-gold: #2d7d46;    /* accent (green) for highlights */
    --background-color: #f0f4f0;
    --border-color: #c5d9c9;
    --text-color: #1a1a1a;
}

body {
    font-family: 'Arboria', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.2;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    margin: 0;
    box-sizing: border-box;
}

.top-row {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 8px;
}

.bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.site-header {
    width: 100%;
    min-height: 110px;
    padding: 12px 0;
    margin-bottom: 24px;
    text-align: center;
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: auto;
}

.logo a {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.logo img {
    max-width: 100%;
    height: auto;
    margin: 0;
}

.site-header h1 {
    font-size: 24px;
    color: var(--primary-dark);
    margin: 0;
    padding: 0 16px;
    word-wrap: break-word;
}

h2 {
    color: var(--primary-dark);
    border-bottom: 1px solid var(--primary-green);
    padding-bottom: 3px;
    margin: 8px 0 5px;
    font-size: 16px;
    font-weight: normal;
}

h3 {
    color: var(--primary-dark);
    font-size: 14px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin: 10px 0;
}

.section {
    background-color: white;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Make measurements section span full width */
.measurements {
    grid-column: 1 / -1;
}

.measurements .form-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    flex: 1;
}

label {
    margin: 0;
    line-height: 1.2;
}

input[type="number"] {
    width: calc(100% - 16px);
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 13px;
}

.radio-group,
.checkbox-group {
    margin-bottom: 4px;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    min-height: 32px;
    margin: 0;
}

.radio-label span,
.checkbox-label span {
    font-size: 13px;
    line-height: 1.2;
}

input[type="radio"],
input[type="checkbox"] {
    margin: 0;
    transform: scale(1.5);
    flex-shrink: 0;
    margin-right: 4px;
}

/* Remove any previous grid styles that might interfere */
.form-group:not(.measurements .form-group) {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Keep the measurements section grid layout */
.measurements .form-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

button {
    background-color: var(--primary-gold);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    margin: 10px auto;
    width: 160px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
    grid-column: 1 / -1;
}

button:hover {
    background-color: var(--primary-dark);
}

#result {
    font-size: 13px;
}

#result h3 {
    color: var(--primary-dark);
    display: none; /* Hide the "Cost Breakdown" header since we now use h2 */
}

#result p {
    margin: 4px 0;
}

#result strong {
    color: var(--primary-gold);
    font-size: 1.1em;
}

.quote {
    font-style: italic;
    font-size: 20px;
    color: var(--primary-dark);
}

/* Tablet and smaller screens */
@media (max-width: 768px) {
    .container {
        padding: 8px;
    }
    
    .logo {
        left: 8px;
    }

    .measurements .form-group {
        grid-template-columns: 1fr 1fr;
    }

    .top-row,
    .bottom-row {
        grid-template-columns: 1fr;
    }

    .main-layout {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .section {
        padding: 10px;
        height: auto;
    }

    .cost-summary {
        margin-top: 4px;
        padding: 12px;
    }

    .reset-button {
        right: 8px;
    }

    .left-column,
    .right-column {
        gap: 4px;
    }

    .section:has(> h2:first-child:contains("Measurements")) {
        margin-bottom: 4px;
    }
}

/* Even smaller screens */
@media (max-width: 480px) {
    .container {
        padding: 6px;
    }
    
    .logo {
        left: 6px;
    }

    .measurements .form-group {
        grid-template-columns: 1fr;
    }

    .main-layout {
        gap: 3px;
    }
    
    .section {
        padding: 8px;
        height: auto;
    }

    .cost-summary {
        margin-top: 3px;
        padding: 10px;
    }

    .reset-button {
        right: 6px;
    }

    .left-column,
    .right-column {
        gap: 3px;
    }

    .section:has(> h2:first-child:contains("Measurements")) {
        margin-bottom: 3px;
    }
}

.cost-summary {
    background-color: #e5dacc;
    position: relative;
    padding: 16px;
    border-radius: 8px;
    overflow: hidden;
    grid-column: 1 / -1;
    margin-top: 6px;
    background-color: var(--primary-light);
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    box-sizing: border-box;
    height: auto;
}

.cost-summary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    opacity: 0.15;
    pointer-events: none;
}

.cost-summary .section-header {
    margin-bottom: 24px;
}

.cost-summary .section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-dark);
    border-bottom: none;
}

.cost-summary #result {
    position: relative;
    z-index: 1;
}

.cost-summary .summary-item {
    margin: 12px 0;
    font-size: 16px;
    color: var(--primary-dark);
}

.cost-summary .summary-item strong {
    font-weight: 600;
    margin-right: 8px;
}

.cost-summary .value {
    font-weight: 500;
}

.cost-summary .total-cost {
    margin-top: 0;
    padding-top: 0;
    font-size: 20px;
    color: var(--primary-dark);
}

.cost-summary .total-cost strong {
    font-weight: 600;
    margin-right: 8px;
}

.cost-summary .total-cost .value {
    color: var(--primary-gold);
    font-weight: 600;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    margin: 0;
    flex-grow: 1;
}

.section-total {
    color: var(--primary-gold);
    font-weight: bold;
    font-size: 14px;
    margin-left: 10px;
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.login-logo {
    width: 200px;
    margin-bottom: 30px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-form input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.login-form button {
    width: 100%;
    margin: 0;
}

.reset-button {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    padding: 8px 16px;
    font-size: 14px;
    z-index: 1;
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.custom-text {
    flex-grow: 1;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 13px;
}

.custom-price-wrapper {
    display: flex;
    align-items: center;
    gap: 2px;
}

.dollar-sign {
    color: var(--text-color);
    font-size: 13px;
}

.custom-price {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 13px;
}

/* Ventilation Calculator Tables */
.vent-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    table-layout: fixed;
}

.vent-table th,
.vent-table td {
    padding: 4px 6px;
    text-align: left;
    border: 1px solid #e0e0e0;
    vertical-align: middle;
    font-size: 13px;
    line-height: 1.1;
}

.vent-table th {
    background-color: var(--primary-dark);
    color: white;
    font-weight: 500;
    padding: 6px;
}

/* Column width adjustments */
.vent-table th:nth-child(1),
.vent-table td:nth-child(1) { width: 45%; }
.vent-table th:nth-child(2),
.vent-table td:nth-child(2) { width: 15%; }
.vent-table th:nth-child(3),
.vent-table td:nth-child(3) { width: 10%; }
.vent-table th:nth-child(4),
.vent-table td:nth-child(4) { width: 15%; }
.vent-table th:nth-child(5),
.vent-table td:nth-child(5) { width: 15%; }

/* Input styles for the ventilation table */
.vent-table input[type="number"] {
    width: 45px;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
}

/* Description input style */
.vent-description {
    width: 100px;
    margin-left: 8px;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    display: inline-block;
    vertical-align: baseline;
}

/* Total row style */
.vent-table .total-row {
    background-color: #f5f5f5;
    font-weight: 600;
}

.vent-table .total-row td {
    border-top: 2px solid #ccc;
    padding: 4px 6px;
}

/* Section spacing */
.form-group {
    margin-bottom: 4px;
}

/* Heading adjustments */
.form-group h3 {
    margin: 8px 0 4px 0;
    font-size: 14px;
}

/* Make the layout more compact for iPad */
.calculator-container {
    max-width: 768px;
    margin: 0 auto;
    padding: 1rem;
}

/* Adjust section spacing */
section {
    margin-bottom: 1rem;
}

/* Make headings more compact */
h2, h3 {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

/* Compact list styles */
ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

li {
    margin: 0.25rem 0;
}

/* Compact measurements section */
.measurements-section {
    padding: 8px;
}

.measurements-section .form-group.compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-row label {
    margin: 0;
    white-space: nowrap;
}

.input-row input,
.input-row select {
    flex: 1;
    min-width: 0;
}

.conversion-display {
    font-size: 12px;
    color: var(--text-color);
    background-color: var(--primary-light);
    padding: 2px 4px;
    border-radius: 3px;
    margin: 2px 0;
}

/* Requirements section */
.requirements-section {
    padding: 8px;
}

.requirements-section ul {
    margin: 4px 0;
    padding-left: 1.2rem;
}

.requirements-section li {
    margin: 2px 0;
}

/* Ventilation section */
.ventilation-section {
    padding: 8px;
}

/* Products and Summary sections */
.products-section,
.summary-section {
    padding: 8px;
}

.summary-section {
    background-color: var(--primary-light);
    background-image: url('Assets/logo/PCF%20Logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 120px;
    background-blend-mode: soft-light;
}

/* Main layout structure */
.main-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 0;
    background-color: var(--background-color);
    border-radius: 8px;
    align-items: stretch;
}

/* Column styles */
.left-column,
.right-column {
    display: grid;
    gap: 6px;
    align-items: stretch;
}

/* Measurements section - ensure it spans full width */
.section:has(> h2:first-child:contains("Measurements")) {
    grid-column: 1 / -1;
    margin-bottom: 6px;
    height: auto;
}

/* Cost summary section - ensure it spans full width */
.cost-summary {
    grid-column: 1 / -1;
    margin-top: 6px;
    background-color: var(--primary-light);
    padding: 16px;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    box-sizing: border-box;
    height: auto;
}

/* Remove any previous grid area assignments */
.section:has(> h2:first-child:contains("Ground Level Decking")),
.section:has(> h2:first-child:contains("Railings")),
.section:has(> h2:first-child:contains("Framing")),
.section:has(> h2:first-child:contains("Second Story Decking")),
.section:has(> h2:first-child:contains("Additional Options")) {
    grid-area: unset;
}

.photo-link {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    color: var(--primary-gold);
    text-decoration: none;
    padding: 2px 6px;
    border: 1px solid var(--primary-gold);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.photo-link:hover {
    background-color: var(--primary-gold);
    color: white;
}

/* Measurements specific styles */
.section:has(> h2:first-child:contains("Measurements")) {
    padding: 24px 16px;
    grid-column: 1 / -1;
}

.section:has(> h2:first-child:contains("Measurements")) .form-group {
    gap: 16px;
    margin-bottom: 32px;
}

.section:has(> h2:first-child:contains("Measurements")) input[type="number"] {
    height: 36px;
    margin: 4px 0;
}

/* Framing specific styles */
.section:has(> h2:first-child:contains("Framing")) {
    padding: 16px;
}

.section:has(> h2:first-child:contains("Framing")) .checkbox-label {
    padding: 4px 0;
    min-height: 28px;
}

.section:has(> h2:first-child:contains("Framing")) .custom-option {
    margin-top: 4px;
    padding-top: 4px;
}

.section:has(> h2:first-child:contains("Measurements")) .form-group {
    gap: 8px;
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
} 