/* ========================================
   CATALOG CONTAINER
   ======================================== */
.catalog-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.catalog-header {
    display: none; /* Hidden by default on desktop */
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .catalog-header {
        display: flex;
    }
}

.catalog-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--primary));
    margin: 0;
}

.catalog-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    flex-shrink: 0;
}

.catalog-close:hover {
    background: hsl(var(--muted) / 0.5);
    color: hsl(var(--foreground));
    transform: scale(1.1) rotate(90deg);
}

.catalog-close i,
.catalog-close svg {
    width: 16px;
    height: 16px;
}

.catalog-title-section {
    margin-bottom: 0.5rem;
}

.catalog-subtitle {
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
}

.catalog-controls {
    display: flex;
    gap: 0.375rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: linear-gradient(135deg, hsl(240 8% 14%) 0%, hsl(240 8% 12%) 100%);
    border: 1px solid hsl(var(--border));
    border-radius: 0.375rem;
    flex: 1 1 auto;
    min-width: 160px;
    max-width: 240px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box:focus-within {
    border-color: hsl(var(--primary) / 0.5);
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.15);
    transform: translateY(-1px);
}

.search-box svg {
    color: hsl(var(--muted-foreground));
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.search-box .search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: hsl(var(--foreground));
    font-size: 0.75rem;
    outline: none;
    min-width: 0;
}

.search-box .search-input::placeholder {
    color: hsl(var(--muted-foreground));
}

.filter-tabs {
    display: flex;
    gap: 0.1875rem;
    background: hsl(var(--muted) / 0.5);
    padding: 0.1875rem;
    border-radius: 0.375rem;
    border: 1px solid hsl(var(--border));
    flex: 0 0 auto;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3125rem 0.625rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.filter-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.filter-tab:hover {
    color: hsl(var(--foreground));
    background: hsl(var(--muted) / 0.5);
    transform: translateY(-1px);
}

.filter-tab.active {
    color: hsl(var(--primary));
    background: transparent;
    border: 1.5px solid hsl(var(--primary));
}

.category-chips {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-bottom: 0;
    width: 100%;
    flex: 1 1 100%;
}

.category-chip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3125rem 0.625rem;
    background: linear-gradient(135deg, hsl(240 8% 14%) 0%, hsl(240 8% 12%) 100%);
    border: 1px solid hsl(var(--border));
    border-radius: 9999px;
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex: 0 0 auto;
}

.category-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.category-chip:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
    transform: translateY(-1px);
    box-shadow: 0 2px 8px hsl(var(--background) / 0.3);
}

.category-chip.active {
    background: transparent;
    border-color: hsl(var(--primary));
    border-width: 1.5px;
    color: hsl(var(--primary));
}

/* ========================================
   PROMPTS GRID
   ======================================== */
.prompts-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding-right: 0.5rem;
    padding-bottom: 1rem;
    align-content: start;
}

.prompt-card {
    background: linear-gradient(135deg, hsl(240 8% 14%) 0%, hsl(240 8% 12%) 100%);
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    scroll-margin-top: 1.5rem;
}

.prompt-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, hsl(25 85% 55% / 0.3) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.prompt-card:hover::before {
    opacity: 1;
}

.prompt-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px hsl(var(--background) / 0.6);
    border-color: hsl(var(--primary) / 0.3);
}

.prompt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.prompt-category {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: hsl(var(--muted) / 0.5);
    border-radius: 9999px;
    font-size: 0.6875rem;
    color: hsl(var(--muted-foreground));
}

.prompt-category-icon {
    width: 12px;
    height: 12px;
}

.prompt-likes {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.prompt-likes:hover {
    background: hsl(var(--muted) / 0.5);
}

.prompt-likes.liked {
    color: hsl(var(--primary));
}

.prompt-likes.liked svg {
    fill: currentColor;
}

.prompt-likes svg {
    width: 14px;
    height: 14px;
}

.prompt-title {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.prompt-description {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prompt-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid hsl(var(--border));
}

.prompt-card.expanded {
    /* Расширяем карточку на всю доступную ширину в текущем ряду */
    grid-column: 1 / -1;
    /* Но при этом не создаем новые строки - карточка растягивается по месту */
}

.prompt-card-expanded {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid hsl(var(--border));
    animation: expandCard 0.3s ease-out;
}

@keyframes expandCard {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
}

.prompt-expanded-content {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.prompt-expanded-description {
    font-size: 0.8125rem;
    color: hsl(var(--foreground) / 0.9);
    line-height: 1.5;
    white-space: pre-wrap;
    background: hsl(var(--muted) / 0.3);
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid hsl(var(--border));
}

.prompt-expanded-stats {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    background: hsl(var(--muted) / 0.3);
    border-radius: 0.5rem;
}

.prompt-expanded-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
}

.prompt-expanded-stats .stat-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.prompt-expanded-actions {
    display: flex;
    gap: 0.5rem;
}

.prompt-expanded-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.prompt-expanded-btn.primary {
    background: transparent;
    border: 1px solid hsl(var(--primary));
    color: hsl(var(--primary));
}

.prompt-expanded-btn.primary:hover {
    background: hsl(var(--primary) / 0.1);
    transform: translateY(-1px);
}

.prompt-expanded-btn.secondary {
    background: hsl(var(--muted) / 0.5);
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
}

.prompt-expanded-btn.secondary:hover {
    background: hsl(var(--muted));
    border-color: hsl(var(--border));
}

.prompt-expanded-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.prompt-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 22px;
    height: 22px;
    background: transparent;
    border: 1.5px solid hsl(var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5625rem;
    font-weight: 600;
    color: hsl(var(--primary));
}

.author-name {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.prompt-actions {
    display: flex;
    gap: 0.375rem;
}

.prompt-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: hsl(var(--muted) / 0.5);
    border: 1px solid hsl(var(--border));
    border-radius: 0.375rem;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.prompt-action-btn.use-btn {
    background: transparent;
    border: 1px solid hsl(var(--primary));
    color: hsl(var(--primary));
}

.prompt-action-btn:hover {
    background: transparent;
    border-color: hsl(var(--primary));
    border-width: 1.5px;
    color: hsl(var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px hsl(var(--background) / 0.4);
}

.prompt-action-btn.use-btn:hover {
    background: transparent;
    border-color: hsl(var(--primary));
    border-width: 1.5px;
    color: hsl(var(--primary));
}

/* Load More */
.load-more-section {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
    flex-shrink: 0;
}

.load-more-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, hsl(240 8% 14%) 0%, hsl(240 8% 12%) 100%);
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    height: auto;
}

.load-more-btn:hover {
    background: hsl(var(--muted));
    border-color: hsl(var(--primary) / 0.5);
}

/* ========================================
   PERSONAL CARDS
   ======================================== */
.personal-card {
    border-color: hsl(var(--primary) / 0.2);
}

.personal-card:hover {
    border-color: hsl(var(--primary) / 0.4);
}

.personal-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-weight: 500;
}

.personal-status.private {
    background: hsl(var(--muted) / 0.5);
    color: hsl(var(--muted-foreground));
}

.personal-status.public {
    background: hsl(var(--primary) / 0.15);
    color: hsl(var(--primary));
}

.personal-status .status-icon {
    width: 10px;
    height: 10px;
}

.share-personal-btn.active {
    color: hsl(var(--primary));
    border-color: hsl(var(--primary) / 0.3);
}

.delete-personal-btn:hover {
    color: hsl(var(--destructive, 0 84% 60%)) !important;
    border-color: hsl(var(--destructive, 0 84% 60%)) !important;
}

/* Empty state for personal */
.personal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    color: hsl(var(--muted-foreground));
}

.personal-empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.personal-empty-text {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.personal-empty-hint {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Local warning in Personal section - sticky at top */
.catalog-local-warning {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: hsl(var(--primary) / 0.06);
    border: 1px solid hsl(var(--primary) / 0.15);
    border-radius: 0.375rem;
    font-size: 0.625rem;
    color: hsl(var(--muted-foreground));
    position: sticky;
    top: 0;
    z-index: 1;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

.catalog-local-warning i,
.catalog-local-warning svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    color: hsl(var(--primary));
}

.catalog-local-warning a {
    color: hsl(var(--primary));
    text-decoration: none;
    font-weight: 500;
}

.catalog-local-warning a:hover {
    text-decoration: underline;
}

/* Deprecated: kept for backward compatibility */
.personal-local-warning {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: hsl(var(--primary) / 0.06);
    border: 1px solid hsl(var(--primary) / 0.15);
    border-radius: 0.375rem;
    font-size: 0.625rem;
    color: hsl(var(--muted-foreground));
    grid-column: 1 / -1;
}

.personal-local-warning i,
.personal-local-warning svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    color: hsl(var(--primary));
}

.personal-local-warning a {
    color: hsl(var(--primary));
    text-decoration: none;
    font-weight: 500;
}
