/* Template Management Styles */

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal:not(.hidden) {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    color: #1f2937;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #1f2937;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Demo Prompts Section */
.demo-prompts-section {
    background: #f9fafb;
    border-radius: 8px;
    padding: 15px;
}

.demo-prompts-header {
    user-select: none;
}

.demo-prompts-header:hover {
    background: #f3f4f6;
    margin: -10px;
    padding: 20px 10px;
    border-radius: 8px;
}

#demoPromptsArrow {
    display: inline-block;
    font-size: 12px;
}

#demoPromptsArrow.collapsed {
    transform: rotate(-90deg);
}

/* Template List Display */
.template-list-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.template-list-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.template-info {
    flex: 1;
}

.template-name {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 4px;
    font-size: 14px;
}

.template-meta {
    font-size: 12px;
    color: #6b7280;
}

.template-actions {
    display: flex;
    gap: 10px;
}

.template-delete {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    transition: all 0.2s;
}

.template-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Template Dropdown */
#templateSelect {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
    appearance: none;
}

/* Form Row for Modal */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        max-width: none;
    }
}

/* Template Category Badge */
.template-category {
    display: inline-block;
    padding: 2px 8px;
    background: #e5e7eb;
    color: #4b5563;
    border-radius: 12px;
    font-size: 11px;
    margin-left: 8px;
}