/* ================================================================
   Cornell IPM EIQ - App Styles
   Complements cornell_ipm_core/css/core.css
   Uses core fonts (Work Sans headings, Lora body) and color system
   ================================================================ */

/* ---- Hero Section ---- */
.eiq-hero {
    background-color: #f5f9f8;
    border-bottom: 1px solid #d4dbd9;
    padding: 4rem 0;
    text-align: center;
}
.eiq-hero-inner {
    max-width: 720px;
    margin: 0 auto;
}
.eiq-hero-title {
    font-family: 'Work Sans', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: #1a3c34;
    margin-bottom: 1.25rem;
}
.eiq-hero-lead {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.7;
    margin-bottom: 1rem;
}
.eiq-hero-text {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 2rem;
}
.eiq-hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Large button variant (core may not have this) */
.ipm-btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.05rem;
}

/* ---- Feature Cards ---- */
.eiq-features {
    padding: 3.5rem 0;
}
.eiq-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
@media (max-width: 768px) {
    .eiq-features-grid {
        grid-template-columns: 1fr;
    }
}
.eiq-feature-card {
    background: #fff;
    border: 1px solid #e8eded;
    border-radius: 8px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: box-shadow 0.2s;
}
.eiq-feature-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.eiq-feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e8f0ef;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #1a5555;
}
.eiq-feature-title {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #1a3c34;
    margin-bottom: 0.5rem;
}
.eiq-feature-text {
    font-size: 0.9rem;
    color: #5a6b68;
    line-height: 1.5;
    margin: 0;
}

/* ---- Reference Bar ---- */
.eiq-reference-bar {
    background: #f1f3f2;
    padding: 2rem 0;
    border-top: 1px solid #d4dbd9;
}
.eiq-reference-heading {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a3c34;
    margin-bottom: 0.5rem;
}
.eiq-reference-text {
    font-size: 0.85rem;
    color: #5a6b68;
    margin: 0;
}
.eiq-reference-text a {
    color: #1a5555;
}

/* ---- Card styling for inner pages ---- */
.eiq-card {
    background: #fff;
    border: 1px solid #e8eded;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.eiq-card h1,
.eiq-card h2 {
    font-family: 'Work Sans', sans-serif;
    color: #1a3c34;
}
.eiq-card h1 { font-size: 1.5rem; font-weight: 700; }
.eiq-card h2 { font-size: 1.15rem; font-weight: 600; }
.eiq-card h3 { font-size: 0.95rem; font-weight: 600; color: #333; }

/* ---- Forms ---- */
.eiq-form .form-label {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}
.eiq-form .form-control,
.eiq-form .form-select {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}
.eiq-form .form-control:focus,
.eiq-form .form-select:focus {
    border-color: #1a5555;
    box-shadow: 0 0 0 2px rgba(26, 85, 85, 0.15);
}

/* ---- Admin data table ---- */
.eiq-data-table {
    width: 100%;
    font-size: 0.9rem;
    border-collapse: collapse;
}
.eiq-data-table th {
    background: #f5f7f6;
    color: #1a3c34;
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid #d4dbd9;
    cursor: pointer;
    user-select: none;
}
.eiq-data-table th:hover {
    background: #eaf0ee;
}
.eiq-data-table th.sortable::after {
    content: " \2195";
    opacity: 0.3;
}
.eiq-data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e8eded;
    vertical-align: middle;
}
.eiq-data-table tr:hover td {
    background: #f9fbfb;
}

/* Inline edit inputs */
.eiq-data-table tr.editing input {
    padding: 0.15rem 0.4rem;
    font-size: 0.85rem;
    border: 1px solid #1a5555;
    border-radius: 4px;
    width: 100%;
}

/* ---- Admin dashboard stat cards ---- */
.eiq-stat-card {
    background: #fff;
    border: 1px solid #e8eded;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}
.eiq-stat-value {
    font-family: 'Work Sans', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: #1a5555;
}
.eiq-stat-label {
    font-size: 0.85rem;
    color: #5a6b68;
    margin: 0;
}

/* ---- Badges ---- */
.eiq-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.eiq-badge-published {
    background: #1a5555;
    color: #fff;
}
.eiq-badge-archived {
    background: #6c757d;
    color: #fff;
}

/* ---- Results page ---- */
.eiq-result-highlight {
    background: #e8f0ef;
    border-left: 4px solid #1a5555;
    padding: 1rem 1.25rem;
    border-radius: 0 6px 6px 0;
    margin: 1rem 0;
}
.eiq-result-highlight strong {
    font-size: 1.2rem;
    color: #1a3c34;
}

/* ---- Disclaimer ---- */
.eiq-disclaimer {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 0.75rem 1rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    color: #5a6b68;
}

/* ---- Utility ---- */
.text-eiq-muted { color: #5a6b68; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .eiq-hero {
        padding: 2.5rem 0;
    }
    .eiq-hero-title {
        font-size: 1.75rem;
    }
}

/* ================================================================
   Calculator Page Layout
   ================================================================ */

/* Page header bar */
.eiq-page-header {
    background: #f5f9f8;
    border-bottom: 1px solid #d4dbd9;
    padding: 2rem 0;
    margin: -1rem -1rem 2rem -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}
.eiq-page-title {
    font-family: 'Work Sans', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: #1a3c34;
    margin: 0 0 0.25rem 0;
}
.eiq-page-subtitle {
    font-size: 0.9rem;
    color: #5a6b68;
    margin: 0;
}

/* Two-column layout */
.eiq-calc-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 900px) {
    .eiq-calc-layout {
        grid-template-columns: 1fr;
    }
}

/* Main form card */
.eiq-calc-main {
    background: #fff;
    border: 1px solid #e8eded;
    border-radius: 8px;
    padding: 2rem;
}

/* Field groups */
.eiq-field-group {
    margin-bottom: 1.5rem;
}
.eiq-label {
    display: block;
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a3c34;
    margin-bottom: 0.25rem;
}
.eiq-hint {
    font-size: 0.8rem;
    color: #7a8a87;
    margin: 0 0 0.5rem 0;
}
.eiq-error {
    font-size: 0.8rem;
    color: #dc3545;
    margin: 0.25rem 0 0 0;
}

/* Make Django form-control inputs look polished */
.eiq-calc-main .form-control {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    color: #333;
    background: #fff;
    border: 1px solid #ccd5d3;
    border-radius: 6px;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.eiq-calc-main .form-control:focus {
    border-color: #1a5555;
    box-shadow: 0 0 0 3px rgba(26, 85, 85, 0.12);
    outline: none;
}
.eiq-calc-main select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6b68' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

/* Two-up field rows */
.eiq-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
@media (max-width: 600px) {
    .eiq-field-row {
        grid-template-columns: 1fr;
    }
}

/* Submit button */
.eiq-calc-submit {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ---- Sidebar ---- */
.eiq-calc-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.eiq-sidebar-card {
    background: #fff;
    border: 1px solid #e8eded;
    border-radius: 8px;
    padding: 1.25rem;
}
.eiq-sidebar-card-ref {
    background: #f5f7f6;
    border-color: #d4dbd9;
}
.eiq-sidebar-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8f0ef;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: #1a5555;
}
.eiq-sidebar-title {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a3c34;
    margin: 0 0 0.4rem 0;
}
.eiq-sidebar-text {
    font-size: 0.82rem;
    color: #5a6b68;
    line-height: 1.5;
    margin: 0;
}
.eiq-sidebar-text a {
    color: #1a5555;
}

/* ================================================================
   Results Page
   ================================================================ */

/* Generic card (if not already in app.css) */
.eiq-card {
    background: #fff;
    border: 1px solid #e8eded;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Action bar */
.eiq-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.eiq-actions-right {
    display: flex;
    gap: 0.5rem;
}
.eiq-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    padding: 0.4rem 0.85rem;
}
.eiq-action-btn.eiq-saved {
    background: #e8f0ef;
    border-color: #1a5555;
    color: #1a5555;
}

/* Result hero - big number */
.eiq-result-hero {
    background: linear-gradient(135deg, #1a3c34 0%, #1a5555 100%);
    color: #fff;
    border-radius: 10px;
    padding: 2.5rem 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.eiq-result-hero-value {
    font-family: 'Work Sans', sans-serif;
    font-weight: 700;
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.eiq-result-hero-label {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.eiq-result-hero-detail {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Component breakdown cards */
.eiq-components-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 600px) {
    .eiq-components-grid {
        grid-template-columns: 1fr;
    }
}
.eiq-component-card {
    background: #fff;
    border: 1px solid #e8eded;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    border-top: 3px solid #ccc;
}
.eiq-component-worker { border-top-color: #2e7d6e; }
.eiq-component-consumer { border-top-color: #3a8fb7; }
.eiq-component-eco { border-top-color: #6b8e5e; }

.eiq-component-value {
    font-family: 'Work Sans', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: #1a3c34;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.eiq-component-label {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 0.1rem;
}
.eiq-component-unit {
    font-size: 0.75rem;
    color: #7a8a87;
}

/* Section titles inside cards */
.eiq-section-title {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #1a3c34;
    margin: 0 0 0.75rem 0;
}

/* Detail table */
.eiq-detail-table {
    width: 100%;
    font-size: 0.9rem;
    border-collapse: collapse;
}
.eiq-detail-table td {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f2f1;
    vertical-align: top;
}
.eiq-detail-label {
    font-weight: 500;
    color: #5a6b68;
    width: 180px;
}
.eiq-detail-note {
    font-size: 0.82rem;
    color: #7a8a87;
    margin-top: 0.75rem;
    margin-bottom: 0;
}
.eiq-detail-note a {
    color: #1a5555;
}

/* Citation box */
.eiq-cite-box {
    background: #f5f7f6;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #333;
}
.eiq-cite-box a {
    color: #1a5555;
}

/* Collapsible details */
.eiq-details-toggle {
    background: #fff;
    border: 1px solid #e8eded;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.eiq-details-toggle summary {
    padding: 0.75rem 1.25rem;
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a5555;
    cursor: pointer;
    list-style: none;
}
.eiq-details-toggle summary::-webkit-details-marker {
    display: none;
}
.eiq-details-toggle summary::before {
    content: "+ ";
    font-weight: 700;
}
.eiq-details-toggle[open] summary::before {
    content: "- ";
}
.eiq-details-toggle p {
    padding: 0 1.25rem 1rem;
    font-size: 0.82rem;
    color: #5a6b68;
    margin: 0;
    line-height: 1.6;
}
