/* Force full width for key fields in the email template editor */
.email-template-details-form input[type="text"],
.email-template-details-form input[type="email"],
.email-template-details-form input[type="search"],
.email-template-details-form input[type="password"],
.email-template-details-form input#recipient_field,
.email-template-details-form input[name="cc"],
.email-template-details-form input[name="bcc"],
.email-template-details-form input[name="subject"],
.email-template-details-form select,
.email-template-details-form textarea {
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 1rem;
    margin-bottom: 16px;
    transition: border 0.2s;
}
.merge-tags-output ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.merge-tags-output li {
    margin: 0 0 4px 0;
    padding: 0;
}
/* Modern, clean, fresh styles for email template editor */
.email-template-editor {
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    background: #f7f9fb;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 40px 40px 32px 40px;
    max-width: 800px;
    margin: 40px auto;
}

.email-template-editor h2, .email-template-editor h3, .email-template-editor h4 {
    font-weight: 600;
    color: #222;
    margin-bottom: 18px;
}


/* Modernize label and field layout */
.email-template-details-form label {
    display: block;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
    margin-top: 8px;
}

.email-template-details-form .form-row {
    margin-bottom: 18px;
}



.email-template-details-form input[type="text"]:focus,
.email-template-details-form select:focus,
.email-template-details-form textarea:focus {
    border-color: #0078d4;
    outline: none;
}

.email-template-details-form select[multiple] {
    min-height: 90px;
}

.email-template-details-form .submit {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.email-template-details-form button.button-primary {
    background: linear-gradient(90deg, #0078d4 0%, #005fa3 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 28px;
    font-size: 1.08rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,120,212,0.08);
    transition: background 0.2s, box-shadow 0.2s;
}
.email-template-details-form button.button-primary:hover {
    background: linear-gradient(90deg, #005fa3 0%, #0078d4 100%);
    box-shadow: 0 4px 16px rgba(0,120,212,0.13);
}
.email-template-details-form button.button {
    background: #f3f4f6;
    color: #222;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, border 0.2s;
}
.email-template-details-form button.button:hover {
    background: #e5e7eb;
    border-color: #b6bfc9;
}


/* Make merge tags and multi-selects more readable */
.email-template-details-form select[multiple],
.email-template-details-form .merge-tags-output {
    min-height: 110px;
    font-size: 1rem;
}

/* Add more space below the merge tags output */
.email-template-details-form .merge-tags-output {
    margin-bottom: 18px;
}

/* Responsive: ensure form is usable on mobile */
@media (max-width: 600px) {
    .email-template-editor {
        padding: 12px 4vw;
        max-width: 98vw;
    }
    .email-template-details-form input,
    .email-template-details-form select,
    .email-template-details-form textarea {
        font-size: 1rem;
        padding: 10px 8px;
    }
}

.email-template-details-form .merge-tags-output {
    background: #f1f5fa;
    border-left: 4px solid #0078d4;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 0.98rem;
    color: #1a2a3a;
}

.email-template-details-form .notice {
    margin-top: 10px;
    padding: 10px 16px;
    border-radius: 5px;
    font-size: 1rem;
}
.email-template-details-form .notice-success {
    background: #e6f7ec;
    color: #1a4d2e;
    border-left: 4px solid #2ecc71;
}
.email-template-details-form .notice-error {
    background: #fbeaea;
    color: #a94442;
    border-left: 4px solid #e74c3c;
}
.email-template-details-form .notice-warning {
    background: #fffbe6;
    color: #8a6d3b;
    border-left: 4px solid #ffb300;
}
/* File: assets/css/_edit-email-template.css */

.editor-tabs {
    margin-top: 15px;
    border: 1px solid #ccc;
    background: #f9f9f9;
}

.editor-tab-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    border-bottom: 1px solid #ccc;
    background: #e9e9e9;
}

.editor-tab-links li {
    padding: 10px 20px;
    cursor: pointer;
    border-right: 1px solid #ccc;
    background: #e9e9e9;
    transition: background 0.2s;
}

.editor-tab-links li:last-child {
    border-right: none;
}

.editor-tab-links li.active {
    background: #fff;
    font-weight: bold;
}

.editor-tab-content {
    padding: 15px;
    display: none;
    background: #fff;
}

.editor-tab-content.active {
    display: block;
}

#merge_tags_output {
    margin-top: 10px;
    background: #f1f1f1;
    padding: 10px;
    border-left: 4px solid #0073aa;
}

/* ==================================
   DRAG AND DROP RECIPIENT UI
   ================================== */

.recipient-drag-drop-container {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.recipient-drag-drop-container h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.4em;
}

.recipient-layout {
    display: block;
    gap: 20px;
    margin-top: 20px;
}

/* Make available recipients sit above the drop zones in multiple columns */
.available-recipients {
    margin-bottom: 18px;
}

.recipient-drop-zones.three-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

/* Left Side: Available Recipients */
.available-recipients {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.available-recipients h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1em;
}

.recipient-source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.recipient-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    cursor: grab;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 0.9em;
}

.recipient-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.recipient-item:active {
    cursor: grabbing;
}

.recipient-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Right Side: Drop Zones */
.recipient-drop-zones {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drop-zone-wrapper {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

.drop-zone-wrapper label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #495057;
}

.drop-zone {
    min-height: 80px;
    padding: 15px;
    border: 2px dashed #ced4da;
    border-radius: 6px;
    background: #f8f9fa;
    transition: all 0.3s;
    position: relative;
}

.drop-zone.drag-over {
    border-color: #667eea;
    background: #e7e9ff;
    border-style: solid;
}

.drop-zone-placeholder {
    color: #6c757d;
    text-align: center;
    font-style: italic;
    padding: 10px;
}

.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

.recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.9em;
    animation: chipFadeIn 0.3s ease;
}

@keyframes chipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.recipient-chip span {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip-remove {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    transition: background 0.2s;
}

.chip-remove:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 900px) {
    .recipient-layout {
        grid-template-columns: 1fr;
    }

    .recipient-source-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}
