/* Message Template System Styles */

.template-manager {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Enhanced Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #2196f3;
    color: white;
}

.btn-primary:hover {
    background: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.btn-secondary {
    background: #666;
    color: white;
}

.btn-secondary:hover {
    background: #555;
}

.btn-outline {
    background: white;
    color: #666;
    border: 1px solid #ddd;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #999;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Modal Enhancements */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* Form Enhancements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* Content Editor */
.content-editor {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.placeholder-toolbar {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    align-items: center;
}

.placeholder-toolbar select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.content-editor textarea {
    border: none;
    border-radius: 0;
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* Badge Styles */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-system {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-custom {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-voice {
    background: #e8f5e8;
    color: #2e7d32;
}

/* Placeholder Highlighting */
.placeholder-highlight {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

/* Personalization Modal */
.personalization-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.influencer-inputs,
.brand-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.preview-content {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    min-height: 100px;
    line-height: 1.5;
    color: #333;
    white-space: pre-wrap;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 1002;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.notification.success {
    background: #4caf50;
}

.notification.error {
    background: #f44336;
}

.notification.warning {
    background: #ff9800;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .template-manager {
        padding: 10px;
    }

    .template-filters {
        flex-direction: column;
        gap: 15px;
    }

    .template-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

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

    .modal {
        padding: 10px;
    }

    .modal-content {
        max-width: 100%;
    }

    .influencer-inputs,
    .brand-inputs {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column;
    }
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.template-header h2 {
    color: #333;
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.template-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.filter-group label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.template-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.template-list {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.template-item {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-item:hover {
    background: #f8f9fa;
}

.template-item.selected {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.template-item:last-child {
    border-bottom: none;
}

.template-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.template-item-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.template-badges {
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-system {
    background: #e8f5e8;
    color: #2e7d32;
}

.badge-custom {
    background: #fff3e0;
    color: #f57c00;
}

.badge-voice {
    background: #f3e5f5;
    color: #7b1fa2;
}

.template-item-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.collaboration-type {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.description {
    font-size: 13px;
    color: #888;
    font-style: italic;
}

.template-item-preview {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.template-preview {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #999;
}

.preview-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
}

.template-preview-content {
    height: 100%;
}

.preview-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.preview-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

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

.preview-description {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.preview-description p {
    margin: 0;
    color: #666;
    font-style: italic;
}

.preview-content {
    margin-bottom: 20px;
}

.preview-content label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.content-display {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    line-height: 1.6;
    white-space: pre-wrap;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.placeholder-highlight {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

.preview-placeholders {
    margin-top: 20px;
}

.preview-placeholders label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.placeholder-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.placeholder-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}

.template-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

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

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

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

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.content-editor {
    position: relative;
}

.placeholder-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.placeholder-toolbar select {
    flex: 1;
    margin: 0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.personalization-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.influencer-inputs,
.brand-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.personalized-preview {
    margin-top: 20px;
}

.personalized-preview label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.preview-content {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    min-height: 200px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #2196f3;
    color: white;
}

.btn-primary:hover {
    background: #1976d2;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-outline {
    background: transparent;
    color: #2196f3;
    border: 1px solid #2196f3;
}

.btn-outline:hover {
    background: #2196f3;
    color: white;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #4caf50;
}

.notification.error {
    background: #f44336;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .template-content {
        grid-template-columns: 1fr;
    }

    .template-filters {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group {
        min-width: auto;
    }

    .template-actions {
        flex-direction: column;
    }

    .influencer-inputs,
    .brand-inputs {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }
}