/* NGI Navigator - Detail Page Styles (Project & Product) */

/* =====================================================
   Detail Header
   ===================================================== */
.detail-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    transition: color 0.15s;
}

.back-link:hover {
    color: var(--primary);
}

.detail-title-row {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.detail-logo {
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
    object-fit: contain;
    background: var(--bg-alt);
    padding: 0.5rem;
}

.detail-title-content {
    margin-bottom: 1rem;
    flex: 1;
}

.detail-title-with-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.detail-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn:hover {
    background: var(--bg-alt);
    border-color: var(--primary);
}

.btn-icon {
    font-size: 1rem;
}

.btn-use-this:hover {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.btn-suggest {
    color: var(--text-muted);
}

.btn-suggest:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
}

.detail-title-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-tags a {
    text-decoration: none;
}

.detail-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 800px;
}

/* =====================================================
   Badges
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    text-decoration: none;
    transition: all 0.15s ease;
}

.badge-small {
    padding: 0.1875rem 0.4375rem;
    font-size: 0.625rem;
}

/* Clickable badge hover effects */
a.badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    filter: brightness(0.95);
}

.badge-type { background: #ede9fe; color: #6d28d9; }
.badge-status { background: #e0f2fe; color: #0369a1; }
.badge-active { background: #d1fae5; color: #047857; }
.badge-maintained { background: #fef3c7; color: #b45309; }
.badge-inactive { background: #fee2e2; color: #b91c1c; }
.badge-abandoned { background: #f3f4f6; color: #6b7280; }
.badge-oss { background: #dbeafe; color: #1d4ed8; }
.badge-proprietary { background: #fce7f3; color: #be185d; }
.badge-license { background: #e0e7ff; color: #4338ca; }
.badge-category { background: #dcfce7; color: #15803d; }
.badge-country { background: #fef3c7; color: #b45309; }

/* =====================================================
   Quick Links
   ===================================================== */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s;
}

.quick-link:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-link-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.quick-link-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.quick-link-label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
}

.quick-link-url {
    color: var(--text-muted);
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =====================================================
   Details Grid
   ===================================================== */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-card {
    padding: 1.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.card-content {
    color: var(--text);
    line-height: 1.7;
}

.card-content.prose {
    font-size: 0.9375rem;
}

/* =====================================================
   Info List
   ===================================================== */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item dt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item dd {
    color: var(--text);
}

.info-item dd a {
    color: var(--primary);
    text-decoration: none;
}

.info-item dd a:hover {
    text-decoration: underline;
}

/* =====================================================
   Linked Items
   ===================================================== */
.linked-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.linked-item {
    display: block;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.15s;
}

.linked-item:hover {
    background: var(--border);
}

.linked-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.linked-item-title {
    font-weight: 600;
    color: var(--primary);
}

.linked-item-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* =====================================================
   Additional Content
   ===================================================== */
.additional-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* =====================================================
   Disclaimer
   ===================================================== */
.disclaimer-box {
    padding: 1rem;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: #92400e;
    margin-bottom: 2rem;
}

/* =====================================================
   Discovery Footer
   ===================================================== */
.discovery-footer {
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.discovery-label {
    font-weight: 600;
}

/* =====================================================
   Comments Section
   ===================================================== */
.comments-section {
    margin-bottom: 2rem;
}

.comments-section .card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comment-count {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment {
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.comment-meta {
    display: flex;
    flex-direction: column;
}

.comment-author {
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-body {
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.add-comment {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.add-comment-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-alt);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.add-comment-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* =====================================================
   Related Items Section
   ===================================================== */
.related-section {
    margin-bottom: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.related-card {
    display: block;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.15s ease;
}

.related-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.related-card-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.related-card-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.related-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

/* =====================================================
   Often Used Together
   ===================================================== */
.used-together-section {
    margin-bottom: 2rem;
}

.used-together-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.used-together-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.15s ease;
}

.used-together-item:hover {
    border-color: var(--primary);
    background: var(--bg-alt);
}

.used-together-name {
    font-weight: 500;
    color: var(--text);
    font-size: 0.875rem;
}

.used-together-badge {
    font-size: 0.625rem;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 768px) {
    .detail-title-content h1 {
        font-size: 1.5rem;
    }

    .detail-title-with-actions {
        flex-direction: column;
    }

    .detail-actions {
        width: 100%;
    }

    .detail-actions .btn {
        flex: 1;
        justify-content: center;
    }

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

    .quick-links {
        grid-template-columns: 1fr;
    }

    .additional-content {
        grid-template-columns: 1fr;
    }

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