/* Homepage Redesign Styles (PRD v2.0) */

:root {
    --hero-bg: #f8fafc;
    --hero-text: #1e293b;
    --primary-color: #10b981;
    --primary-dark: #059669;
    --accent-color: #3b82f6;
    --text-color: #374151;
    --light-gray: #f3f4f6;
    --border-color: #e5e7eb;
}

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
    padding: 30px 0;
    /* Reduced from 60px */
    border-bottom: 1px solid var(--border-color);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    /* Reduced from 4rem */
    align-items: center;
}

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

.hero-content h1 {
    font-size: 2.2rem;
    /* Reduced from 3rem */
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #111827;
}

.hero-content .lead {
    font-size: 1.1rem;
    /* Reduced from 1.25rem */
    color: #4b5563;
    margin-bottom: 1.5rem;
}

.hero-trust-badges {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

@media (max-width: 992px) {
    .hero-trust-badges {
        justify-content: center;
    }
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trust-item i {
    color: var(--primary-color);
}

/* --- Embedded Calculator Card --- */
.hero-calculator-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.calc-header {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.calc-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Helper styles for presets */
/* Preset Buttons */
.preset-btn {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #4338ca;
    padding: 0.4rem 0.8rem;
    /* Slightly smaller for mobile fit */
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 0 1 auto;
    /* Allow shrinking/growing */
    white-space: nowrap;
}

.preset-btn:hover {
    background: #e0e7ff;
    transform: translateY(-1px);
}

.preset-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calc-body {
    padding: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.input-row {
    display: flex;
    gap: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.btn-calc {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-calc:hover {
    background: var(--primary-dark);
}

/* --- Visual Panel Toggle --- */
.visual-panel {
    background: #eff6ff;
    padding: 1.5rem;
    margin-top: 1rem;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    display: none;
    /* Hidden by default */
}

.visual-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.visual-toggle-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: auto;
}

.visual-toggle-btn:hover {
    text-decoration: underline;
}

/* --- Info Sections --- */
.info-section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 1rem;
}

.section-title p {
    color: #6b7280;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Comparison Cards --- */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.compare-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.compare-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.compare-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.compare-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.compare-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compare-list li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.compare-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* --- FAQ Accordion --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.25rem;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    background: #f9fafb;
}

.faq-answer {
    padding: 0 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
    background: #f9fafb;
    color: #4b5563;
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    padding: 1.25rem;
    max-height: 500px;
    /* Adjust if needed */
    border-top: 1px solid var(--border-color);
}

.faq-icon {
    transition: transform 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* --- SOIL COMPARISON TABLE STYLES (New) --- */
.soil-comparison {
    margin: 3rem 0;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 10px;
}

.soil-comparison .section-subtitle {
    color: #555;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.table-container {
    overflow-x: auto;
    /* Enables horizontal scroll on small screens */
    margin: 1.5rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 700px;
    /* Ensures table doesn't get too cramped */
}

.comparison-table thead {
    background-color: var(--primary-color);
    color: white;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
    vertical-align: top;
}

.comparison-table tbody tr:hover {
    background-color: #f1f8f0;
    /* Very light green hover effect */
}

.comparison-table th[scope="row"] {
    background-color: #f5f5f5;
    border-right: 2px solid #ddd;
}

.soil-type-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.soil-icon {
    font-size: 1.5rem;
}

.table-footer-note {
    font-size: 0.9rem;
    text-align: center;
    color: #777;
    margin-top: 1rem;
    font-style: italic;
}

/* Quick Decision Helper Styles */
.decision-helper {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background-color: #e8f4e8;
    border-left: 5px solid var(--primary-color);
    border-radius: 5px;
}

.decision-helper h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.decision-helper ul {
    padding-left: 1.5rem;
}

.decision-helper li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .soil-comparison {
        padding: 1rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.95rem;
    }
}

/* ========================================
   ACCESSIBILITY & UI FEEDBACK IMPROVEMENTS
   ======================================== */

/* Skip to Main Content Link (Screen Readers) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* Focus States for Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Remove default focus for mouse users, keep for keyboard */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Calculator Input Feedback */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.2);
}

.form-control:invalid:not(:placeholder-shown) {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* Button Loading State Enhancement */
.btn-calc:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-calc:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.3);
}

/* Result Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#calc-results .alert {
    animation: fadeInUp 0.4s ease-out;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #1a3d16;
        --text-light: #374151;
    }

    .preset-btn {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}