/* Site-Specific Neumorphic Enhancements for Claude Code Templates */
/* Based on aitmpl.com structure and components */

/* =================== SEARCH & BROWSE =================== */

/* Main Search Container */
.search-container,
.component-search {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--radius-large);
    margin: 20px 0;
    box-shadow: 
        8px 8px 16px var(--shadow-color),
        -8px -8px 16px var(--highlight-color);
    transition: all var(--transition-medium);
}

/* Search Input Groups */
.search-group {
    position: relative;
    margin-bottom: 16px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper input {
    flex: 1;
    padding: 14px 48px 14px 20px;
    border: none;
    border-radius: var(--radius-xl);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 16px;
    box-shadow: 
        inset 4px 4px 8px var(--shadow-inset-color),
        inset -4px -4px 8px var(--highlight-color);
    transition: all var(--transition-fast);
}

.search-input-wrapper input:focus {
    outline: none;
    box-shadow: 
        inset 4px 4px 8px var(--shadow-inset-color),
        inset -4px -4px 8px var(--highlight-color),
        0 0 0 2px var(--accent);
}

.search-input-wrapper .search-icon {
    position: absolute;
    right: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Search Results Counter */
.search-results-info {
    display: inline-block;
    padding: 8px 16px;
    background: var(--surface-color);
    border-radius: var(--radius-medium);
    color: var(--text-secondary);
    font-size: 14px;
    margin: 16px 0;
    box-shadow: 
        3px 3px 6px var(--shadow-color),
        -3px -3px 6px var(--highlight-color);
}

/* =================== COMPONENT CARDS =================== */

/* Main Component Grid */
.components-grid,
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 24px;
}

/* Individual Component Cards */
.component-card,
.template-item,
.agent-card,
.command-card {
    background: var(--surface-color);
    border-radius: var(--radius-large);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow: 
        6px 6px 12px var(--shadow-color),
        -6px -6px 12px var(--highlight-color);
    position: relative;
    overflow: hidden;
}

.component-card:hover,
.template-item:hover,
.agent-card:hover,
.command-card:hover {
    box-shadow: 
        8px 8px 16px var(--shadow-color),
        -8px -8px 16px var(--highlight-color);
    transform: translateY(-4px);
}

.component-card:active,
.template-item:active {
    box-shadow: 
        inset 2px 2px 4px var(--shadow-inset-color),
        inset -2px -2px 4px var(--highlight-color);
    transform: translateY(0px);
}

/* Card Headers */
.component-card h3,
.template-item h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
}

.component-card .description,
.template-item .description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Card Footer with Actions */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--shadow-color);
}

/* Copy/Download Buttons in Cards */
.copy-button,
.download-button,
.install-button {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-medium);
    background: var(--surface-color);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 
        3px 3px 6px var(--shadow-color),
        -3px -3px 6px var(--highlight-color);
    transition: all var(--transition-fast);
}

.copy-button:hover,
.download-button:hover,
.install-button:hover {
    box-shadow: 
        2px 2px 4px var(--shadow-color),
        -2px -2px 4px var(--highlight-color);
    transform: translateY(-1px);
}

.copy-button:active,
.download-button:active,
.install-button:active {
    box-shadow: 
        inset 2px 2px 4px var(--shadow-inset-color),
        inset -2px -2px 4px var(--highlight-color);
    transform: translateY(1px);
}

/* Success state for copy button */
.copy-button.success {
    background: var(--accent);
    color: white;
    box-shadow: 
        3px 3px 6px var(--shadow-color),
        -3px -3px 6px var(--highlight-color),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
}

/* =================== NAVIGATION & FILTERS =================== */

/* Main Navigation Tabs */
.nav-tabs,
.filter-tabs,
.category-tabs {
    display: flex;
    background: var(--surface-color);
    border-radius: var(--radius-large);
    padding: 8px;
    margin: 16px 0;
    gap: 4px;
    box-shadow: 
        inset 3px 3px 6px var(--shadow-inset-color),
        inset -3px -3px 6px var(--highlight-color);
    flex-wrap: wrap;
}

.nav-tab,
.filter-tab,
.category-tab {
    padding: 12px 20px;
    border-radius: var(--radius-medium);
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
}

.nav-tab:hover,
.filter-tab:hover,
.category-tab:hover {
    color: var(--text-primary);
    background: var(--surface-color);
    box-shadow: 
        2px 2px 4px var(--shadow-color),
        -2px -2px 4px var(--highlight-color);
}

.nav-tab.active,
.filter-tab.active,
.category-tab.active {
    background: var(--surface-color);
    color: var(--text-primary);
    box-shadow: 
        4px 4px 8px var(--shadow-color),
        -4px -4px 8px var(--highlight-color);
}

/* Tab indicators */
.nav-tab.active::after,
.filter-tab.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

/* =================== BADGES & STATS =================== */

/* Download Stats, GitHub Stars, etc. */
.stats-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin: 16px 0;
}

.stat-badge,
.download-badge,
.star-badge,
.license-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 500;
    gap: 6px;
    box-shadow: 
        2px 2px 4px var(--shadow-color),
        -2px -2px 4px var(--highlight-color);
    transition: all var(--transition-fast);
}

.stat-badge:hover {
    transform: scale(1.05);
    box-shadow: 
        3px 3px 6px var(--shadow-color),
        -3px -3px 6px var(--highlight-color);
}

.stat-badge .icon {
    opacity: 0.7;
}

/* Category/Tag Chips */
.tag-chip,
.category-chip {
    display: inline-block;
    padding: 4px 12px;
    background: var(--surface-color);
    color: var(--text-secondary);
    border-radius: var(--radius-xl);
    font-size: 11px;
    font-weight: 500;
    margin: 2px;
    box-shadow: 
        2px 2px 4px var(--shadow-color),
        -2px -2px 4px var(--highlight-color);
    transition: all var(--transition-fast);
}

.tag-chip:hover,
.category-chip:hover {
    color: var(--text-primary);
    transform: scale(1.05);
    box-shadow: 
        3px 3px 6px var(--shadow-color),
        -3px -3px 6px var(--highlight-color);
}

/* =================== MODALS & POPUPS =================== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: modalFadeIn 0.3s ease forwards;
}

@keyframes modalFadeIn {
    to { opacity: 1; }
}

/* Modal Content */
.modal-content,
.component-modal {
    background: var(--surface-color);
    border-radius: var(--radius-large);
    padding: 32px;
    max-width: 600px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 
        12px 12px 24px var(--shadow-color),
        -12px -12px 24px var(--highlight-color);
    transform: scale(0.9) translateY(20px);
    animation: modalSlideIn 0.3s ease forwards;
}

@keyframes modalSlideIn {
    to {
        transform: scale(1) translateY(0);
    }
}

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        3px 3px 6px var(--shadow-color),
        -3px -3px 6px var(--highlight-color);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    box-shadow: 
        2px 2px 4px var(--shadow-color),
        -2px -2px 4px var(--highlight-color);
}

/* =================== STACK BUILDER =================== */

/* Stack Builder Container */
.stack-builder {
    background: var(--surface-color);
    border-radius: var(--radius-large);
    padding: 24px;
    margin: 24px 0;
    box-shadow: 
        6px 6px 12px var(--shadow-color),
        -6px -6px 12px var(--highlight-color);
}

.stack-builder h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Selected Stack Items */
.selected-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
    min-height: 60px;
    padding: 16px;
    background: var(--surface-color);
    border-radius: var(--radius-medium);
    box-shadow: 
        inset 3px 3px 6px var(--shadow-inset-color),
        inset -3px -3px 6px var(--highlight-color);
}

.stack-item {
    padding: 8px 12px;
    background: var(--surface-color);
    border-radius: var(--radius-small);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 
        2px 2px 4px var(--shadow-color),
        -2px -2px 4px var(--highlight-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.stack-item:hover {
    transform: scale(1.05);
}

.stack-item .remove {
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: 4px;
}

.stack-item .remove:hover {
    color: var(--accent);
}

/* Generate Button */
.generate-stack-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-medium);
    background: linear-gradient(145deg, var(--accent), #ff8c5a);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 
        4px 4px 8px var(--shadow-color),
        -4px -4px 8px var(--highlight-color);
    transition: all var(--transition-fast);
}

.generate-stack-btn:hover {
    box-shadow: 
        6px 6px 12px var(--shadow-color),
        -6px -6px 12px var(--highlight-color);
    transform: translateY(-2px);
}

.generate-stack-btn:active {
    transform: translateY(0);
    box-shadow: 
        2px 2px 4px var(--shadow-color),
        -2px -2px 4px var(--highlight-color);
}

/* =================== LOADING STATES =================== */

.loading-placeholder {
    background: var(--surface-color);
    border-radius: var(--radius-medium);
    height: 120px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        inset 2px 2px 4px var(--shadow-inset-color),
        inset -2px -2px 4px var(--highlight-color);
}

.loading-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* =================== RESPONSIVE DESIGN =================== */

@media (max-width: 768px) {
    .components-grid,
    .templates-grid {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }
    
    .nav-tabs,
    .filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tab,
    .filter-tab {
        flex-shrink: 0;
    }
    
    .modal-content {
        padding: 24px;
        width: 95vw;
    }
    
    .stats-container {
        justify-content: center;
    }
}

/* =================== UTILITY CLASSES =================== */

.neu-elevated {
    box-shadow: 
        6px 6px 12px var(--shadow-color),
        -6px -6px 12px var(--highlight-color);
}

.neu-pressed {
    box-shadow: 
        inset 3px 3px 6px var(--shadow-inset-color),
        inset -3px -3px 6px var(--highlight-color);
}

.neu-flat {
    box-shadow: 
        2px 2px 4px var(--shadow-color),
        -2px -2px 4px var(--highlight-color);
}

/* Text Selections */
::selection {
    background: var(--accent);
    color: white;
}

::-moz-selection {
    background: var(--accent);
    color: white;
}