/* Bulk SMS Custom Styles */

/* Customer Selection List */
.customer-selection-list {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    max-height: 250px;
    overflow-y: auto;
}

/* Responsive multi-column layout for customer list */
#customer_column_left,
#customer_column_center,
#customer_column_right {
    height: 330px;
    overflow-y: auto;
    padding: 0 8px;
}

#customer_column_left {
    border-right: 1px solid #e9ecef;
}

#customer_column_center {
    border-right: 1px solid #e9ecef;
}

/* New customer card styling */
.customer-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.customer-card:hover {
    border-color: #4e73df;
    box-shadow: 0 2px 8px rgba(78, 115, 223, 0.15);
}

.customer-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.customer-main {
    flex: 1;
    min-width: 0; /* Allows text truncation */
}

.customer-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-mobile {
    color: #718096;
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.customer-shop {
    color: #4299e1;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-badge {
    margin-left: 8px;
    flex-shrink: 0;
}

.customer-badge .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
}

/* Custom scrollbar for columns */
#customer_column_left::-webkit-scrollbar,
#customer_column_right::-webkit-scrollbar {
    width: 4px;
}

#customer_column_left::-webkit-scrollbar-track,
#customer_column_right::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

#customer_column_left::-webkit-scrollbar-thumb,
#customer_column_right::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

#customer_column_left::-webkit-scrollbar-thumb:hover,
#customer_column_right::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.customer-item {
    transition: all 0.2s ease;
    padding: 0px 10px;
}

.customer-item:hover {
    background-color: #f8f9fa;
}

.customer-item .form-check {
    margin-bottom: 0;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
}

.customer-item .form-check:last-child {
    border-bottom: none;
}

.customer-item .form-check:hover {
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

.customer-item .form-check-input {
    margin-top: 0.2rem;
    transform: scale(1.1);
}

.customer-item .form-check-input:checked {
    background-color: #4e73df;
    border-color: #4e73df;
}

.customer-item .form-check-label {
    margin-left: 0.5rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.customer-item .form-check-input:checked + .form-check-label {
    color: #2e59d9;
    font-weight: 500;
}

.customer-item .badge {
    font-size: 0.7rem;
}

/* Custom scrollbar for customer list */
.customer-selection-list::-webkit-scrollbar {
    width: 6px;
}

.customer-selection-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.customer-selection-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.customer-selection-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.message-preview {
    max-height: 60px;
    overflow-y: auto;
    word-wrap: break-word;
}

.sms-card {
    border: 1px solid #e3e6f0;
    border-radius: 0.35rem;
    transition: all 0.3s ease;
}

.sms-card:hover {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.recipient-type-card {
    border: 2px solid #e3e6f0;
    transition: all 0.3s ease;
}

.recipient-type-card.active {
    border-color: #4e73df;
    background-color: #f8f9fc;
}

.form-check-input:checked + .form-check-label {
    font-weight: 600;
    color: #4e73df;
}

.customer-select {
    max-height: 200px;
    overflow-y: auto;
}

.customer-select option:checked {
    background-color: #4e73df;
    color: white;
}

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

.sms-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.character-counter {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.filter-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.manual-section {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.375rem;
    padding: 1rem;
}

.recipient-counter {
    display: inline-block;
    background: #4e73df;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
}

.sms-status-badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.progress-sm {
    height: 0.5rem;
}

/* Success Rate Colors */
.success-rate-excellent {
    color: #1cc88a;
}

.success-rate-good {
    color: #f6c23e;
}

.success-rate-poor {
    color: #e74a3b;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .customer-select {
        max-height: 150px;
    }

    /* Single column layout on mobile */
    #customer_column_left,
    #customer_column_center,
    #customer_column_right {
        border-right: none;
        padding: 0 5px;
        height: auto;
        max-height: 250px;
    }

    .customer-selection-list {
        max-height: 400px;
    }

    .customer-card {
        margin-bottom: 6px;
    }

    .customer-name {
        font-size: 0.8rem;
    }

    .customer-mobile,
    .customer-shop {
        font-size: 0.7rem;
    }

    .sms-preview-card .col-md-6 {
        margin-bottom: 1rem;
    }

    .btn-group-vertical {
        width: 100%;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}/* Animation for loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4e73df;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Custom scrollbar for select elements */
.customer-select::-webkit-scrollbar {
    width: 8px;
}

.customer-select::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.customer-select::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.customer-select::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

.toast {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast-success {
    border-left: 4px solid #1cc88a;
}

.toast-error {
    border-left: 4px solid #e74a3b;
}

.toast-warning {
    border-left: 4px solid #f6c23e;
}

.toast-info {
    border-left: 4px solid #36b9cc;
}

/* SMS Message Bubble */
.sms-bubble {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 18px;
    padding: 12px 16px;
    margin: 8px 0;
    position: relative;
    max-width: 300px;
}

.sms-bubble::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 16px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #e3f2fd;
}

/* Filter badges */
.filter-badge {
    display: inline-block;
    background: #4e73df;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    margin: 0.125rem;
}

.filter-badge .remove {
    margin-left: 0.5rem;
    cursor: pointer;
    font-weight: bold;
}

.filter-badge .remove:hover {
    color: #ff6b6b;
}

/* Confirmation modal styling */
.confirmation-modal .modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.confirmation-modal .modal-header {
    border-bottom: 1px solid #e3e6f0;
    padding: 1.5rem;
}

.confirmation-modal .modal-body {
    padding: 1.5rem;
}

.confirmation-modal .modal-footer {
    border-top: 1px solid #e3e6f0;
    padding: 1.5rem;
}

/* Statistics cards hover effect */
.stats-card {
    transition: transform 0.2s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Table row highlighting */
.table tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
}

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Tablet responsive */
@media (min-width: 768px) and (max-width: 991.98px) {
    #customer_column_left,
    #customer_column_center {
        height: 320px;
    }

    #customer_column_center {
        border-right: none;
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    .customer-selection-list {
        height: 400px;
    }

    #customer_column_left,
    #customer_column_center,
    #customer_column_right {
        height: 380px;
    }
}
