/* Software Landing Page Styles */

.software-landing-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Section */
.software-header {
    background: linear-gradient(to right, #fcfcfd, #ececec);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(10, 10, 10, 0.15);
}

.software-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.software-title-section {
    flex: 1;
}

.software-name {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin: 0 0 10px 0;
}

.software-version {
    font-size: 1rem;
    color: #666;
    background-color: #e8e8e8;
    padding: 4px 12px;
    border-radius: 4px;
}

.software-logo-container {
    margin-left: 20px;
}

.software-logo {
    max-width: 180px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}

/* Action Buttons */
.software-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.action-btn i {
    margin-right: 6px;
}

.action-btn.btn-code {
    background-color: #559e41;
    color: white;
    border: 1px solid #559e41;
}

.action-btn.btn-code:hover {
    background-color: #478a36;
    color: white;
}

.action-btn.btn-docs {
    background-color: #5070e5;
    color: white;
    border: 1px solid #5070e5;
}

.action-btn.btn-docs:hover {
    background-color: #4060d5;
    color: white;
}

.action-btn.btn-publication {
    background-color: #8e44ad;
    color: white;
    border: 1px solid #8e44ad;
}

.action-btn.btn-publication:hover {
    background-color: #7d3c98;
    color: white;
}

.action-btn.btn-doi {
    background-color: #f47f1c;
    color: white;
    border: 1px solid #f47f1c;
}

.action-btn.btn-doi:hover {
    background-color: #e06f0c;
    color: white;
}

.action-btn.btn-cite {
    background-color: #535a7a;
    color: white;
    border: 1px solid #535a7a;
    cursor: pointer;
}

.action-btn.btn-cite:hover,
.action-btn.btn-cite-active {
    background-color: #414660;
    border-color: #414660;
    color: white;
}

/* Content Sections */
.software-content {
    margin-bottom: 30px;
}

.software-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    --section-anim-duration: 220ms;
    --section-anim-ease: cubic-bezier(0.2, 0, 0, 1);
    --section-summary-gap: 20px;
    --section-summary-padding: 10px;
    --section-summary-border: #14679e;
}

.section-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #14679e;
    margin: 0 0 var(--section-summary-gap) 0;
    padding-bottom: var(--section-summary-padding);
    border-bottom: 2px solid var(--section-summary-border);
    transition: margin-bottom 160ms ease, padding-bottom 160ms ease, border-color 160ms ease;
}

/* Collapsible section controls */
details.software-section summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 28px;
}
details.software-section summary::-webkit-details-marker {
    display: none;
}

/* Chevron: ▼ when open, ▶ when closed */
details.software-section summary::after {
    content: "▼";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #14679e;
}
details.software-section:not([open]) summary::after {
    content: "▶";
}

/* Collapsed: remove dangling border/spacing */
details.software-section.is-collapsing,
details.software-section:not([open]) {
    --section-summary-gap: 0px;
    --section-summary-padding: 0px;
    --section-summary-border: transparent;
    --section-anim-duration: 180ms;
    --section-anim-ease: cubic-bezier(0.4, 0, 1, 1);
}

/* Hover hint */
details.software-section summary:hover {
    color: #105a8a;
}

/* Animated open/close — wrapper created by the script below */
.section-body {
    overflow: hidden;
    transition: max-height var(--section-anim-duration) var(--section-anim-ease);
    will-change: max-height;
}

.description-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #4d4d4d;
}

.description-content p {
    margin-bottom: 1em;
}

/* Authors List */
.authors-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.author-item {
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.author-name {
    font-weight: 500;
    color: #333;
}

.author-name a {
    color: #1779ba;
    text-decoration: none;
}

.author-name a:hover {
    text-decoration: underline;
}

.author-affiliation {
    font-size: 0.9rem;
    color: #666;
    margin-left: 8px;
}

.author-affiliation a {
    color: #1779ba;
    text-decoration: none;
}

.author-affiliation a:hover {
    text-decoration: underline;
}

/* Metadata Grid */
.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.metadata-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metadata-item.full-width {
    grid-column: 1 / -1;
}

.metadata-label {
    font-weight: 600;
    color: #555;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metadata-value {
    color: #333;
}

.metadata-value a {
    color: #1779ba;
    text-decoration: none;
}

.metadata-value a:hover {
    text-decoration: underline;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin: 2px;
    background-color: #e8e8e8;
    color: #333;
    text-decoration: none;
}

a.tag {
    cursor: pointer;
}

a.tag:hover {
    text-decoration: underline;
}

.functionality-tag {
    font-weight: 500;
}

.keyword-tag {
    background-color: #d4edda;
    color: #155724;
}

.status-tag {
    background-color: #cce5ff;
    color: #004085;
}

/* Functionality Tags */
.functionality-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Keywords */
.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Publications & Related Items */
.related-items-subsection {
    margin-bottom: 20px;
}

.related-items-subsection:last-child {
    margin-bottom: 0;
}

.related-items-subsection h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    margin: 0 0 10px 0;
}

.publication-item,
.related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 8px;
}

.publication-item:last-child,
.related-item:last-child {
    margin-bottom: 0;
}

.publication-title {
    flex: 1;
    color: #333;
}

.publication-title-link,
.related-item-link {
    flex: 1;
    color: #1779ba;
    text-decoration: none;
}

.publication-title-link:hover,
.related-item-link:hover {
    text-decoration: underline;
}

.related-item span {
    flex: 1;
}

.related-item a {
    color: #1779ba;
}

/* Awards */
.awards-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.award-item {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.award-name {
    font-weight: 500;
}

.award-id {
    color: #666;
    font-size: 0.9rem;
}

.award-funder {
    color: #555;
    font-style: italic;
}

/* Release Notes */
.release-notes {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    line-height: 1.6;
}

/* Back Link */
.back-link {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.back-link a {
    color: #1779ba;
    text-decoration: none;
    font-size: 1rem;
}

.back-link a:hover {
    text-decoration: underline;
}

.back-link a i {
    margin-right: 8px;
}

/* Citation Section */
.citation-section {
    margin-bottom: 20px;
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-bottom 0.4s ease, padding 0.4s ease;
}

.citation-section.citation-hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
}

.citation-notice {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin: 0 0 16px 0;
    padding-left: 2px;
}

.citation-subheader {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    margin: 0 0 8px 0;
}

.citation-text {
    line-height: 1.8;
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.citation-text a {
    color: #1779ba;
    text-decoration: none;
}

.citation-text a:hover {
    text-decoration: underline;
}

.citation-controls {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.citation-controls label {
    font-size: 0.95rem;
    color: #333;
}

.citation-controls select {
    padding: 7px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #333;
    background: white;
    cursor: pointer;
    max-width: 200px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.citation-controls select:hover,
.citation-controls select:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 1px #4a90d9;
}

.citation-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    color: #555;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.citation-controls .citation-copy-btn:first-of-type {
    margin-left: auto;
}

.citation-controls .citation-copy-btn + .citation-copy-btn {
    margin-left: 4px;
}

.citation-copy-btn:hover {
    background-color: #f0f0f0;
    border-color: #999;
    color: #333;
}

.citation-copy-btn:active {
    background-color: #ddd;
    border-color: #666;
    color: #111;
}

/* Skeleton loading animation */
.citation-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-line {
    height: 14px;
    background: #e0e0e0;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.skeleton-line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .software-header-content {
        flex-direction: column;
    }

    .software-logo-container {
        margin-left: 0;
        margin-top: 20px;
    }

    .software-name {
        font-size: 1.6rem;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .software-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .software-landing-page {
        padding: 10px;
    }

    .software-section {
        padding: 15px;
    }

    .citation-controls {
        flex-wrap: wrap;
    }

}
