/* Event Templates Styles */

.template-gallery-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    overflow-y: auto;
    padding: 2rem;
}

.template-gallery {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    animation: slideUp 0.3s ease;
}

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

.template-header {
    text-align: center;
    margin-bottom: 2rem;
}

.template-header h2 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.template-header p {
    color: #6b7280;
    font-size: 1.125rem;
}

.template-filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: #6b7280;
}

.filter-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.filter-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.template-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    border-color: #6366f1;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.1);
}

.template-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: white;
}

.template-content {
    flex: 1;
}

.template-content h3 {
    font-size: 1.25rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.template-content p {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.template-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.template-category,
.template-capacity {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: #f3f4f6;
    color: #6b7280;
}

.template-select-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.template-select-btn:hover {
    transform: translateY(-2px);
}

.template-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Template Preview Modal */
.template-preview-modal {
    max-width: 700px;
}

.template-preview {
    padding: 1rem;
}

.preview-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.preview-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    flex-shrink: 0;
}

.preview-header h2 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.preview-header p {
    color: #6b7280;
}

.preview-content h3,
.preview-content h4 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.preview-features {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.preview-features li {
    padding: 0.5rem 0;
    color: #4b5563;
    font-size: 0.9375rem;
}

.preview-sample {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.preview-sample h4 {
    margin-bottom: 0.75rem;
}

.sample-text {
    color: #6b7280;
    line-height: 1.6;
    white-space: pre-line;
    font-size: 0.875rem;
}

.preview-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Template Button in Create Event Form */
.template-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 1.5rem;
}

.template-trigger-btn:hover {
    transform: translateY(-2px);
}

.template-trigger-btn svg {
    width: 20px;
    height: 20px;
}

/* Applied Template Badge */
.applied-template-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f0f1ff;
    border: 1px solid #6366f1;
    border-radius: 8px;
    color: #6366f1;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.applied-template-badge button {
    background: none;
    border: none;
    color: #6366f1;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    margin-left: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .template-gallery-container {
        padding: 1rem;
    }
    
    .template-gallery {
        padding: 1.5rem;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .template-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .preview-header {
        flex-direction: column;
    }
    
    .preview-actions {
        flex-direction: column;
    }
    
    .preview-actions button {
        width: 100%;
    }
}

/* Animation for template selection */
@keyframes templateSelect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.template-card.selecting {
    animation: templateSelect 0.3s ease;
}
