/* Base Styles */
:root {
    --primary-color: #2563eb;
    --bg-color: #ffffff;
    --text-color: #333333;
    --border-color: #e5e7eb;
    --hover-bg: #f3f4f6;
    --sidebar-width: 280px;
    --card-border: 1px solid #e5e7eb;
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    --card-radius: 8px;
}

/* Main Container */
.main-container {
    padding: 2rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* Search Box */
.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1.25rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.search-stats {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.875rem;
}

/* Navigation Styles */
.nav-column {
    position: relative;
}

.tabs-wrapper {
    position: sticky;
    top: 1rem;
    background: var(--bg-color);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding-right: 0.5rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--hover-bg);
    max-height: calc(100vh - 2rem);
}

.nav-tabs-container {
    background: var(--bg-color);
    border-radius: 16px;
    overflow: hidden;
}

.category-tabs {
    list-style: none;
    padding: 0.5rem;
    margin: 0;
}

.category-tabs .nav-item {
    margin-bottom: 0.5rem;
    border-radius: 12px;
    overflow: hidden;
    background: var(--hover-bg);
    transition: all 0.3s ease;
}

.category-tabs .nav-item:hover {
    transform: translateX(4px);
}

.category-tabs .nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    color: var(--text-color);
    transition: all 0.3s ease;
    gap: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
}

.category-tabs .nav-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
}

.category-tabs .nav-link.active,
.category-tabs .nav-link.active .tab-title,
.category-tabs .nav-link.active i {
    color: #ffffff;
}

.category-tabs .nav-link.active {
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.category-tabs .nav-link i {
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.category-tabs .nav-link:hover i {
    transform: scale(1.1);
}

.category-toggle {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 1.1rem;
    opacity: 0.7;
}

.nav-link.active .category-toggle {
    transform: rotate(-180deg);
    opacity: 1;
}

.subcategory-list {
    list-style: none;
    padding: 0.5rem;
    margin: 0.5rem 0 0 1.5rem;
    border-left: 2px solid rgba(37, 99, 235, 0.2);
    display: none;
    transition: all 0.3s ease;
}

.subcategory-list.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.subcategory-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.95rem;
    gap: 0.75rem;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin-bottom: 0.25rem;
}

.subcategory-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
    transform: translateX(4px);
}

.subcategory-link.active {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-color);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.subcategory-link.active i {
    color: var(--primary-color);
    opacity: 1;
}

.subcategory-link i {
    font-size: 1.1rem;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.subcategory-link:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.prompt-count {
    margin-left: auto;
    background: rgba(37, 99, 235, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link.active .prompt-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Layout */
.content-layout {
    display: flex;
    gap: 2rem;
    position: relative;
    padding: 0 1rem;
    margin-top: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding-bottom: 2rem;
    min-height: calc(100vh - 2rem);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.prompt-section {
    background: var(--bg-color);
    border-radius: var(--card-radius);
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
}

.category-card {
    margin-bottom: 1.5rem;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--hover-bg);
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    border: var(--card-border);
    border-bottom: none;
}

.prompt-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border: var(--card-border);
    border-radius: 0 0 var(--card-radius) var(--card-radius);
}

.prompt-item {
    position: relative;
    background: var(--bg-color);
    border: var(--card-border);
    border-radius: var(--card-radius);
    transition: all 0.2s ease;
    overflow: hidden;
}

.prompt-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--card-shadow);
    transform: translateY(-2px);
}

.prompt-preview {
    padding: 1rem;
    border-bottom: var(--card-border);
}

.prompt-text {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.prompt-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.prompt-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--hover-bg);
    justify-content: flex-end;
}

.btn {
    padding: 0.5rem;
    border-radius: var(--card-radius);
    border: var(--card-border);
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.btn i {
    font-size: 1.1rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 4rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top i {
    font-size: 1.5rem;
}

.back-to-top:hover {
    background: #1d4ed8;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
    display: flex;
}

/* Responsive */
@media (max-width: 992px) {
    .content-layout {
        flex-direction: column;
    }

    .main-content {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .prompt-list {
        grid-template-columns: 1fr;
    }
}
