/* Modern Template Modal Styles */

/* Make modal wider and more spacious */
#editTemplateModal .modal-content {
    max-width: 900px !important;
    width: 90vw !important;
}

/* Modernize the available tags section - make tags draggable */
.available-tags code {
    cursor: grab;
    transition: all 0.2s ease;
    display: inline-block;
    background: #f3f4f6 !important;
    color: #374151 !important;
    padding: 0.15rem 0.35rem !important;
    border-radius: 3px !important;
    margin: 0.08rem !important;
    font-weight: 500;
    font-size: 0.7rem !important;
    border: 1px solid #d1d5db !important;
    user-select: none;
}

.available-tags code:hover {
    background: #e5e7eb !important;
    border-color: #9ca3af !important;
    cursor: grab;
}

.available-tags code:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Improve the available tags container */
.available-tags {
    background: rgba(249, 250, 251, 0.5) !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    padding: 0.75rem !important;
}

/* Add drag-over state for textarea */
#editTemplateContent.drag-over {
    border: 2px solid #3b82f6 !important;
    background: rgba(59, 130, 246, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Improve textarea styling */
#editTemplateContent, #editTemplateSubject {
    border: 1px solid #d1d5db !important;
    transition: all 0.2s ease;
}

#editTemplateContent:focus, #editTemplateSubject:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

/* Modernize form controls */
.form-control {
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Improve modal header - plain style like Campaign modal */
#editTemplateModal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

#editTemplateModal .modal-header .modal-title {
    color: #1f2937 !important;
    font-size: 1.5rem;
    font-weight: 600;
}

#editTemplateModal .modal-header .close {
    color: #9ca3af !important;
    opacity: 1;
    font-size: 1.5rem;
}

#editTemplateModal .modal-header .close:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

/* Improve modal body */
#editTemplateModal .modal-body {
    padding: 2rem !important;
}

/* Improve buttons - plain style */
#editTemplateModal .btn-primary {
    background: #3b82f6 !important;
    border: none !important;
    padding: 0.625rem 1.25rem !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

#editTemplateModal .btn-primary:hover {
    background: #2563eb !important;
}

#editTemplateModal .btn-secondary {
    background: #f7fafc !important;
    color: #4a5568 !important;
    border: 2px solid #e2e8f0 !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

#editTemplateModal .btn-secondary:hover {
    background: #edf2f7 !important;
    border-color: #cbd5e0 !important;
}

/* Improve form labels */
.form-label {
    font-weight: 600 !important;
    color: #2d3748 !important;
    margin-bottom: 0.5rem !important;
}

/* Add visual feedback for dragging */
.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

/* Improve grid layout */
#editTemplateModal .modal-body > form > div[style*="grid"] {
    gap: 1.5rem !important;
}

/* Add animation to tag insertion */
@keyframes tagInserted {
    0% { background-color: rgba(102, 126, 234, 0.2); }
    100% { background-color: transparent; }
}

.tag-inserted {
    animation: tagInserted 0.5s ease;
}
