/**
 * WhatsApp Messenger Plugin Styles
 * Updated with Unified Styling System
 */

/* Import Unified Styles */
@import url('unified-styles.css');

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--shadow-heavy);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px var(--shadow-light);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-primary);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
}

/* Container */
.whatsapp-messenger-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Ayuda tab specific - increase container width */
#help.tab-pane .whatsapp-messenger-container,
.whatsapp-messenger-container:has(#help.tab-pane.active) {
    max-width: 1600px;
}

/* Header */
.whatsapp-header {
    text-align: left;
    margin-bottom: 30px;
    padding: 5px 30px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 0;
    border-bottom: 4px solid var(--primary-color);
    box-shadow: none;
}

.whatsapp-header h1 {
    margin: 0 0 8px 0;
    font-size: 2.2em;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.user-info {
    margin: 0;
    font-size: 1em;
    color: var(--text-secondary);
    font-weight: 400;
    border-left: 4px solid var(--primary-color) !important;
    background-color: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Verification Section */
.whatsapp-verification-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.verification-card {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-light);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.verification-card h2 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
}

.verification-form {
    margin-top: 20px;
}

/* Main Interface */
.whatsapp-main-interface {
    background: var(--bg-primary);
    border-radius: 0;
    border: 1px solid var(--border-primary);
    box-shadow: none;
    overflow: hidden;
}

/* Tabs - Using unified styles from unified-styles.css */

/* Tab Content */
.tab-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Import Methods */
.import-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Imported Data Section */
#imported-data-section {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 2px solid var(--primary-color);
}

#imported-data-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5em;
}





/* Button styles now handled by unified-styles.css */

.import-card {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.import-card:hover {
    box-shadow: 0 4px 6px var(--shadow-light);
    transform: translateY(-2px);
}

.import-card h3 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 1.2em;
}

.import-card p {
    margin: 0 0 20px 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Form styles handled by unified-styles.css */

/* Button styles now handled by unified-styles.css */

/* Template Actions */
.template-actions,
.session-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Session Limit Info */
.session-limit-info {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.session-limit-info p {
    margin: 0;
    color: var(--text-primary);
    font-weight: 500;
}

/* Default Numbers Section */
#default-numbers-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
}

.default-number-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px var(--shadow-light);
    transition: all 0.3s ease;
}

.default-number-card:hover {
    box-shadow: 0 4px 8px var(--shadow-medium);
    transform: translateY(-2px);
}

.default-number-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.default-number-header h4 {
    margin: 0;
    color: var(--primary-color);
}

.default-number-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.default-number-status.status-active {
    background: var(--success-color);
    color: white;
}

.default-number-status.status-inactive {
    background: var(--danger-color);
    color: white;
}

.default-number-content p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.default-number-actions {
    margin-top: 15px;
    text-align: right;
}

/* Session Cards */
.session-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px var(--shadow-light);
    transition: all 0.3s ease;
}

.session-card:hover {
    box-shadow: 0 4px 8px var(--shadow-medium);
    transform: translateY(-2px);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.session-header h4 {
    margin: 0;
    color: var(--primary-color);
}

.session-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.session-status.status-active {
    background: var(--success-color);
    color: white;
}

.session-status.status-inactive {
    background: var(--danger-color);
    color: white;
}

.session-content p {
    margin: 0;
    padding: 1px 0;
    color: var(--text-secondary);
    line-height: 1.1;
}

.session-actions {
    margin-top: 8px;
    text-align: right;
}

/* No sessions/default numbers message */
.no-sessions,
.no-default-numbers {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-style: italic;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 2px dashed var(--border-secondary);
}

/* Session Status Classes */
.session-status.status-qr-ready {
    background: var(--warning-color);
    color: white;
}

.session-status.status-connecting {
    background: var(--info-color);
    color: white;
}

.session-status.status-error {
    background: var(--danger-color);
    color: white;
}

/* Refresh Status Button */
#refresh-status-btn {
    background: var(--info-color);
    border-color: var(--info-color);
}

#refresh-status-btn:hover {
    background: #138496;
    border-color: #138496;
}

/* Data Table */
.data-table-container {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-light);
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tr:hover {
    background: var(--bg-secondary);
}

/* Loading overlay styles handled by first definition above */

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.close:hover {
    color: var(--text-primary);
}

/* QR Code */
#qr-code-container {
    text-align: center;
    margin: 20px 0;
}

.qr-instructions {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.qr-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.qr-instructions li {
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.warning-message {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #ffeaa7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .whatsapp-messenger-container {
        padding: 10px;
    }
    
    .whatsapp-header h1 {
        font-size: 2em;
    }
    
    .whatsapp-tabs {
        flex-direction: column;
    }
    
    .whatsapp-tab {
        margin-bottom: 5px;
    }
    
    /* Modal responsive improvements */
    .modal-content {
        padding: 20px;
        max-width: 95%;
        max-height: 90vh;
        margin: 10px;
    }
    
    .template-preview-content {
        padding: 12px;
    }
    
    .attachment-thumbnails {
        gap: 8px;
    }
    
    .attachment-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .file-preview-content {
        max-width: 95% !important;
        max-height: 85% !important;
    }
}

/* Utility classes and animations handled by unified-styles.css */

/* Group Management Interface Styles */
.group-management-section {
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 0;
    border: 1px solid var(--border-primary);
    box-shadow: none;
    margin-bottom: 25px;
}

.group-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.create-group-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.create-group-section .group-search-wrapper {
    flex: 1;
    margin: 0 15px;
}

.create-group-section .group-search-wrapper input {
    width: 100%;
}

.recalculate-icon-btn {
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.recalculate-icon-btn:hover {
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.recalculate-icon-btn:focus {
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.recalculate-icon-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.tag-filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-filter-dropdown {
    min-width: 200px;
    max-width: 300px;
    padding: 8px 12px;
    border: 2px solid var(--border-primary);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.tag-filter-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(193, 20, 158, 0.1);
}

.tag-filter-dropdown option {
    padding: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.tag-filter-dropdown option:checked {
    background: var(--primary-color);
    color: white;
}

.group-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

#group-selector {
    flex: 1;
    min-width: 300px;
    padding: 12px 15px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 16px;
    background: var(--bg-primary);
    transition: border-color 0.3s ease;
}

#group-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(193, 20, 158, 0.1);
}

.group-selection button {
    padding: 12px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: var(--bg-primary);
    color: var(--primary-color);
}

.group-selection button:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(193, 20, 158, 0.3);
}

/* Button styles now handled by unified-styles.css */

#group-info {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 0;
    border-left: 4px solid var(--primary-color);
}

#group-info h3 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 1.5em;
}

#group-info p {
    margin: 5px 0;
    color: var(--text-secondary);
}

#group-tags {
    margin: 10px 0;
}

#group-tags span {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Contacts Section Styles */
.contacts-section {
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 0;
    border: 1px solid var(--border-primary);
    box-shadow: none;
    margin-bottom: 25px;
}

/* Contacts Table Styles */
.contacts-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
    flex-wrap: wrap;
}

.search-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 300px;
}

.selection-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    white-space: nowrap;
}

#contact-search {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-primary);
}

#clear-search {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
}

/* Compact Filter Section */
.compact-filters {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-primary);
}

.filter-title {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.field-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: start;
}

.field-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-primary);
    padding: 10px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: 12px;
    min-width: 180px;
}

.field-filter label {
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.field-filter select,
.field-filter input {
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.field-filter select:focus,
.field-filter input:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(193, 20, 158, 0.1) !important;
}

.field-filter .remove-filter {
    background: var(--danger-color);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    margin-top: -8px;
    margin-right: -8px;
}

/* Scrollable Table Container */
.scrollable-table-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: var(--bg-primary);
}

#contacts-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

#contacts-table th,
#contacts-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
    vertical-align: top;
    font-size: 13px;
}

#contacts-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-primary);
    white-space: nowrap;
}

#contacts-table th.checkbox-column {
    width: 40px;
    text-align: center;
}

#contacts-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
    min-width: 100px;
}

#contacts-table th.sortable:hover {
    background: var(--bg-tertiary);
}

#contacts-table th.sortable.asc .sort-indicator::after {
    content: ' ▲';
    color: var(--primary-color);
    font-weight: bold;
}

#contacts-table th.sortable.desc .sort-indicator::after {
    content: ' ▼';
    color: var(--primary-color);
    font-weight: bold;
}

#contacts-table tbody tr:hover {
    background: var(--bg-secondary);
}

#contacts-table tbody tr:nth-child(even) {
    background: var(--bg-primary);
}

#contacts-table tbody tr:nth-child(even):hover {
    background: var(--bg-tertiary);
}

.contact-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

#header-select-all {
    width: 16px;
    height: 16px;
    cursor: pointer;
}



/* Responsive Design */
@media (max-width: 768px) {
    .contacts-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-controls {
        min-width: auto;
    }
    
    .selection-controls {
        justify-content: space-between;
    }
    

}

#selected-count {
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 10px;
}

/* Import Section Styles */
.import-section {
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 0;
    border: 1px solid var(--border-primary);
    box-shadow: none;
}

.import-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.import-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.import-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-light);
}

.import-card h3 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 1.3em;
}



.import-card input[type="file"] {
    flex: 1;
    padding: 8px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
}

/* Import Options Styles */
#import-options {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    margin-bottom: 20px;
}







/* Force unified dropdown styles */
.whatsapp-messenger-container select,
.whatsapp-messenger-container .form-control,
#import-options select,
#import-options .form-control,
#csv-import-form select,
#csv-import-form .form-control {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-primary) !important;
    border-radius: 8px !important;
}







.whatsapp-messenger-container select:focus,
.whatsapp-messenger-container .form-control:focus,
#import-options select:focus,
#import-options .form-control:focus,
#csv-import-form select:focus,
#csv-import-form .form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(193, 20, 158, 0.2) !important;
}





#import-options h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

/* Form styles handled by unified-styles.css */

.form-group button {
    margin-right: 10px;
    margin-bottom: 10px;
}

/* Import card buttons use unified button system */

/* Reference field visibility control - Specific selectors that can be overridden */
.form-group.reference-field-hidden {
    display: none;
}

/* Data Preview Styles */
#data-preview {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    margin-top: 20px;
}

#data-preview h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

#preview-table-container {
    overflow-x: auto;
    max-height: 400px;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
}

/* Compact table styles for import preview */
.preview-table.compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.2;
}

.preview-table.compact-table th,
.preview-table.compact-table td {
    padding: 6px 8px;
    border: 1px solid var(--border-primary);
    text-align: left;
    vertical-align: middle;
}

.preview-table.compact-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.preview-table.compact-table td {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.preview-table.compact-table tr:hover td {
    background: var(--bg-hover);
}

.preview-table.compact-table input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Select all checkbox styling */
.preview-table.compact-table th:first-child {
    width: 40px;
    text-align: center;
}

.preview-table.compact-table td:first-child {
    width: 40px;
    text-align: center;
}

/* Table controls styling */
.table-controls {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Table controls use unified button styles */

/* Group Creation Form Styles */
.group-form {
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--shadow-light);
    margin: 20px 0;
    border: 2px solid var(--primary-color);
}

.group-form h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 1.5em;
}

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

.group-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Responsive adjustments for group interface */
@media (max-width: 768px) {
    .group-selection {
        flex-direction: column;
        align-items: stretch;
    }
    
    #group-selector {
        min-width: auto;
    }
    
    .contacts-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .import-methods {
        grid-template-columns: 1fr;
    }
    
    .import-card form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Group Update Interface Styles */
.group-update-interface {
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--shadow-light);
    margin: 20px 0;
    border: 2px solid var(--primary-color);
}

.group-update-interface h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 1.5em;
}

.update-info {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-primary);
}

.update-info p {
    margin: 5px 0;
    color: var(--text-primary);
}

.update-mode-selection {
    margin-bottom: 25px;
}

.update-mode-selection h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 1.2em;
}

.update-mode-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.update-mode-option {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.update-mode-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.update-mode-option input[type="radio"] {
    margin-right: 15px;
    margin-top: 2px;
}

.mode-description {
    flex: 1;
}

.mode-description strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.1em;
    margin-bottom: 5px;
}

.mode-description small {
    color: var(--text-secondary);
    line-height: 1.4;
}

.csv-upload-section {
    margin-top: 25px;
}

.csv-upload-section h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 1.2em;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Update Preview Styles */
.update-preview {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    margin-top: 20px;
}

.update-preview h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

.preview-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-item {
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-primary);
    text-align: center;
}

.summary-item.warning {
    border-color: #ff9800;
    background: #fff3e0;
    color: #e65100;
}

.conflicts-section {
    margin: 20px 0;
    padding: 15px;
    background: #fff3e0;
    border: 1px solid #ff9800;
    border-radius: 6px;
}

.conflicts-section h5 {
    margin: 0 0 10px 0;
    color: #e65100;
}

.conflicts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conflict-item {
    padding: 8px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #ffcc80;
}

.preview-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Template Preview Modal Styles */
.template-preview-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-primary);
}

.template-preview-header h3 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 1.4em;
}

.template-preview-group {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9em;
    font-style: italic;
}

.template-preview-content {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.template-preview-content #template-preview-message {
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.template-preview-attachments {
    margin-bottom: 20px;
}

.template-preview-attachments h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 1.1em;
}

.attachment-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.attachment-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.attachment-thumbnail:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.attachment-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.attachment-list li {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-size: 0.9em;
}

.template-preview-actions {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-primary);
}
