/* Number Leader Color Theme */
:root {
    --primary: #1a3b5d;
    --secondary: #2c5282;
    --accent: #4a6fa5;
    --text: #333333;
    --background: #f5f7fa;
    --subtle: #e2e8f0;
}

/* General Styling */
body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    padding: 20px;
    margin: 0;
    line-height: 1.6;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 40px auto;
    background-color: #ffffff;
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

/* Headers */
h1, h2, h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
}

h1 {
    font-size: 38px;
    margin-bottom: 35px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 20px;
    letter-spacing: 0.5px;
}

h2 {
    font-size: 26px;
    margin-top: 30px;
    letter-spacing: 0.3px;
}

h3 {
    font-size: 20px;
    margin-top: 25px;
    color: var(--secondary);
    letter-spacing: 0.2px;
}

/* Tagline */
.tagline {
    text-align: center;
    color: var(--secondary);
    margin-top: -20px;
    margin-bottom: 50px;
    font-size: 19px;
    font-style: italic;
    letter-spacing: 0.2px;
}

/* Form Section */
.form-section {
    background-color: #ffffff;
    padding: 60px 70px;
    border-radius: 14px;
    margin-bottom: 50px;
    border: 1px solid var(--subtle);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* Input Groups */
.input-group {
    margin-bottom: 40px;
}

.input-group label {
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
    color: var(--primary);
    font-size: 17px;
    letter-spacing: 0.2px;
}

/* Input Fields */
input[type="text"], textarea {
    width: 100%;
    padding: 18px;
    border: 1px solid #d1d9e6;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #ffffff;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) inset;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

/* Valuation Inputs */
.valuation-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 40px;
    margin-top: 40px;
    margin-bottom: 40px;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

/* Paragraphs and Lists */
p, ul, ol {
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: justify;
}

/* Report Content Styling */
#report-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    max-width: 800px;
    margin: 20px auto;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
}

/* Report Page Styling */
.report-page {
    position: relative;
    padding: 20px;
    margin-bottom: 30px;
    min-height: 900px; /* Ensure consistent page height */
}

/* First Page Specific Styling */
.page-1 {
    text-align: center;
}

.report-header-centered {
    margin-top: 60px;
    margin-bottom: 80px;
}

.report-header-centered h1 {
    font-size: 36px;
    border: none;
    font-weight: 700;
    color: var(--primary);
}

.report-subheader {
    margin-bottom: 80px;
}

.report-subheader p {
    text-align: center;
    margin: 5px 0;
    font-size: 16px;
}

.about-section, .company-section, .service-section {
    text-align: left;
    margin-bottom: 40px;
}

.about-section h2, .company-section h2, .service-section h2 {
    text-align: left;
    font-size: 20px;
    border-bottom: 1px solid var(--subtle);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.about-section p, .company-section p, .service-section p {
    margin-top: 15px;
    line-height: 1.7;
}

/* Second Page Specific Styling */
.page-2 h1 {
    margin-top: 30px;
    margin-bottom: 30px;
    font-size: 24px;
}

.methods-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.valuation-method {
    background-color: #f8f9fa;
    padding: 18px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.valuation-method h2 {
    text-align: left;
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
    border-bottom: 1px solid var(--subtle);
    padding-bottom: 8px;
}

.method-description {
    margin-bottom: 12px;
}

.method-description p {
    margin: 8px 0;
    line-height: 1.5;
    font-size: 14px;
}

.method-value {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
    padding: 3px 0;
    font-size: 14px;
}

.recommendation {
    margin-top: 10px;
    font-weight: 500;
    color: var(--secondary);
    padding: 8px 0;
    border-top: 1px dashed var(--subtle);
    font-size: 14px;
}

/* Third Page Specific Styling */
.page-3 {
    padding-top: 30px;
}

.page-3 h1 {
    margin-top: 30px;
    margin-bottom: 30px;
    font-size: 24px;
}

/* For the standalone method on page 3 */
.page-3 .valuation-method {
    padding: 25px;
    margin: 30px 0;
    background-color: #f9f9f9;
    border-left: 5px solid var(--accent);
}

.page-3 .method-description p {
    line-height: 1.6;
    font-size: 15px;
    margin-bottom: 15px;
}

.page-3 .valuation-method h2 {
    font-size: 20px;
    margin-bottom: 15px;
}

.page-3 .method-value {
    font-size: 15px;
    margin: 15px 0;
}

.page-3 .recommendation {
    font-size: 15px;
    margin-top: 15px;
}

/* Fourth Page Specific Styling */
.page-4 {
    padding-top: 30px;
}

.page-4 h1 {
    margin-top: 40px;
    margin-bottom: 40px;
}

/* Ensure conclusion doesn't get cut off */
.conclusion-section {
    margin-bottom: 60px;
    padding-bottom: 30px;
}

.conclusion-section h1 {
    margin-bottom: 30px;
}

.conclusion-section p {
    margin-bottom: 25px;
    line-height: 1.8;
}

.conclusion-section strong {
    display: block;
    margin: 20px 0 15px;
    color: var(--secondary);
}

.conclusion-section ul {
    padding-left: 30px;
    margin-bottom: 30px;
}

.conclusion-section li {
    margin-bottom: 15px;
    line-height: 1.7;
    padding-left: 5px;
}

/* Fix footer spacing */
.footer-section {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px solid var(--subtle);
}

.footer-section h2 {
    text-align: left;
    font-size: 18px;
    margin-top: 25px;
    margin-bottom: 15px;
    color: var(--secondary);
}

.footer-section p {
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

hr {
    border: 0;
    border-top: 1px solid var(--subtle);
    margin: 40px 0;
}

/* Page Breaks for PDF */
.page-break {
    page-break-after: always;
    height: 0;
    margin: 0;
    padding: 0;
}

/* PDF Page Container */
.pdf-page-container {
    position: absolute;
    left: -9999px;
    width: 816px; /* A4 width */
    min-height: 1056px; /* A4 height */
    background: white;
    padding: 0;
    overflow: hidden;
}

/* Buttons */
button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 20px 38px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 50px;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 12px rgba(26, 59, 93, 0.2);
    text-transform: uppercase;
}

button:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 20px;
        padding: 30px;
        border-radius: 12px;
    }
    
    .form-section {
        padding: 40px 30px;
        border-radius: 10px;
    }
    
    .input-group {
        margin-bottom: 30px;
    }
    
    .valuation-inputs {
        padding: 25px;
        gap: 25px;
        border-radius: 10px;
    }
    
    h1 {
        font-size: 30px;
        padding-bottom: 15px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    .tagline {
        font-size: 16px;
        margin-bottom: 40px;
    }
    
    button {
        padding: 16px 32px;
        margin-top: 35px;
        font-size: 16px;
    }
    
    input[type="text"], textarea, textarea#companyDescription {
        padding: 14px !important;
        font-size: 15px;
    }
}

/* PDF Specific styling to avoid cut-offs */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    #report-content {
        box-shadow: none;
        padding: 0;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .report-page {
        page-break-after: always;
    }
    
    .valuation-method, .conclusion-section, .footer-section {
        page-break-inside: avoid;
    }
}

/* Company Description Section in Form */
.input-group textarea#companyDescription {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    padding: 16px !important;
    margin: 0 !important;
    border: 1px solid #d1d9e6;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical; /* Only allow vertical resizing */
    transition: all 0.3s ease;
    background-color: #ffffff;
    margin-bottom: 20px;
    max-width: 100%; /* Prevent horizontal expansion */
    overflow-x: hidden; /* Hide horizontal overflow */
    box-sizing: border-box; /* Include padding in width calculation */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) inset;
}

/* Override any other padding that might affect the textarea */
textarea#companyDescription {
    padding: 16px !important;
    margin: 0 !important;
    resize: vertical; /* Only allow vertical resizing */
    max-width: 100%; /* Prevent horizontal expansion */
    overflow-x: hidden; /* Hide horizontal overflow */
    box-sizing: border-box; /* Include padding in width calculation */
    width: 100%; /* Match container width */
}

.input-group textarea#companyDescription:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

/* Company Section in Report */
.company-section {
    text-align: left;
    margin: 20px 0;
    background-color: transparent;
    padding: 0 !important;
    border-left: none;
    border-radius: 0;
    box-shadow: none;
}

.company-section h2 {
    text-align: left;
    font-size: 20px;
    border-bottom: 1px solid var(--subtle);
    padding: 0 !important;
    margin-bottom: 20px;
    color: var(--primary);
}

.company-section p {
    margin: 15px 0;
    padding: 0 !important;
    line-height: 1.6;
    font-size: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* PDF Specific Styles */
@media print {
    .company-section {
        padding: 0 !important;
        margin: 15mm 15mm;
        box-shadow: none;
        border: none;
        background: transparent;
        page-break-inside: avoid;
    }
    
    .company-section h2 {
        padding: 0 !important;
    }
    
    .company-section p {
        padding: 0 !important;
        font-size: 11pt;
        line-height: 1.5;
    }
}
