/* -------------------------------------------------------------------------
   Header nav link (← تبدیل جدید)
------------------------------------------------------------------------- */

.library-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 14px;
    border: 1.5px solid rgba(255,255,255,0.6);
    border-radius: 8px;
    transition: all 0.15s ease;
    opacity: 0.9;
    display: inline-block;
}

.library-link:hover {
    opacity: 1;
    background: rgba(255,255,255,0.15);
}

/* -------------------------------------------------------------------------
   Loading & empty states
------------------------------------------------------------------------- */

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 0;
    color: #8e8e93;
    font-size: 15px;
}

.loading-spinner-sm {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e5ea;
    border-top-color: #007aff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    text-align: center;
    color: #8e8e93;
}

.empty-icon svg {
    width: 56px;
    height: 56px;
    color: #c7c7cc;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* -------------------------------------------------------------------------
   Entry cards
------------------------------------------------------------------------- */

#entry-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.entry-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    transition: box-shadow 0.15s ease;
}

.entry-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

.entry-card.ready:hover {
    box-shadow: 0 4px 16px rgba(0,122,255,0.12);
}

.entry-card.failed {
    opacity: 0.6;
}

/* -------------------------------------------------------------------------
   Card content
------------------------------------------------------------------------- */

.card-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lang-badge,
.duration-badge,
.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.lang-badge.badge--fa {
    background: #f0e6ff;
    color: #7c3aed;
}

.lang-badge.badge--en {
    background: #e0f0ff;
    color: #0056cc;
}

.duration-badge {
    background: #f2f2f7;
    color: #6e6e73;
    font-variant-numeric: tabular-nums;
}

.badge--failed {
    background: #ffebee;
    color: #c62828;
}

.badge--generating {
    background: #fff8e1;
    color: #f57f17;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-preview {
    font-size: 13px;
    color: #8e8e93;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-date {
    font-size: 12px;
    color: #c7c7cc;
    margin-top: 2px;
}

/* -------------------------------------------------------------------------
   Progress bar (generating state)
------------------------------------------------------------------------- */

.card-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.card-progress-bar {
    flex: 1;
    height: 4px;
    background: #e5e5ea;
    border-radius: 2px;
    overflow: hidden;
}

.card-progress-fill {
    height: 100%;
    background: #007aff;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.card-progress-label {
    font-size: 12px;
    color: #8e8e93;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* -------------------------------------------------------------------------
   Card action buttons
------------------------------------------------------------------------- */

.card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.action-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
    background: #f2f2f7;
    color: #1d1d1f;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.action-btn:hover {
    background: #e5e5ea;
}

.action-btn:active {
    transform: scale(0.92);
}

.action-btn--play {
    background: #007aff;
    color: white;
    width: 42px;
    height: 42px;
}

.action-btn--play svg {
    width: 14px;
    height: 14px;
    transform: translateX(1px);
}

.action-btn--play:hover {
    background: #0056cc;
}

.action-btn--delete:hover {
    background: #ffebee;
    color: #c62828;
}

/* -------------------------------------------------------------------------
   Responsive
------------------------------------------------------------------------- */

@media (max-width: 600px) {
    .entry-card {
        padding: 14px 16px;
        gap: 12px;
    }

    .card-title {
        font-size: 14px;
    }

    .action-btn {
        width: 34px;
        height: 34px;
    }

    .action-btn--play {
        width: 38px;
        height: 38px;
    }
}
