/**
 * Response Templates Styles
 * Template selector and categories
 */

.template-selector-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.template-selector-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary, #e2e8f0);
}

.template-selector-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #1a202c);
    display: flex;
    align-items: center;
    gap: 12px;
}

.template-selector-header h2 i {
    color: var(--accent-primary, #C41E3A);
}

.template-selector-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--text-tertiary, #718096);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.template-selector-close:hover {
    background: var(--bg-tertiary, #f6f8fa);
    color: var(--text-primary, #1a202c);
}

.template-selector-search {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-primary, #e2e8f0);
}

.template-selector-search input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-primary, #e2e8f0);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary, #1a202c);
    background: var(--bg-secondary, #f8f9fa);
}

.template-selector-search input:focus {
    outline: none;
    border-color: var(--accent-primary, #C41E3A);
    background: white;
}

.template-selector-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.template-category {
    margin-bottom: 24px;
}

.template-category:last-child {
    margin-bottom: 0;
}

.template-category h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary, #718096);
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-item {
    padding: 12px 16px;
    border: 1px solid var(--border-primary, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-secondary, #f8f9fa);
    cursor: pointer;
    transition: all 0.2s;
}

.template-item:hover {
    background: white;
    border-color: var(--accent-primary, #C41E3A);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.template-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1a202c);
    margin-bottom: 4px;
}

.template-preview {
    font-size: 13px;
    color: var(--text-tertiary, #718096);
    line-height: 1.5;
}

.template-vars {
    font-size: 11px;
    color: var(--accent-primary, #C41E3A);
    margin-top: 6px;
    font-weight: 500;
}

/* Dark mode */
html.dark-mode .template-selector-content {
    background: #1f2937;
}

html.dark-mode .template-selector-header {
    border-color: #374151;
}

html.dark-mode .template-selector-header h2 {
    color: #f9fafb;
}

html.dark-mode .template-selector-close:hover {
    background: #374151;
    color: #f9fafb;
}

html.dark-mode .template-selector-search {
    border-color: #374151;
}

html.dark-mode .template-selector-search input {
    background: #111827;
    border-color: #4b5563;
    color: #f9fafb;
}

html.dark-mode .template-selector-search input:focus {
    background: #1f2937;
    border-color: var(--accent-primary, #C41E3A);
}

html.dark-mode .template-category h3 {
    color: #9ca3af;
}

html.dark-mode .template-item {
    background: #111827;
    border-color: #374151;
}

html.dark-mode .template-item:hover {
    background: #1f2937;
    border-color: var(--accent-primary, #C41E3A);
}

html.dark-mode .template-name {
    color: #f9fafb;
}

html.dark-mode .template-preview {
    color: #9ca3af;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .template-selector-modal {
        padding: 10px;
    }

    .template-selector-content {
        max-height: 90vh;
    }

    .template-selector-header {
        padding: 16px;
    }

    .template-selector-header h2 {
        font-size: 18px;
    }

    .template-selector-search {
        padding: 12px 16px;
    }

    .template-selector-body {
        padding: 16px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
