/**
 * Template Gallery Styles
 * Phase 6: Quick prompts and template suggestions
 */

/* Gallery toggle button */
.template-gallery-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: transparent;
    color: #6b7280;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.template-gallery-btn:hover {
    background: #f3f4f6;
    color: #6D55D6;
}

.template-gallery-btn.active {
    background: rgba(127, 101, 235, 0.1);
    color: #6D55D6;
}

/* Gallery container */
.template-gallery {
    display: none;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: gallery-slide-up 0.2s ease-out;
}

.template-gallery.visible {
    display: block;
}

@keyframes gallery-slide-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gallery header */
.template-gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.template-gallery-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.template-gallery-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.template-gallery-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* Gallery tabs */
.template-gallery-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 8px 0;
    background: #f9fafb;
    overflow-x: auto;
    scrollbar-width: none;
}

.template-gallery-tabs::-webkit-scrollbar {
    display: none;
}

.template-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.template-tab:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #374151;
}

.template-tab.active {
    background: white;
    color: #6D55D6;
    box-shadow: 0 -2px 0 #6D55D6 inset;
}

.template-tab .tab-icon {
    font-size: 14px;
}

/* Gallery content */
.template-gallery-content {
    padding: 8px;
    background: white;
    max-height: 200px;
    overflow-y: auto;
}

.template-category {
    display: none;
    gap: 4px;
    flex-direction: column;
}

.template-category.active {
    display: flex;
}

/* Template items */
.template-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: none;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

.template-item:hover {
    background: rgba(112, 85, 226, 0.08);
    transform: translateX(2px);
}

.template-item:hover .template-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.template-label {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

.template-arrow {
    color: #9ca3af;
    opacity: 0;
    transition: all 0.15s ease;
}

/* Custom scrollbar */
.template-gallery-content::-webkit-scrollbar {
    width: 6px;
}

.template-gallery-content::-webkit-scrollbar-track {
    background: transparent;
}

.template-gallery-content::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 3px;
}

.template-gallery-content::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* ===========================================
   DARK MODE — Template Gallery Overrides
   =========================================== */

[data-theme="dark"] .template-gallery-btn:hover {
    background: #2a2a45;
}

[data-theme="dark"] .template-gallery {
    background: #24243d;
    border-color: #353550;
}

[data-theme="dark"] .template-gallery-header {
    border-bottom-color: #353550;
}

[data-theme="dark"] .template-gallery-title {
    color: #f0f0f5;
}

[data-theme="dark"] .template-gallery-close {
    color: #706b8a;
}

[data-theme="dark"] .template-gallery-close:hover {
    background: #2a2a45;
    color: #a8a3c0;
}

[data-theme="dark"] .template-gallery-tabs {
    background: #1f1f35;
}

[data-theme="dark"] .template-tab {
    color: #a8a3c0;
}

[data-theme="dark"] .template-tab:hover {
    background: rgba(139, 117, 232, 0.08);
    color: #f0f0f5;
}

[data-theme="dark"] .template-tab.active {
    background: #24243d;
    color: #8B75E8;
}

[data-theme="dark"] .template-gallery-content {
    background: #24243d;
}

[data-theme="dark"] .template-item {
    background: #2a2a45;
}

[data-theme="dark"] .template-item:hover {
    background: rgba(139, 117, 232, 0.15);
}

[data-theme="dark"] .template-label {
    color: #f0f0f5;
}

[data-theme="dark"] .template-gallery-content::-webkit-scrollbar-thumb {
    background: #353550;
}

[data-theme="dark"] .template-gallery-content::-webkit-scrollbar-thumb:hover {
    background: #454565;
}