/* Contact Lists & Blasting Campaigns Styles - Table Layout */

/* Table Container */
.table-container {
    background: var(--card-bg, white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
    overflow: hidden;
    margin-top: 24px;
    transition: background-color 0.3s ease;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
}

.table-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--heading-color, #111827);
}

.table-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid var(--input-border, #D1D5DB);
    border-radius: 6px;
    font-size: 14px;
    width: 250px;
    background: var(--input-bg, white);
    color: var(--text-primary, #111827);
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary, #6366F1);
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-tertiary, #F9FAFB);
    border-bottom: 2px solid var(--border-color, #E5E7EB);
}

.data-table th {
    text-align: left;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary, #6B7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.data-table th:hover {
    background: var(--bg-tertiary, #F3F4F6);
}

.data-table th.sortable {
    position: relative;
    padding-right: 32px;
}

.data-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 12px;
    opacity: 0.3;
}

.data-table th.sorted-asc::after {
    content: '↑';
    opacity: 1;
}

.data-table th.sorted-desc::after {
    content: '↓';
    opacity: 1;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color, #E5E7EB);
    transition: background-color 0.15s;
}

.data-table tbody tr:hover {
    background: var(--table-row-hover, #F9FAFB);
}

.data-table td {
    padding: 16px 24px;
    font-size: 14px;
    color: var(--text-primary, #374151);
}

.data-table td.actions {
    white-space: nowrap;
}

.table-actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Table Cell Styles */
.cell-name {
    font-weight: 500;
    color: var(--heading-color, #111827);
}

.cell-subtitle {
    font-size: 12px;
    color: var(--text-tertiary, #9CA3AF);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cell-type {
    font-size: 14px;
    color: var(--text-primary, #374151);
}

.cell-count {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cell-count i {
    width: 14px;
    height: 14px;
    color: var(--text-secondary, #6B7280);
}

.cell-date {
    color: var(--text-secondary, #6B7280);
    font-size: 13px;
}

.cell-progress {
    min-width: 120px;
}

.progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-bar-mini {
    width: 100%;
    height: 6px;
    background: var(--border-color, #E5E7EB);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, #6366F1, #8B5CF6);
    transition: width 0.3s ease;
}

.progress-text-mini {
    font-size: 12px;
    color: var(--text-secondary, #6B7280);
}

.cell-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.stat-mini {
    display: flex;
    flex-direction: column;
}

.stat-mini-label {
    color: #9CA3AF;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-mini-value {
    color: var(--heading-color, #111827);
    font-weight: 600;
    font-size: 14px;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-draft {
    background: #F3F4F6;
    color: #6B7280;
}

.status-draft::before {
    background: #9CA3AF;
}

.status-scheduled {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-scheduled::before {
    background: #3B82F6;
}

.status-queued {
    background: #FEF3C7;
    color: #92400E;
}

.status-queued::before {
    background: #F59E0B;
}

.status-sending {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-sending::before {
    background: #3B82F6;
    animation: pulse 2s infinite;
}

.status-completed {
    background: #D1FAE5;
    color: #065F46;
}

.status-completed::before {
    background: #10B981;
}

.status-failed {
    background: #FEE2E2;
    color: #991B1B;
}

.status-failed::before {
    background: #EF4444;
}

.status-paused {
    background: #FEF3C7;
    color: #92400E;
}

.status-paused::before {
    background: #F59E0B;
}

.status-cancelled {
    background: #F3F4F6;
    color: #6B7280;
}

.status-cancelled::before {
    background: #9CA3AF;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.empty-state i {
    width: 64px;
    height: 64px;
    color: var(--text-tertiary, #D1D5DB);
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: var(--heading-color, #111827);
}

.empty-state p {
    margin: 0 auto 24px;
    color: var(--text-secondary, #6B7280);
    max-width: 400px;
    line-height: 1.5;
}

/* Pagination */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color, #E5E7EB);
    font-size: 14px;
    color: var(--text-secondary, #6B7280);
}

.pagination {
    display: flex;
    gap: 8px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--border-color, #D1D5DB);
    background: var(--card-bg, white);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary, #111827);
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-tertiary, #F9FAFB);
    border-color: var(--accent-primary, #6366F1);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: var(--accent-primary, #6366F1);
    color: white;
    border-color: var(--accent-primary, #6366F1);
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color, #D1D5DB);
    background: var(--card-bg, white);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary, #111827);
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-tertiary, #F9FAFB);
    border-color: var(--accent-primary, #6366F1);
    color: var(--accent-primary, #6366F1);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn i {
    width: 16px;
    height: 16px;
}

.page-info {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 14px;
    color: var(--text-secondary, #6B7280);
}

.items-per-page {
    padding: 6px 10px;
    border: 1px solid var(--border-color, #D1D5DB);
    background: var(--card-bg, white);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary, #111827);
    cursor: pointer;
    margin-left: 8px;
}

.items-per-page:focus {
    outline: none;
    border-color: var(--accent-primary, #6366F1);
}

.table-info {
    font-size: 14px;
    color: var(--text-secondary, #6B7280);
}

/* Responsive pagination */
@media (max-width: 768px) {
    .table-footer {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-info {
        padding: 0 8px;
        font-size: 12px;
    }
    
    .items-per-page {
        font-size: 12px;
    }
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--modal-bg, white);
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transition: background-color 0.3s ease;
}

.modal-content h3 {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 600;
    color: var(--heading-color, #111827);
}

.modal-content .close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary, #6B7280);
    transition: color 0.2s;
}

.modal-content .close:hover {
    color: var(--text-primary, #111827);
}

/* Campaign Details Modal */
.details-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-section {
    background: var(--bg-tertiary, #F9FAFB);
    border-radius: 8px;
    padding: 20px;
}

.detail-section.full-width {
    grid-column: 1 / -1;
}

.detail-section h4 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--heading-color, #111827);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    color: var(--text-secondary, #6B7280);
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary, #111827);
    font-weight: 500;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stats-cards-single-line {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg, white);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #E5E7EB);
    transition: background-color 0.3s ease;
}

.stat-card-compact {
    background: var(--card-bg, white);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #E5E7EB);
    text-align: center;
    transition: background-color 0.3s ease;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-icon i {
    width: 20px;
    height: 20px;
}

.stat-card-content {
    flex: 1;
}

.stat-card-label {
    font-size: 11px;
    color: var(--text-secondary, #6B7280);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--heading-color, #111827);
}

.progress-section {
    background: var(--card-bg, white);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #E5E7EB);
    transition: background-color 0.3s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #374151);
}

.progress-percentage {
    font-size: 18px;
    font-weight: 700;
    color: #6366F1;
}

.progress-bar-large {
    width: 100%;
    height: 12px;
    background: var(--border-color, #E5E7EB);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill-large {
    height: 100%;
    background: linear-gradient(90deg, #6366F1, #8B5CF6);
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary, #6B7280);
}

/* WhatsApp-style Message Preview */
.whatsapp-preview-container {
    background: linear-gradient(to bottom, #e5ddd5 0%, #d9d0c9 100%);
    padding: 24px;
    border-radius: 12px;
    min-height: 150px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.whatsapp-bubble {
    background: #DCF8C6;
    border-radius: 8px;
    padding: 8px 12px;
    max-width: 65%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    word-wrap: break-word;
}

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

.whatsapp-media {
    margin: -8px -12px 8px -12px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.whatsapp-media img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.whatsapp-text {
    font-size: 14px;
    color: #303030;
    line-height: 1.5;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.whatsapp-time {
    text-align: right;
    font-size: 11px;
    color: #667781;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.whatsapp-time::after {
    content: '✓✓';
    color: #53bdeb;
    font-size: 14px;
    font-weight: bold;
}

/* Legacy message preview box (keep for backward compatibility) */
.message-preview-box {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: 8px;
    padding: 16px;
    white-space: pre-wrap;
    font-size: 14px;
    color: var(--text-primary, #374151);
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

.media-preview {
    margin-top: 16px;
    text-align: center;
}

.media-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #E5E7EB);
}

@media (max-width: 768px) {
    .whatsapp-bubble {
        max-width: 85%;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary, #374151);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--input-border, #D1D5DB);
    border-radius: 6px;
    font-size: 14px;
    background: var(--input-bg, white);
    color: var(--text-primary, #111827);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary, #6366F1);
}

/* Auto-expand textarea */
.auto-expand-textarea {
    resize: vertical;
    overflow-y: auto;
    min-height: 120px;
    max-height: 500px;
}

.auto-expand-textarea::-webkit-scrollbar {
    width: 6px;
}

.auto-expand-textarea::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.auto-expand-textarea::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.auto-expand-textarea::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary, #6B7280);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.large-modal {
    max-width: 700px;
}

.radio-group {
    display: flex;
    gap: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border: 2px solid var(--border-color, #D1D5DB);
    border-radius: 8px;
    transition: all 0.2s;
}

.radio-label:hover {
    border-color: var(--accent-primary, #6366F1);
    background: var(--bg-tertiary, #F9FAFB);
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
}

.radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #6366F1;
}

.message-preview {
    padding: 12px;
    background: var(--bg-tertiary, #F9FAFB);
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: 8px;
    min-height: 60px;
    white-space: pre-wrap;
    font-size: 14px;
    color: var(--text-primary, #374151);
}

.contacts-table-container {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

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

.contacts-table thead {
    position: sticky;
    top: 0;
    background: var(--card-bg, white);
    z-index: 1;
}

.contacts-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--border-color, #E5E7EB);
    font-weight: 600;
    color: var(--text-primary, #374151);
}

.contacts-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
    color: var(--text-primary, #374151);
}

.contacts-table tbody tr:hover {
    background: var(--table-row-hover, #F9FAFB);
}

.contact-actions {
    display: flex;
    gap: 8px;
}

#image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #E5E7EB);
}

/* Bulk Actions */
.bulk-actions {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--bg-tertiary, #F9FAFB);
    border-bottom: 1px solid var(--border-color, #E5E7EB);
}

.bulk-actions.show {
    display: flex;
}

.bulk-actions-text {
    font-size: 14px;
    color: var(--text-secondary, #6B7280);
    font-weight: 500;
}

.checkbox-cell {
    width: 40px;
}

.checkbox-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 1024px) {
    .table-header {
        /* Keep flex-direction: row to maintain title and search on same line */
        flex-wrap: wrap;
        gap: 12px;
    }

    .table-header h3 {
        flex: 1;
        min-width: 150px;
    }

    .table-actions {
        flex-shrink: 0;
    }

    .search-box input {
        width: 200px;
    }

    .cell-stats {
        flex-direction: column;
        gap: 4px;
    }

    .stats-cards-single-line {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .search-box input {
        width: 150px;
        font-size: 13px;
        padding: 6px 10px;
    }

    .table-header h3 {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 800px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 16px;
    }

    .large-modal {
        max-width: 95%;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .radio-group {
        flex-direction: column;
    }

    .contacts-table-container {
        overflow-x: auto;
    }

    .table-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
}

/* Button Loading State */
.btn-loading {
    background-color: #9CA3AF !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    pointer-events: none;
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Create Campaign Page Container */
.create-campaign-container {
    background: var(--card-bg, white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
    padding: 32px;
    max-width: 800px;
    margin: 0 auto;
    transition: background-color 0.3s ease;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color, #E5E7EB);
}

@media (max-width: 768px) {
    .create-campaign-container {
        padding: 24px 16px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions button {
        width: 100%;
    }
}

/* ========================================
   SKELETON LOADING STYLES
   ======================================== */

.campaigns-skeleton {
    animation: fadeIn 0.3s ease-in;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton-table-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 24px;
}

.skeleton-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.skeleton-title {
    width: 200px;
    height: 24px;
    background: linear-gradient(90deg, var(--skeleton-base) 0%, var(--skeleton-highlight) 50%, var(--skeleton-base) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 6px;
}

.skeleton-search {
    width: 250px;
    height: 36px;
    background: linear-gradient(90deg, var(--skeleton-base) 0%, var(--skeleton-highlight) 50%, var(--skeleton-base) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 6px;
}

.skeleton-table {
    width: 100%;
}

.skeleton-table-head {
    background: var(--table-header-bg);
    border-bottom: 2px solid var(--border-color);
}

.skeleton-table-head-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 1.5fr 1.5fr 1.5fr;
    gap: 16px;
    padding: 12px 24px;
}

.skeleton-th {
    height: 16px;
    background: linear-gradient(90deg, var(--skeleton-base) 0%, var(--skeleton-highlight) 50%, var(--skeleton-base) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 4px;
}

.skeleton-table-body {
    display: flex;
    flex-direction: column;
}

.skeleton-table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 1.5fr 1.5fr 1.5fr;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.skeleton-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-cell-main {
    height: 18px;
    background: linear-gradient(90deg, var(--skeleton-base) 0%, var(--skeleton-highlight) 50%, var(--skeleton-base) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 4px;
}

.skeleton-cell-sub {
    height: 14px;
    width: 70%;
    background: linear-gradient(90deg, var(--skeleton-base) 0%, var(--skeleton-highlight) 50%, var(--skeleton-base) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 4px;
}

.skeleton-badge {
    width: 80px;
    height: 22px;
    background: linear-gradient(90deg, var(--skeleton-base) 0%, var(--skeleton-highlight) 50%, var(--skeleton-base) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 12px;
}

.skeleton-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.skeleton-progress-bar {
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--skeleton-base) 0%, var(--skeleton-highlight) 50%, var(--skeleton-base) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 3px;
}

.skeleton-progress-text {
    width: 60%;
    height: 12px;
    background: linear-gradient(90deg, var(--skeleton-base) 0%, var(--skeleton-highlight) 50%, var(--skeleton-base) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 3px;
}

.skeleton-stats {
    display: flex;
    gap: 16px;
}

.skeleton-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.skeleton-stat-label {
    width: 40px;
    height: 10px;
    background: linear-gradient(90deg, var(--skeleton-base) 0%, var(--skeleton-highlight) 50%, var(--skeleton-base) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 3px;
}

.skeleton-stat-value {
    width: 30px;
    height: 16px;
    background: linear-gradient(90deg, var(--skeleton-base) 0%, var(--skeleton-highlight) 50%, var(--skeleton-base) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 3px;
}

.skeleton-actions {
    display: flex;
    gap: 8px;
}

.skeleton-action-btn {
    width: 32px;
    height: 32px;
    background: linear-gradient(90deg, var(--skeleton-base) 0%, var(--skeleton-highlight) 50%, var(--skeleton-base) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 6px;
}

/* Responsive Skeleton */
@media (max-width: 768px) {
    .skeleton-table-head-row,
    .skeleton-table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .skeleton-search {
        width: 150px;
        height: 32px;
    }
}


/* Interactive Blast Type Styles */
.interactive-options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-tertiary, #F9FAFB);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #E5E7EB);
}

.interactive-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.interactive-option label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #6B7280);
}

.interactive-option input {
    padding: 10px 12px;
    border: 1px solid var(--input-border, #D1D5DB);
    border-radius: 6px;
    font-size: 14px;
    background: var(--input-bg, white);
    color: var(--text-primary, #111827);
    transition: border-color 0.2s;
}

.interactive-option input:focus {
    outline: none;
    border-color: var(--accent-primary, #6366F1);
}

/* Interactive Title Input */
#interactive-title-group input {
    width: 100%;
}

/* Radio label for Interactive option */
.radio-label input[type="radio"][value="interactive"]:checked + span {
    color: #10B981;
}

@media (max-width: 768px) {
    .interactive-options-container {
        padding: 12px;
    }
}


/* Blast Type Card Options (similar to Message Delay) */
.blast-type-options {
    display: flex;
    gap: 12px;
}

.blast-type-option {
    flex: 1;
    cursor: pointer;
}

.blast-type-option input[type="radio"] {
    display: none;
}

.blast-type-card {
    padding: 12px 16px;
    border: 2px solid var(--border-color, #E5E7EB);
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--card-bg, white);
}

.blast-type-card:hover {
    border-color: var(--accent-primary, #6366F1);
    background: var(--bg-tertiary, #F9FAFB);
}

.blast-type-option input[type="radio"]:checked + .blast-type-card {
    border-color: var(--accent-primary, #6366F1);
    background: rgba(99, 102, 241, 0.05);
}

.blast-type-option input[type="radio"]:checked + .blast-type-card .blast-type-title {
    color: var(--accent-primary, #6366F1);
    font-weight: 600;
}

.blast-type-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #374151);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .blast-type-options {
        flex-direction: column;
    }
}


/* ========================================
   SCHEDULE CAMPAIGN STYLES
   ======================================== */

.schedule-section {
    background: var(--bg-tertiary, #F0F4FF);
    border: 2px solid var(--accent-primary, #6366F1);
    border-radius: 12px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
    overflow: visible;
    /* Extra padding at bottom for dropdown to show without scrolling */
    padding-bottom: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.schedule-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--accent-primary, #6366F1);
    color: white;
    font-weight: 600;
    font-size: 15px;
    border-radius: 10px 10px 0 0;
}

.schedule-header i {
    width: 20px;
    height: 20px;
}

.schedule-header span {
    flex: 1;
}

.schedule-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.schedule-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.schedule-close-btn i {
    width: 16px;
    height: 16px;
    color: white;
}

.schedule-content {
    padding: 20px;
    position: relative;
}

.schedule-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.schedule-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.schedule-field label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary, #374151);
}

.schedule-field input[type="date"] {
    padding: 10px 12px;
    border: 1px solid var(--input-border, #D1D5DB);
    border-radius: 6px;
    font-size: 14px;
    background: var(--input-bg, white);
    color: var(--text-primary, #111827);
    transition: border-color 0.2s;
    width: 100%;
    height: 42px;
    box-sizing: border-box;
}

.schedule-field input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-primary, #6366F1);
}

.schedule-field .custom-dropdown {
    width: 100%;
    position: relative;
}

.schedule-field .custom-dropdown .dropdown-trigger {
    height: 42px;
    box-sizing: border-box;
}

.schedule-field .custom-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #D1D5DB);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
}

/* Scrollbar styling for dropdown */
.schedule-field .custom-dropdown .dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.schedule-field .custom-dropdown .dropdown-menu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.schedule-field .custom-dropdown .dropdown-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.schedule-hint {
    display: block;
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary, #6B7280);
}

/* Disabled dropdown item */
.schedule-field .dropdown-item.disabled {
    color: var(--text-tertiary, #9CA3AF);
    cursor: not-allowed;
    font-style: italic;
    padding: 12px 16px;
}

.schedule-field .dropdown-item.disabled:hover {
    background: transparent;
}

/* Schedule button active state */
#schedule-btn.active {
    background: var(--accent-primary, #6366F1);
    color: white;
    border-color: var(--accent-primary, #6366F1);
}

#schedule-btn.active:hover {
    background: #5558E3;
}

@media (max-width: 768px) {
    .schedule-row {
        grid-template-columns: 1fr;
    }
    
    .schedule-content {
        padding: 16px;
    }
}

/* Scheduled time display in campaign list */
.scheduled-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--accent-primary, #6366F1);
    margin-top: 4px;
}

.scheduled-time i {
    width: 12px;
    height: 12px;
}
