/* css/tool-detail-card.css */

/* 1. The Full-Screen Overlay */
#toolDetailOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#toolDetailOverlay.active {
    display: flex;
}

/* 2. The Card Itself */
.tool-detail-card {
    background: var(--feather-black);
    padding: 1rem; /* Reduced to give maximum width to the table on small screens */
    border-radius: 20px;
    position: relative;
    max-width: 600px;
    width: 95%; /* Slightly wider on mobile */
    max-height: 85vh; 
    overflow-y: auto; 
    color: var(--feather-white);
    border: 1px solid var(--coal-dust);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 3. The Close Button */
.close-detail {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--feather-white);
    line-height: 1;
    z-index: 10;
}

/* 4. The Nest Tag (Pillar) */
#toolDetailPillar {
    display: inline-block;
    background: var(--tail-green);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    margin-right: 30px; 
}

/* 5. Typography */
#toolDetailTitle {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

#toolDetailDescription {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--downy-grey);
}

#toolDetailLongDescription {
    font-size: 0.9rem;
    color: var(--downy-grey);
    border-top: 1px solid var(--coal-dust);
    padding-top: 1rem;
    margin-top: 0.5rem;
    overflow-x: auto; 
}

/* 6. Markdown Table Styling */
#toolDetailLongDescription table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem; /* Slightly smaller base font for mobile tables */
}

#toolDetailLongDescription th, 
#toolDetailLongDescription td {
    padding: 8px 6px; /* Tighter padding to eliminate awkward horizontal scroll */
    text-align: left;
    border-bottom: 1px solid var(--coal-dust);
    white-space: nowrap; 
}

#toolDetailLongDescription th {
    background-color: var(--metal-coal-dust);
    color: var(--light-gold-reflect);
    font-weight: 700;
}

#toolDetailLongDescription tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03);
}

#toolDetailLongDescription em {
    display: block;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--metal-mid-grey);
}

/* 7. Desktop Adjustments */
@media (min-width: 768px) {
    .tool-detail-card {
        padding: 2.5rem; /* Restore generous padding */
        width: 90%;
    }
    
    #toolDetailLongDescription table {
        font-size: 0.9rem;
    }

    #toolDetailLongDescription th, 
    #toolDetailLongDescription td {
        padding: 10px 12px; /* Restore generous table cell padding */
    }
    
    .close-detail {
        top: 15px;
        right: 20px;
    }
}
