/* ===========================================
    Period Calculator - Tool Specific Styles
    =========================================== */

/* Box Styling */
.pc-box {
    max-width: 700px;
    margin: 0 auto;
    padding: 0; 
}

/* Form Container */
.pc-form {
    padding: 20px; 
    border: 1px solid #B0BEC5; /* Blue-Grey Border */
    border-radius: 8px;
    background-color: #FAFAFA; /* Light Grey Background */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.pc-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #455A64; /* Dark Blue-Grey */
    border-bottom: 2px solid #B0BEC5;
    padding-bottom: 5px; 
    margin-top: 5px; 
    margin-bottom: 20px; 
}

/* Compact Input Grid */
.pc-compact-grid {
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    gap: 15px 2%; /* Vertical and horizontal gap */
}

.pc-input-group {
    display: flex;
    flex-direction: column;
    flex-basis: 48%; /* Allows two inputs per row */
    min-width: 140px;
}

/* Responsive adjustment for very small screens */
@media (max-width: 450px) {
    .pc-input-group {
        flex-basis: 100%; /* Stack inputs on very small screens */
    }
}

.pc-input-group label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem; 
    margin-bottom: 4px;
}

.pc-input-group input, .pc-input-group select {
    padding: 10px;
    border: 1px solid #CED4DA;
    border-radius: 6px;
    font-size: 1rem;
    text-align: right;
    max-width: 100%;
}
.pc-input-group input[type="date"] {
    cursor: pointer;
}


/* Button Styles */
.pc-calculate-btn {
    display: block;
    width: 100%;
    padding: 14px; 
    margin-top: 25px; 
    background-color: #455A64; /* Primary Dark Blue-Grey */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}
.pc-calculate-btn:hover {
    background-color: #37474F;
}

/* Results Display */
.pc-results {
    margin-top: 20px; 
    padding: 20px;
    border: 2px solid #78909C; 
    border-radius: 8px;
    background-color: #ECEFF1; /* Lightest Blue-Grey */
    text-align: center;
}

.pc-results-title {
    color: #455A64;
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #B0BEC5;
    padding-bottom: 5px;
}

/* Compact Results Grid (Using Flex for Side-by-Side) */
.pc-data-grid {
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    gap: 15px 2%; 
    margin-bottom: 10px; 
}
.pc-data-segment {
    flex-basis: 49%; 
    background: #ffffff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    border: 1px solid #CFD8DC;
}

.pc-data-segment .pc-data-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6C7A89;
    text-transform: uppercase;
}
.pc-data-segment .pc-data-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #4CAF50; /* Green for key result */
    margin-top: 5px;
}

.pc-data-segment .pc-data-subtext {
    font-size: 0.85rem;
    color: #455A64;
    margin-top: 5px;
}
.pc-data-segment.full-width {
    flex-basis: 100%;
    margin-top: 10px;
}


.pc-recalculate-btn {
    padding: 8px 15px;
    margin-top: 20px;
    background-color: #78909C;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .pc-data-segment {
        flex-basis: 100%; 
    }
}


/* ===========================================
    SEO Content FIXES (Critical Formatting Overrides)
    =========================================== */

/* Target the h4s within the SEO content to ensure they have vertical clearance */
.seo-content h4 {
    margin-top: 25px !important;
    margin-bottom: 10px !important;
}

/* Ensure MathJax Display blocks are treated as full-width elements */
.seo-content .MathJax_Display, .seo-content [role="presentation"] {
    display: block !important;
    margin-top: 15px !important;
    margin-bottom: 15px !important;
    width: 100% !important;
}

/* Ensure paragraphs surrounding the h4 headings have proper spacing */
.seo-content p {
    margin-bottom: 10px;
}

/* Table styling for SEO content */
.seo-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.seo-content th, .seo-content td {
    border: 1px solid #CFD8DC;
    padding: 10px;
    text-align: center;
    font-size: 0.95rem;
}
.seo-content th {
    background-color: #ECEFF1;
    font-weight: 600;
    color: #455A64;
}