/* ==============================================
   LK-Call Dashboard - Campaign Management Styles
   ============================================== */

/* ================== TIPS AND GUIDANCE SECTIONS ================== */
.column-mapping-tips {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.column-mapping-tips h4 {
    margin: 0 0 10px 0;
    color: #0066cc;
}

.column-mapping-tips ul {
    margin: 0;
    padding-left: 20px;
    color: #0066cc;
    font-size: 13px;
    line-height: 1.5;
}

/* ================== COLUMN MAPPING ================== */
.column-mapping-select option[value^="variable:"] {
    background: #e8f5e8;
    color: #28a745;
    font-weight: 500;
}

.column-mapping-select optgroup[label="Prompt Variables"] {
    background: #f8f9fa;
    font-style: normal;
    font-weight: 600;
}
.column-mapping-headers {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    font-weight: 600;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.column-mapping-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.column-mapping-row.suggested-phone-row {
    background: #e8f5e8;
    border: 1px solid #28a745;
}

.column-mapping-row.normal-row {
    background: white;
    border: 1px solid #dee2e6;
}

.column-mapping-header {
    font-weight: 500;
    color: #333;
}

.column-mapping-suggestion {
    color: #28a745;
    font-size: 11px;
    margin-left: 5px;
}

.column-mapping-sample {
    color: #666;
    font-size: 13px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
}

.column-mapping-select {
    width: 100%;
    padding: 6px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.column-mapping-summary {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

/* ================== VALIDATION ERRORS ================== */
.validation-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
}

/* ================== DATA PREVIEW ================== */
.data-preview-empty {
    text-align: center;
    padding: 20px;
    color: #666;
}

.data-preview-phone-info {
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

.data-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-preview-table thead {
    background: #e9ecef;
}

.data-preview-table th {
    padding: 8px;
    text-align: left;
    border: 1px solid #dee2e6;
}

.data-preview-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
}

/* ================== CAMPAIGNS LIST ================== */
.campaigns-empty {
    padding: 40px;
    color: #666;
    text-align: center;
}

.campaigns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

/* Responsive grid - 5-6 columns on very wide screens */
@media (min-width: 2000px) {
    .campaigns-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 5 columns on wide screens */
@media (min-width: 1600px) and (max-width: 1999px) {
    .campaigns-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 4 columns on medium-wide screens */
@media (min-width: 1200px) and (max-width: 1599px) {
    .campaigns-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 3 columns on medium screens */
@media (min-width: 900px) and (max-width: 1199px) {
    .campaigns-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 2 columns on small-medium screens */
@media (min-width: 600px) and (max-width: 899px) {
    .campaigns-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Single column on small screens */
@media (max-width: 599px) {
    .campaigns-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile improvements for campaign card buttons */
@media (max-width: 768px) {
    .campaign-card-actions .btn {
        font-size: 12px;
        padding: 6px 10px;
        min-width: 60px;
    }
}

.campaign-card {
    padding: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 160px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.campaign-card.clickable-card {
    cursor: pointer;
    position: relative;
}

.campaign-card.clickable-card::after {
    content: "Click to view analytics";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    color: #666;
    opacity: 0;
    transition: opacity 0.2s;
    background: rgba(255,255,255,0.8);
    padding: 2px 6px;
    border-radius: 3px;
}

.campaign-card.clickable-card:hover::after {
    opacity: 1;
}

.campaign-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    filter: brightness(0.98);
}

/* Specific hover adjustments for colored backgrounds */
.campaign-card.campaign-status-paused:hover {
    background-color: #ffef99 !important; /* Slightly darker yellow on hover */
}

.campaign-card.campaign-status-completed:hover {
    background-color: #d4f4dd !important; /* Slightly darker green on hover */
}

.campaign-card.campaign-status-in-progress:hover {
    background-color: #d4e8ff !important; /* Slightly darker blue on hover */
}

.campaign-card.campaign-status-stopped:hover,
.campaign-card.campaign-status-failed:hover {
    background-color: #ffd4d4 !important; /* Slightly darker red on hover */
}

.campaign-card-header {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
}

.campaign-card-content {
    flex: 1;
    min-height: 0;
}

.campaign-card-title {
    margin: 0 0 6px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.campaign-card-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.campaign-stat-contacts {
    color: #666;
    font-size: 14px;
}

/* Removed conflicting styles - now using styles from styles.css */

.campaign-card-meta {
    color: #999;
    font-size: 12px;
    line-height: 1.4;
    margin-top: auto;
}

.campaign-card-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    background: none !important;
    padding: 6px 0 0 0;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.campaign-card-actions .btn {
    padding: 5px 8px;
    font-size: 11px;
    flex: 0 0 auto;
}

.campaign-card-actions .campaign-actions {
    background: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* ================== DROPDOWN MENUS ================== */
.campaign-dropdown {
    position: relative;
    display: inline-block;
}

.campaign-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 1000;
    border: 1px solid #ddd;
}

.campaign-dropdown-link {
    color: #333;
    padding: 8px 12px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    font-size: 13px;
}

.campaign-dropdown-link.danger {
    color: #dc3545;
}

.campaign-dropdown-link.disabled {
    color: #999;
}

.campaign-dropdown-divider {
    margin: 4px 0;
    border: none;
    border-top: 1px solid #eee;
}

/* ================== CAMPAIGN DETAILS MODAL ================== */
.campaign-modal-section {
    margin-top: 25px;
}

.campaign-modal-section-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

.campaign-prompt-section {
    margin-bottom: 20px;
}

.campaign-prompt-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #555;
}

.campaign-prompt-content {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    max-height: 120px;
    overflow-y: auto;
}

.campaign-prompt-content.main-prompt {
    border-left: 4px solid #007bff;
}

.campaign-prompt-content.evaluation-prompt {
    border-left: 4px solid #28a745;
}

.campaign-prompt-content.intro-text {
    border-left: 4px solid #ffc107;
    max-height: 100px;
}

.campaign-prompt-content.error-text {
    border-left: 4px solid #dc3545;
    max-height: 100px;
}

.campaign-prompt-text {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.campaign-text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.campaign-column-mapping {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.campaign-column-mapping-item {
    margin-bottom: 5px;
    font-size: 13px;
}

.campaign-column-name {
    color: #666;
}

.campaign-column-type {
    color: #007bff;
    font-weight: 500;
}

.campaign-modal-actions {
    margin-top: 25px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.campaign-sheet-link {
    color: #007bff;
}

/* ================== CONTACTS MODAL ================== */
.contacts-modal-summary {
    margin-bottom: 20px;
}

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

.contacts-modal-title {
    margin: 0;
    color: #333;
}

.contacts-modal-count {
    color: #666;
}

.contacts-modal-controls {
    display: flex;
    gap: 10px;
}

.contacts-status-filter {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.contacts-export-btn {
    font-size: 12px;
}

.contacts-status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.contacts-status-card {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.contacts-status-card.pending {
    border-left: 4px solid #6c757d;
}

.contacts-status-card.in-progress {
    border-left: 4px solid #007bff;
}

.contacts-status-card.completed {
    border-left: 4px solid #28a745;
}

.contacts-status-card.failed {
    border-left: 4px solid #dc3545;
}

.contacts-status-number {
    font-size: 18px;
    font-weight: 600;
}

.contacts-status-number.pending {
    color: #6c757d;
}

.contacts-status-number.in-progress {
    color: #007bff;
}

.contacts-status-number.completed {
    color: #28a745;
}

.contacts-status-number.failed {
    color: #dc3545;
}

.contacts-status-label {
    font-size: 12px;
    color: #666;
}

.contacts-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.contacts-modal-actions {
    margin-top: 20px;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* ================== EDIT CAMPAIGN MODAL ================== */
.edit-campaign-form {
    display: grid;
    gap: 20px;
}

.edit-campaign-section-title {
    margin: 0 0 15px 0;
    color: #333;
    padding-bottom: 5px;
}

.edit-campaign-section-title.basic-info {
    border-bottom: 2px solid #007bff;
}

.edit-campaign-section-title.ai-config {
    border-bottom: 2px solid #28a745;
}

.edit-campaign-section-title.data-source {
    border-bottom: 2px solid #ffc107;
}

.edit-campaign-field {
    margin-bottom: 15px;
}

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

.edit-campaign-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.edit-campaign-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.edit-campaign-text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.edit-campaign-data-notice {
    background: #fff3cd;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
}

.edit-campaign-sheet-info {
    margin-bottom: 10px;
}

.edit-campaign-sheet-link {
    color: #007bff;
    word-break: break-all;
}

.edit-campaign-notice-text {
    color: #856404;
    font-size: 13px;
}

.edit-campaign-actions {
    margin-top: 25px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ================== CONTACTS TABLE ================== */
.contacts-empty-state {
    padding: 40px;
    text-align: center;
    color: #666;
}

.contacts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.contacts-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
}

.contacts-table th {
    padding: 10px;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.contacts-table th.left-align {
    text-align: left;
}

.contacts-table th.center-align {
    text-align: center;
}

.contacts-table tr {
    border-bottom: 1px solid #dee2e6;
}

.contacts-table td {
    padding: 10px;
}

.contacts-table td.center-align {
    text-align: center;
}

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

.contact-id {
    color: #666;
}

.contact-address {
    color: #666;
}

.contact-phone {
    font-family: monospace;
    color: #007bff;
}

.contact-verification {
    color: #666;
}

.contact-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}

/* ================== BUTTON EXTENSIONS ================== */
.btn-margin-right {
    margin-right: 10px;
}

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

/* ================== UTILITY CLASSES ================== */
.margin-top-25 {
    margin-top: 25px;
}

.margin-bottom-15 {
    margin-bottom: 15px;
}

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

.text-center {
    text-align: center;
}

.font-weight-500 {
    font-weight: 500;
}

.font-weight-600 {
    font-weight: 600;
}

.color-333 {
    color: #333;
}

.color-555 {
    color: #555;
}

.color-666 {
    color: #666;
}

.color-999 {
    color: #999;
}

.border-top-eee {
    border-top: 1px solid #eee;
}

.padding-top-15 {
    padding-top: 15px;
}

.padding-top-20 {
    padding-top: 20px;
}

/* Campaign Export Modal Styles */
.campaign-export-modal {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.campaign-export-content {
    background: white;
    margin: 40px auto;
    max-width: 700px;
    width: 90%;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.campaign-export-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.campaign-export-title {
    margin: 0;
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.campaign-export-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.campaign-export-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.campaign-export-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.campaign-export-description {
    margin: 0 0 20px 0;
    color: #6b7280;
    font-size: 14px;
}

.campaign-export-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.campaign-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.campaign-export-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.campaign-export-btn svg {
    width: 16px;
    height: 16px;
}

.campaign-export-btn-primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.campaign-export-btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.campaign-export-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.campaign-export-category {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    background: #ffffff;
}

.campaign-export-category-highlight {
    border-color: #3b82f6;
    background: #eff6ff;
}

.campaign-export-category-title {
    margin: 0 0 12px 0;
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.campaign-export-category-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
}

.campaign-export-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.campaign-export-field-single {
    grid-template-columns: 1fr;
}

.campaign-export-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.campaign-export-field-label:hover {
    background: #f9fafb;
}

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

.campaign-export-field-name {
    font-size: 13px;
    color: #374151;
}

.campaign-export-field-highlight {
    color: #2563eb;
    font-weight: 500;
}

.campaign-export-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.campaign-export-count {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.campaign-export-footer-buttons {
    display: flex;
    gap: 12px;
}

.campaign-export-btn-cancel {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.campaign-export-btn-cancel:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.campaign-export-btn-export {
    background: #f97316;
    color: white;
    border-color: #f97316;
    padding: 10px 20px;
    font-weight: 600;
}

.campaign-export-btn-export:hover {
    background: #ea580c;
    border-color: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}