* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Bulk Import Styles */
.bulk-add-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.bulk-tab-btn {
    padding: 8px 16px;
    border: none;
    background: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.bulk-tab-btn:hover {
    color: #495057;
}

.bulk-tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.bulk-tab-content {
    display: none;
}

.bulk-tab-content.active {
    display: block;
}

.csv-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.csv-upload-area:hover {
    border-color: #007bff;
    background: #e7f3ff;
}

.csv-upload-area.dragging {
    border-color: #28a745;
    background: #d4edda;
}

.bulk-import-options {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.recipient-lists-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.recipient-lists-checkboxes label {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.recipient-lists-checkboxes label:hover {
    background: #e9ecef;
}

.recipient-lists-checkboxes input[type="checkbox"] {
    margin-right: 5px;
}

/* Styled Select Dropdown */
.styled-select {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    font-family: inherit;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.styled-select:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.styled-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.styled-select option {
    padding: 10px;
    background: white;
    color: #333;
}

.styled-select option:hover {
    background-color: #f8f9fa;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

/* Enhanced Message History Styles */
.message-history-item {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: box-shadow 0.2s;
}

.message-history-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.message-time {
    font-size: 13px;
    color: #6c757d;
}

.message-content {
    font-size: 15px;
    color: #212529;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.recipient-details {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
    font-size: 14px;
}

.recipient-count {
    color: #007bff;
}

.success-count {
    color: #28a745;
}

.failed-count {
    color: #dc3545;
}

.recipient-names {
    color: #6c757d;
    font-style: italic;
    margin-left: 20px;
}

.list-info {
    margin-top: 5px;
    color: #6f42c1;
    font-size: 14px;
}

/* Large Group Message Display */
.large-group-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.show-failed-btn {
    padding: 4px 10px;
    background: #fff5f5;
    color: #dc3545;
    border: 1px solid #f5c2c7;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.show-failed-btn:hover {
    background: #f8d7da;
    border-color: #f1aeb5;
}

.failed-recipients-list {
    margin-top: 10px;
    padding: 10px;
    background: #fff5f5;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.failed-header {
    font-weight: 600;
    color: #dc3545;
    margin-bottom: 8px;
    font-size: 13px;
}

.failed-recipient {
    display: flex;
    justify-content: space-between;
    padding: 5px;
    margin: 3px 0;
    background: white;
    border-radius: 3px;
    font-size: 12px;
}

.failed-phone {
    color: #6c757d;
    font-family: monospace;
}

/* Recipient Message History in Modal */
.recipient-message-history {
    max-height: 250px;
    overflow-y: auto;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
}

.message-history-scroll {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recipient-msg-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
    transition: box-shadow 0.2s;
}

.recipient-msg-item:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.msg-date {
    color: #6c757d;
    font-weight: 500;
}

.status-sent {
    color: #28a745;
    font-weight: 600;
}

.status-failed {
    color: #dc3545;
    font-weight: 600;
}

.msg-content {
    background: #f1f3f5;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    color: #212529;
    word-wrap: break-word;
}

.msg-error {
    margin-top: 5px;
    padding: 5px;
    background: #fff5f5;
    border-left: 3px solid #dc3545;
    color: #dc3545;
    font-size: 12px;
    border-radius: 2px;
}

.no-messages {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-style: italic;
}

.error-text {
    color: #dc3545;
    text-align: center;
    padding: 10px;
}

.loading-text {
    text-align: center;
    color: #6c757d;
    padding: 10px;
    font-style: italic;
}

/* Search Bar Styles */
.search-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input::placeholder {
    color: #6c757d;
}

.search-count {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.no-results p {
    margin-bottom: 15px;
    font-size: 16px;
}

.list-badge {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px;
    background: #e7f3ff;
    color: #007bff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

h1 {
    color: #333;
    text-align: center;
}

.logout-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    padding: 8px 16px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #cc0000;
}

.tabs {
    background: white;
    display: flex;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #f5f5f5;
}

.tab-button.active {
    border-bottom-color: #667eea;
    color: #667eea;
    font-weight: bold;
}

.tab-content {
    display: none;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 0 0 10px 10px;
}

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

.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

.char-count {
    text-align: right;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.recipient-selection {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.recipient-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
}

.recipient-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
}

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

.recipient-item input[type="checkbox"] {
    margin-right: 10px;
}

.recipient-item label {
    margin: 0;
    font-weight: normal;
    flex: 1;
    cursor: pointer;
}

.send-options, .send-to-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.send-options label, .send-to-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

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

.selected-count {
    margin-left: auto;
    color: #667eea;
    font-weight: 600;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.form-row input {
    flex: 1;
}

.bulk-add-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

h2 {
    color: #333;
    margin-bottom: 20px;
}

h3 {
    color: #555;
    margin-bottom: 15px;
}

.recipients-table {
    width: 100%;
    border-collapse: collapse;
}

.recipients-table th,
.recipients-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.recipients-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.delete-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.delete-btn:hover {
    background: #cc0000;
}

.message-history-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

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

.message-time {
    color: #999;
    font-size: 12px;
}

.message-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.message-status.completed {
    background: #4caf50;
    color: white;
}

.message-status.scheduled {
    background: #ff9800;
    color: white;
}

.message-status.sending {
    background: #2196f3;
    color: white;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 600;
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

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

.notification.error {
    background: #ff4444;
}

.notification.info {
    background: #2196f3;
}

.info-text {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    font-style: italic;
}

.lists-table {
    width: 100%;
    border-collapse: collapse;
}

.lists-table th,
.lists-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.lists-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.list-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #e0e7ff;
    color: #4c51bf;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 3px;
}

.selected-lists-count {
    margin-left: auto;
    color: #667eea;
    font-weight: 600;
}

.manage-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
}

.manage-btn:hover {
    background: #5a67d8;
}

.recipient-row {
    cursor: pointer;
    transition: background 0.2s;
}

.recipient-row:hover {
    background: #f9f9f9;
}

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

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

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

.modal-header h3 {
    margin: 0;
    color: #333;
}

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

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

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-body label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.modal-body input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

.btn-secondary {
    padding: 10px 20px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

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

.btn-primary {
    padding: 10px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

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

.edit-btn {
    padding: 4px 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
}

.edit-btn:hover {
    background: #45a049;
}

/* Recipient lists in edit modal */
.recipient-lists-container {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: #f9f9f9;
}

.recipient-lists-container .loading-text {
    color: #666;
    font-style: italic;
}

.recipient-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin: 4px 0;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.recipient-list-item:hover {
    background: #f0f0f0;
}

.recipient-list-name {
    font-weight: 500;
    color: #333;
}

.remove-from-list-btn {
    padding: 4px 8px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.remove-from-list-btn:hover {
    background: #d32f2f;
}

.no-lists-message {
    color: #999;
    font-style: italic;
    padding: 10px;
    text-align: center;
}