/* LIBRARY PREMIUM CSS */

.lib-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

/* CARD BASE */
.lib-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.lib-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 0, 255, 0.2);
}

/* GLOW EFFECT ON HOVER */
.lib-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.lib-card:hover::before {
    opacity: 1;
}

/* HEADER SECTION */
.lib-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.01);
}

.lib-icon-box {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(217, 70, 239, 0.2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d946ef;
}

.lib-info {
    flex: 1;
    min-width: 0;
    /* Text truncation fix */
}

.lib-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lib-version {
    display: inline-block;
    background: rgba(34, 211, 238, 0.1);
    color: var(--neon-cyan);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 600;
    font-family: var(--font-mono);
}

/* BODY SECTION */
.lib-body {
    padding: 1.5rem;
}

.lib-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.lib-meta-item {
    display: flex;
    flex-direction: column;
}

.lib-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.lib-label i {
    color: #d946ef;
}

.lib-value {
    color: #f1f5f9;
    font-size: 0.95rem;
    font-weight: 500;
}

.lib-sub {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

/* ACTION BUTTON */
.lib-action {
    margin-top: auto;
}

.lib-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.lib-btn:hover {
    background: var(--neon-cyan);
    color: black;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}

.lib-btn-sec {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.lib-btn-sec:hover,
.lib-btn-sec.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* VERSIONS LIST */
.lib-versions-wrapper {
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
    display: none;
    /* Hidden by default */
}

.lib-versions-wrapper.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.lib-ver-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.lib-ver-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.lib-ver-info {
    display: flex;
    flex-direction: column;
}

.lib-ver-num {
    color: white;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
}

.lib-ver-date {
    color: #64748b;
    font-size: 0.75rem;
}

.lib-btn-dl-ver {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.lib-btn-dl-ver:hover {
    background: var(--neon-cyan);
    color: black;
    border-color: var(--neon-cyan);
}

/* Version Loader/Empty/Error */
.lib-ver-msg {
    text-align: center;
    padding: 1rem;
    color: #94a3b8;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .lib-grid {
        grid-template-columns: 1fr;
    }

    .lib-container {
        padding: 0 1rem 6rem;
        /* Extra bottom padding for mobile nav */
    }
}