/* ==========================================================================
   InDiCA — Indian Digital Compendium of Alien & Invasive Flora
   Page-specific stylesheet (loaded on /invasive-compendium/).

   Sections:
     1. Design tokens (CSS custom properties)
     2. Page header & intro
     3. Tabs
     4. About panel
     5. Publications panel
     6. Team panel
     7. Species table (DataTables overrides)
     8. Footer
     9. Responsive overrides
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
.indica {
    --indica-primary: #15803d;
    --indica-primary-dark: #166534;
    --indica-primary-soft: #f0fdf4;
    --indica-accent: #3c763d;
    --indica-surface: #ffffff;
    --indica-surface-alt: #f8fafc;
    --indica-border: #e5e7eb;
    --indica-border-strong: #d1d5db;
    --indica-text: #1f2937;
    --indica-text-muted: #4b5563;
    --indica-text-subtle: #6b7280;
    --indica-radius-sm: 4px;
    --indica-radius-md: 8px;
    --indica-radius-lg: 12px;
    --indica-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --indica-shadow-md: 0 4px 12px rgba(20, 83, 45, 0.06);
    color: var(--indica-text);
    line-height: 1.6;
}

/* ---------- 2. Page header & intro ---------- */
.indica-header {
    border-bottom: 1px solid var(--indica-border);
    padding-bottom: 1.25em;
    margin-bottom: 1.5em;
}
.indica-title {
    font-size: 1.85em;
    line-height: 1.25;
    margin: 0 0 0.35em 0;
    font-weight: 600;
    color: var(--indica-text);
    letter-spacing: -0.01em;
}
.indica-title .indica-initial {
    color: var(--indica-primary);
    font-weight: 700;
}
.indica-subtitle {
    margin: 0;
    color: var(--indica-text-muted);
    font-size: 1.05em;
}

/* ---------- 3. Tabs ---------- */
.indica-tabs {
    margin-top: 1.5em;
}
.indica-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em;
    border-bottom: 2px solid var(--indica-border);
    margin-bottom: 1.5em;
}
.indica-tab-button {
    background: none;
    border: none;
    outline: none;
    padding: 0.7em 1.25em;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: var(--indica-text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    border-radius: var(--indica-radius-sm) var(--indica-radius-sm) 0 0;
}
.indica-tab-button:hover {
    color: var(--indica-primary);
    background: var(--indica-primary-soft);
}
.indica-tab-button:focus-visible {
    outline: 2px solid var(--indica-primary);
    outline-offset: 2px;
}
.indica-tab-button.is-active {
    color: var(--indica-primary-dark);
    border-bottom-color: var(--indica-primary);
    font-weight: 600;
}
.indica-tab-panel {
    display: none;
}
.indica-tab-panel.is-active {
    display: block;
}

/* ---------- 4. About panel ---------- */
.indica-about p {
    margin: 0 0 1em 0;
}
.indica-about ul {
    margin: 0 0 1em 1.25em;
    padding: 0;
}
.indica-about li {
    margin-bottom: 0.35em;
}
.indica-cta {
    display: inline-block;
    margin-top: 0.5em;
    padding: 0.55em 1.1em;
    background: var(--indica-primary);
    color: #fff !important;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: var(--indica-radius-md);
    transition: background 0.15s ease, transform 0.15s ease;
}
.indica-cta:hover {
    background: var(--indica-primary-dark);
    transform: translateY(-1px);
}
.indica-cta::after {
    content: " \2192";
}

/* ---------- 5. Publications panel ---------- */
.indica-publications h3 {
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: var(--indica-primary-dark);
    font-weight: 600;
    border-left: 3px solid var(--indica-primary);
    padding-left: 0.6em;
    font-size: 1.15em;
}
.indica-pub-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.indica-pub-list li {
    padding: 0.85em 0;
    border-bottom: 1px solid var(--indica-border);
    font-size: 0.95em;
    line-height: 1.55;
    color: var(--indica-text);
}
.indica-pub-list li:last-child {
    border-bottom: none;
}
.indica-pub-list a {
    color: var(--indica-primary);
    text-decoration: none;
    word-break: break-word;
}
.indica-pub-list a:hover {
    text-decoration: underline;
}

/* ---------- 6. Team panel ---------- */
.indica-team {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25em;
}
.indica-team-card {
    display: flex;
    align-items: center;
    gap: 1.25em;
    padding: 1.25em;
    background: var(--indica-surface);
    border: 1px solid var(--indica-border);
    border-radius: var(--indica-radius-lg);
    box-shadow: var(--indica-shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.indica-team-card:hover {
    box-shadow: var(--indica-shadow-md);
    transform: translateY(-2px);
}
.indica-team-body {
    flex: 1;
    min-width: 0;
}
.indica-team-name {
    display: block;
    font-weight: 600;
    color: var(--indica-text);
    font-size: 1.05em;
    margin-bottom: 0.2em;
}
.indica-team-role {
    color: var(--indica-text-muted);
    font-size: 0.95em;
    line-height: 1.5;
}
.indica-team-role a {
    color: var(--indica-primary);
    text-decoration: none;
}
.indica-team-role a:hover {
    text-decoration: underline;
}
.indica-team-note {
    font-style: italic;
    color: var(--indica-text-subtle);
}
.indica-team-photo {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--indica-primary-soft);
    flex-shrink: 0;
}
.indica-team-photo--logo {
    object-fit: contain;
    border-radius: var(--indica-radius-md);
    background: #fff;
    padding: 6px;
}

/* ---------- 7. Species table ---------- */
.species-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0.5em;
}
#species-table {
    border-collapse: collapse;
    background: var(--indica-surface);
    width: 100%;
}
#species-table thead {
    background: var(--indica-primary);
    color: #fff;
}
#species-table thead th {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    border-bottom: 1px solid var(--indica-primary-dark);
}
#species-table tbody td {
    padding: 8px 12px;
    font-size: 14px;
    color: var(--indica-text-muted);
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}
#species-table tbody tr:hover {
    background: var(--indica-primary-soft);
}
#species-table td.details-control {
    cursor: pointer;
    text-align: center;
    width: 28px;
    user-select: none;
    color: var(--indica-primary);
    font-weight: 700;
    font-size: 16px;
}
#species-table td.details-control::before {
    content: '+';
}
#species-table tr.shown td.details-control::before {
    content: '\2212';
}
.species-detail {
    padding: 12px 18px;
    background: var(--indica-primary-soft);
    border-left: 3px solid var(--indica-primary);
}
.species-detail dl {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 16px;
}
.species-detail dt {
    font-weight: 600;
    color: var(--indica-primary-dark);
    margin: 0;
}
.species-detail dd {
    margin: 0;
    color: var(--indica-text-muted);
    word-break: break-word;
}

/* DataTables UI overrides */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 13px;
    margin: 0.2em 0.5em 0.2em 0;
    padding: 0;
    display: inline-block;
    vertical-align: middle;
}
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input[type="search"] {
    padding: 4px 8px;
    border: 1px solid var(--indica-border-strong);
    border-radius: var(--indica-radius-sm);
    background: var(--indica-surface-alt);
    font-size: 14px;
}
.dataTables_wrapper .dataTables_filter input[type="search"]:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: 2px solid var(--indica-primary);
    outline-offset: 1px;
}
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
    font-weight: 400;
    margin-bottom: 0;
}
.dataTables_wrapper .dataTables_info {
    color: var(--indica-text-subtle);
    padding-left: 0.2em;
}
.dataTables_wrapper .dataTables_paginate.paging_simple_numbers {
    margin-top: 0.4em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3em;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 1.2em;
    min-width: 2.1em;
    height: 2.1em;
    font-size: 13px;
    padding: 0 0.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    font-weight: 600;
}
.dataTables_wrapper .dataTables_filter {
    float: right;
}

/* ---------- 8. Footer ---------- */
.indica-footer-separator {
    border: none;
    border-top: 1px solid var(--indica-border);
    margin: 2.5em auto 0 auto;
    width: 100%;
    max-width: 900px;
}
.indica-footer {
    font-size: 0.88em;
    padding: 1em 1.25em;
    margin: 0.7em auto 0 auto;
    background: var(--indica-surface-alt);
    border-radius: var(--indica-radius-md) var(--indica-radius-md) 0 0;
    box-shadow: var(--indica-shadow-sm);
    color: var(--indica-text-muted);
    max-width: 900px;
    line-height: 1.55;
}
.indica-footer-section {
    margin-bottom: 0.6em;
}
.indica-footer-section:last-child {
    margin-bottom: 0;
}
.indica-footer-section p {
    margin: 0.25em 0 0 0;
}
.indica-footer strong {
    color: var(--indica-primary-dark);
    font-weight: 600;
    margin-right: 0.3em;
}
.indica-footer a {
    color: var(--indica-primary);
    text-decoration: underline;
}
.indica-footer a:hover {
    color: var(--indica-primary-dark);
}

/* ---------- 9. Responsive overrides ---------- */
@media (max-width: 700px) {
    .indica-title {
        font-size: 1.5em;
    }
    .indica-tab-button {
        padding: 0.6em 0.9em;
        font-size: 0.95em;
    }
    .indica-team-card {
        flex-direction: column;
        text-align: center;
        gap: 0.85em;
    }
    .indica-team-photo {
        width: 96px;
        height: 96px;
    }
    .indica-footer {
        font-size: 0.82em;
        padding: 0.75em 0.85em;
    }
}
/* ---------- 10. InDiCA Tabs and Footer (migrated) ---------- */
.tab-container {
    margin-top: 2em;
}
.tab-bar {
    display: flex;
    border-bottom: 2px solid #3c763d;
    margin-bottom: 1em;
}
.tab-bar button {
    background: none;
    border: none;
    outline: none;
    padding: 0.75em 1.5em;
    cursor: pointer;
    font-size: 1.1em;
    color: #3c763d;
    border-bottom: 3px solid transparent;
    transition: border 0.2s, background 0.2s;
}
.tab-bar button.active {
    border-bottom: 3px solid #3c763d;
    background: #f5f9f5;
    font-weight: bold;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}
.indica-footer-separator {
    border: none;
    border-top: 1.5px solid #e5e7eb;
    margin: 2.5em auto 0 auto;
    width: 100%;
    max-width: 900px;
}
.indica-footer.compact {
    font-size: 0.85em;
    padding: 0.7em 1em 0.7em 1em;
    margin-top: 0.7em;
    background: #f8fafc;
    border-radius: 0.5em 0.5em 0 0;
    box-shadow: 0 1px 4px rgba(60,118,61,0.03);
    color: #374151;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.indica-footer.compact .indica-footer-section {
    margin-bottom: 0.5em;
}
.indica-footer.compact .indica-footer-section:last-child {
    margin-bottom: 0;
}
.indica-footer.compact strong {
    color: #166534;
    font-weight: 600;
    margin-right: 0.3em;
}
.indica-footer.compact em {
    color: #15803d;
    font-style: normal;
}
.indica-footer.compact a {
    color: #15803d;
    text-decoration: underline;
}
.indica-footer.compact a:hover {
    color: #166534;
}
@media (max-width: 700px) {
    .indica-footer.compact {
        font-size: 0.8em;
        padding: 0.5em 0.3em;
    }
}
@media (max-width: 640px) {
    #species-table thead th,
    #species-table tbody td {
        padding: 6px 8px;
        font-size: 13px;
    }
    .species-detail {
        padding: 10px 12px;
    }
    .species-detail dl {
        grid-template-columns: 1fr;
        gap: 2px 0;
    }
    .species-detail dt {
        margin-top: 8px;
    }
    .species-detail dt:first-child {
        margin-top: 0;
    }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        display: block;
        width: 100%;
        text-align: left;
        margin-bottom: 0.3em;
    }
    .dataTables_wrapper .dataTables_paginate.paging_simple_numbers {
        justify-content: flex-start;
    }
}
