/* --- CALCULATOR PAGE STYLES --- */
/* This file builds upon the main css/style.css */

/* --- HERO OVERRIDE --- */
.hero.hero-small {
    min-height: 50vh;
    padding-top: 120px;
    padding-bottom: 40px;
}

.hero.hero-small h1 {
    font-size: 2.8rem; /* Slightly smaller than main hero */
}

/* --- CALCULATOR SPECIFIC STYLES --- */

/* Wrapper */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 380px 1fr; /* Fixed sidebar for inputs */
    gap: 40px;
    align-items: start;
}

/* 1. Legends Panel (Left/Top) */
.legends-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    position: sticky; /* Makes the input panel stick on scroll */
    top: 120px; /* 80px header + 40px spacing */
}
.panel-header { margin-bottom: 20px; border-bottom: 2px solid var(--light-bg); padding-bottom: 15px; }
.panel-header h3 { font-size: 1.1rem; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.panel-header p { font-size: 0.85rem; color: var(--text-light); text-transform: none; font-weight: 400; margin-top: 5px;}

.form-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stack inputs vertically */
    gap: 20px;
}
.form-group label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--text-light); margin-bottom: 4px; text-transform: uppercase; }
.form-group input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 6px; font-weight: 600; color: var(--primary); transition: 0.3s; font-size: 1rem; }
.form-group input:focus { border-color: var(--accent); outline: none; background: #fff7ed; }
.highlight-group {
    grid-column: 1 / -1; /* Make the area input span the full width */
}
.highlight-group input { border-color: var(--accent); background: #fff7ed; font-size: 1.1rem; }

/* 2. Results Area (Right/Bottom) */
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.results-header h2 { color: var(--primary); font-size: 1.5rem; }

.results-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stack result cards vertically */
    gap: 30px;
}

/* Result Cards */
.result-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    border-top: 4px solid var(--text-light); /* Default border */
    transition: all 0.3s ease;
    overflow: hidden;
}
.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}
.result-card.featured {
    border-top-color: var(--accent); /* Featured border color */
}
.result-card.traditional {
    border-top-color: var(--primary); /* Traditional border color */
}

/* Card Header Colors */
.card-head {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
}
.card-head h4 { font-size: 1.1rem; margin-bottom: 8px; color: var(--primary); font-weight: 700; }
.total-price { font-size: 2.2rem; font-weight: 800; font-family: 'Montserrat', sans-serif; color: var(--primary); }
.featured .total-price { color: var(--accent); }

/* Detail Table */
.detail-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.detail-table th { background: #f8fafc; padding: 12px 25px; text-align: left; font-weight: 600; color: var(--text-light); border-bottom: 1px solid var(--border); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.detail-table td { padding: 12px 25px; border-bottom: 1px solid var(--border); color: var(--text-dark); }
.detail-table tr:last-child td { border-bottom: none; }
.detail-table td:nth-child(2) { color: var(--text-light); }
.detail-table td:nth-child(3) { font-weight: 700; text-align: right; }

.disclaimer { margin-top: 20px; font-size: 0.8rem; color: var(--text-light); font-style: italic; }

/* Conclusion Section */
.conclusion {
    margin-top: 40px;
    padding: 40px;
    background-color: #fff7ed; /* A light orange, related to accent */
    border: 1px solid #fde6d4; /* Lighter version of accent */
    border-radius: 12px;
}
.conclusion h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 15px;
}
.conclusion p {
    margin-bottom: 15px;
    line-height: 1.7;
}
.conclusion ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 20px;
}
.conclusion ul li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 10px;
}
.conclusion ul li::before {
    content: '✓';
    color: var(--accent);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .calculator-wrapper {
        grid-template-columns: 1fr; /* Stack on tablets and mobile */
    }
    .legends-panel {
        position: static; /* Remove sticky behavior on mobile */
    }
}

@media (max-width: 768px) {
    .hero.hero-small { padding-top: 100px; padding-bottom: 30px; min-height: 35vh; }
    .hero.hero-small h1 { font-size: 1.8rem; }
    .hero.hero-small p { font-size: 1rem; }
    .results-header { flex-direction: column; gap: 15px; align-items: stretch; }
    .results-header .btn { width: 100%; text-align: center; }
    .legends-panel { padding: 15px; }

    /* Tighten table padding to fit on mobile */
    .detail-table th, .detail-table td { padding: 10px 10px; font-size: 0.8rem; }
    .detail-table td:nth-child(3) { padding-right: 15px; }

    .card-head { padding: 15px; }
    .total-price { font-size: 1.8rem; }

    .conclusion { padding: 20px; margin-top: 25px; }
    .conclusion h3 { font-size: 1.1rem; }

    .form-group input { font-size: 16px; } /* Prevent iOS zoom */
}

/* --- PDF TEMPLATE STYLES --- */
#pdf-wrapper {
    position: fixed; /* Use fixed to keep it in the viewport but hidden */
    top: 0;
    left: 0;
    width: 1100px; /* Fixed width for PDF generation */
    background: white;
    z-index: -1; /* Send it to the back */
    opacity: 0; /* Make it invisible */
    pointer-events: none; /* Make it non-interactive */
}

#pdf-template {
    padding: 40px;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    font-size: 14px; 
    line-height: 1.4;
}

/* PDF HEADER */
.pdf-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; border-bottom: 3px solid var(--accent); padding-bottom: 20px; }
.pdf-logo { font-size: 32px; font-weight: 800; font-family: 'Montserrat'; color: var(--primary); text-transform: uppercase; }
.pdf-logo span { color: var(--accent); }
.pdf-title { font-size: 24px; font-weight: 600; color: #64748b; }

/* PDF INTRO */
.pdf-intro {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.pdf-intro p {
    font-size: 1rem; /* Inherits 14px */
}
/* PDF PROPOSAL SECTIONS - Redesigned to match web cards */
.proposal-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent); /* Default to featured color */
    overflow: hidden;
    margin-bottom: 30px;
}
.proposal-section.traditional {
    border-top-color: var(--primary); /* Traditional color */
}

.proposal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
}
.proposal-header span:first-child { /* The title, e.g., "CROSSBLOCKS #4" */
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}
.proposal-header span:last-child { /* The total price */
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
}
.proposal-section.traditional .proposal-header span:last-child {
    color: var(--primary); /* Match total price color to border */
}

.pdf-table { width: 100%; border-collapse: collapse; }
.pdf-table th { text-align: left; padding: 10px 25px; background: #f8fafc; font-size: 0.8rem; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: var(--text-light); }
.pdf-table th:not(:first-child), .pdf-table td:not(:first-child) { text-align: right; }
.pdf-table td { padding: 10px 25px; border-bottom: 1px solid var(--border); }
.pdf-table td:last-child { text-align: right; font-weight: 700; }
.pdf-table tr:last-child td { border-bottom: none; }

/* PDF FOOTER & SUMMARY */
.pdf-benefits {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
}
.pdf-disclaimer {
    font-size: 10px;
    font-style: italic;
    color: #666;
    margin-top: 30px;
    padding: 0 20px;
    text-align: left;
}
.pdf-benefits h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 15px;
}
.pdf-benefits p { margin-bottom: 15px; }
.pdf-benefits ul {
    list-style: disc;
    padding-left: 20px;
    margin: 15px 0;
}
.pdf-benefits ul li { margin-bottom: 8px; }

.proposal-section, .pdf-benefits, .pdf-disclaimer {
    break-inside: avoid;
}