/* ==============================================
   LK-Demo Dashboard - Main Styles
   ============================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui;
    background: #f5f5f5;
    padding: 20px;
}

/* Layout Components */
.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.center {
    text-align: center;
    padding: 20px;
}

.hidden {
    display: none;
}

/* ==================================================
   Minimal Export Modal Styles - Clean & Modern
   ================================================== */

/* Two Column Layout */
.minimal-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.minimal-column {
    display: flex;
    flex-direction: column;
}

.minimal-column-left {
    border-right: 1px solid #e5e7eb;
    padding-right: 24px;
}

.minimal-column-right {
    padding-left: 0;
}

.minimal-section {
    margin-bottom: 16px;
}

.minimal-section:last-of-type {
    margin-bottom: 0;
}

.minimal-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

/* Radio Group */
.minimal-radio-group {
    display: flex;
    gap: 16px;
}

.minimal-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.minimal-radio input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.minimal-radio-label {
    font-size: 14px;
    color: #4b5563;
}

/* Date Range */
.minimal-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.minimal-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.minimal-input:focus {
    outline: none;
    border-color: #6366f1;
}

.minimal-date-separator {
    color: #9ca3af;
    font-size: 14px;
}

.minimal-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Toggle Switches */
.minimal-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.minimal-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.minimal-toggle-label {
    font-size: 14px;
    color: #4b5563;
}

.minimal-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.minimal-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.minimal-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: background-color 0.2s;
    border-radius: 24px;
}

.minimal-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: transform 0.2s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.minimal-toggle input:checked + .minimal-toggle-slider {
    background-color: #111827;
}

.minimal-toggle input:checked + .minimal-toggle-slider:before {
    transform: translateX(20px);
}

.minimal-toggle:hover .minimal-toggle-slider {
    background-color: #9ca3af;
}

.minimal-toggle input:checked:hover + .minimal-toggle-slider {
    background-color: #374151;
}

/* Stats */
.minimal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    margin-top: auto;
}

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

.minimal-stat-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.minimal-stat-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Minimal Modal Base */
.minimal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.minimal-export-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Minimal Header */
.minimal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.minimal-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.minimal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
}

.minimal-close:hover {
    color: #111827;
}

/* Minimal Form */
.minimal-form {
    padding: 20px;
    overflow: hidden;
}

/* Two Column Layout */
.minimal-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.minimal-column {
    display: flex;
    flex-direction: column;
}

.minimal-column-left {
    border-right: 1px solid #e5e7eb;
    padding-right: 24px;
}

.minimal-column-right {
    padding-left: 0;
}

.minimal-section {
    margin-bottom: 16px;
}

.minimal-section:last-of-type {
    margin-bottom: 0;
}

.minimal-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

/* Radio Group */
.minimal-radio-group {
    display: flex;
    gap: 16px;
}

.minimal-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.minimal-radio input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.minimal-radio-label {
    font-size: 14px;
    color: #4b5563;
}

/* Date Range */
.minimal-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.minimal-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.minimal-input:focus {
    outline: none;
    border-color: #6366f1;
}

.minimal-date-separator {
    color: #9ca3af;
    font-size: 14px;
}

.minimal-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Dropdown */
.minimal-dropdown {
    position: relative;
}

.minimal-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.minimal-dropdown-trigger:hover {
    border-color: #9ca3af;
}

.minimal-dropdown.active .minimal-dropdown-trigger {
    border-color: #111827;
}

.minimal-dropdown.active .minimal-dropdown-trigger svg {
    transform: rotate(180deg);
}

.minimal-dropdown-trigger span {
    font-size: 14px;
    color: #374151;
}

.minimal-dropdown-trigger svg {
    transition: transform 0.2s;
    color: #6b7280;
}

.minimal-dropdown-content {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    max-height: 280px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.minimal-dropdown-search {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.minimal-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.minimal-search-input:focus {
    outline: none;
    border-color: #111827;
}

.minimal-dropdown-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.minimal-dropdown-btn {
    flex: 1;
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.minimal-dropdown-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.minimal-dropdown-btn:active {
    background: #f3f4f6;
}

.minimal-dropdown-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    max-height: 200px;
    overscroll-behavior: contain;
}

.minimal-dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.minimal-dropdown-item:hover {
    background: #f9fafb;
}

.minimal-dropdown-item input[type="checkbox"] {
    margin-right: 12px;
}

.minimal-campaign-name {
    flex: 1;
    font-size: 14px;
    color: #374151;
}

.minimal-campaign-info {
    font-size: 12px;
    color: #9ca3af;
}

.minimal-field-name {
    flex: 1;
    font-size: 14px;
    color: #374151;
}

.minimal-empty {
    padding: 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* Toggle Switches */
.minimal-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.minimal-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.minimal-toggle-label {
    font-size: 14px;
    color: #4b5563;
}

.minimal-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.minimal-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.minimal-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: background-color 0.2s;
    border-radius: 24px;
}

.minimal-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: transform 0.2s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.minimal-toggle input:checked + .minimal-toggle-slider {
    background-color: #111827;
}

.minimal-toggle input:checked + .minimal-toggle-slider:before {
    transform: translateX(20px);
}

.minimal-toggle:hover .minimal-toggle-slider {
    background-color: #9ca3af;
}

.minimal-toggle input:checked:hover + .minimal-toggle-slider {
    background-color: #374151;
}

/* Stats */
.minimal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    margin-top: auto;
}

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

.minimal-stat-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.minimal-stat-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Action Buttons */
.minimal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.minimal-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    position: relative;
    overflow: hidden;
}

.minimal-btn-primary {
    background: #fd7e14;
}

.minimal-btn-primary:hover {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.minimal-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

.minimal-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.minimal-btn-primary:hover::before {
    left: 100%;
}

.minimal-btn-secondary {
    background: #6c757d;
    color: white;
}

.minimal-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.minimal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Progress */
.minimal-progress {
    padding: 24px;
    text-align: center;
}

.minimal-progress-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.minimal-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #111827;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.minimal-spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

.minimal-progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.minimal-progress-fill {
    height: 100%;
    background: #111827;
    transition: width 0.3s ease;
}

/* Toast Notifications */
.minimal-toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    margin-bottom: 12px;
    animation: slideInRight 0.3s ease;
}

.minimal-toast-success {
    border-left: 4px solid #10b981;
}

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

.minimal-toast-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.minimal-toast-content strong {
    font-size: 14px;
    color: #111827;
}

.minimal-toast-content span {
    font-size: 13px;
    color: #6b7280;
}

.minimal-toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 0 0 12px;
}

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

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

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

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

/* Scrollbar Styling */
.minimal-export-modal::-webkit-scrollbar,
.minimal-campaign-list::-webkit-scrollbar {
    width: 6px;
}

.minimal-export-modal::-webkit-scrollbar-track,
.minimal-campaign-list::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.minimal-export-modal::-webkit-scrollbar-thumb,
.minimal-campaign-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.minimal-export-modal::-webkit-scrollbar-thumb:hover,
.minimal-campaign-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive */
@media (max-width: 768px) {
    .minimal-export-modal {
        width: 95%;
        max-height: 95vh;
        max-width: 95%;
    }
    
    .minimal-two-column {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .minimal-column-left {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 16px;
    }
    
    .minimal-column-right {
        padding-left: 0;
    }
    
    .minimal-date-range {
        flex-direction: column;
        gap: 12px;
    }
    
    .minimal-date-separator {
        display: none;
    }
    
    .minimal-stats {
        grid-template-columns: repeat(3, 1fr);
        margin-top: 16px;
    }
    
    .minimal-radio-group {
        flex-direction: column;
        gap: 12px;
    }
}

/* Field Selector Button */
.minimal-field-selector-btn {
    width: 100%;
    padding: 10px 12px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.minimal-field-selector-btn:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

/* Popup Overlay */
.minimal-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

/* Popup Container */
.minimal-popup {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

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

.minimal-popup-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.minimal-popup-search {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.minimal-popup-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.minimal-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Fields Grid */
.minimal-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.minimal-field-item {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s;
}

.minimal-field-item:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.minimal-field-label {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
}

.minimal-field-label input[type="checkbox"] {
    margin-right: 12px;
    cursor: pointer;
}

.minimal-field-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.minimal-field-badge {
    font-size: 11px;
    padding: 2px 6px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    font-weight: 500;
}

/* Popup Footer */
.minimal-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

.minimal-field-count {
    font-size: 14px;
    color: #6b7280;
}

.minimal-popup-buttons {
    display: flex;
    gap: 12px;
}

/* Responsive for popup */
@media (max-width: 640px) {
    .minimal-fields-grid {
        grid-template-columns: 1fr;
    }
    
    .minimal-popup {
        width: 95%;
        max-height: 90vh;
    }
}

/* Preview Modal Styles */
.minimal-preview-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

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

.minimal-preview-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.minimal-preview-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.minimal-preview-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

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

.minimal-preview-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.minimal-preview-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.minimal-preview-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.minimal-preview-table tbody tr:hover {
    background: #f9fafb;
}

.minimal-preview-table td {
    padding: 12px;
    color: #4b5563;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.minimal-preview-empty {
    padding: 40px;
    text-align: center;
    color: #9ca3af;
    font-size: 16px;
}

.minimal-preview-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.minimal-preview-info {
    display: flex;
    gap: 24px;
}

.minimal-preview-stat {
    font-size: 14px;
    color: #6b7280;
}

.minimal-preview-stat strong {
    color: #111827;
    font-weight: 600;
}

/* Special cell value styles */
.minimal-null {
    color: #d1d5db;
    font-style: italic;
}

.minimal-empty {
    color: #9ca3af;
    font-style: italic;
    font-size: 12px;
}

.minimal-json {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #6366f1;
    background: #eef2ff;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Responsive preview modal */
@media (max-width: 768px) {
    .minimal-preview-modal {
        width: 95%;
        max-width: 95%;
    }
    
    .minimal-preview-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .minimal-preview-footer {
        flex-direction: column;
        gap: 16px;
    }
}

/* Keep original modern-modal class for backwards compatibility */
.modern-modal {
    backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, 0.7);
    animation: fadeIn 0.2s ease-out;
}

/* Legacy export modal content - kept for compatibility */
.export-modal-content {
    max-width: 720px;
    width: 95%;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

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

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translate(-50%, -48%) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
}

/* Modal Header */
.export-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 0 24px;
    margin-bottom: 24px;
}

.export-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.export-icon {
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

.export-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}

.export-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 4px 0 0 0;
    line-height: 1.4;
}

.btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: #f1f5f9;
    border-radius: 10px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: #e2e8f0;
    color: #334155;
    transform: scale(1.05);
}

/* Form Styles */
.export-form {
    padding: 0 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: all 0.3s ease;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin: 0;
}

.section-label svg {
    color: #3b82f6;
}

/* Radio Group Styles */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-option {
    position: relative;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    background: #fefefe;
}

.radio-option:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-option input[type="radio"]:checked + .radio-content {
    color: #f7fafc;
}

.radio-option input[type="radio"]:checked + .radio-content .radio-icon {
    transform: scale(1.1);
}

.radio-option:has(input:checked) {
    border-color: #4299e1;
    background: rgba(66, 153, 225, 0.15);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.2);
}

.radio-content {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.radio-icon {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.radio-title {
    font-weight: 600;
    font-size: 15px;
    color: #f7fafc;
    margin-bottom: 2px;
}

.radio-description {
    font-size: 13px;
    color: #a0aec0;
    line-height: 1.3;
}

/* Date Range Styles */
.date-range-container {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.date-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.date-label {
    font-size: 13px;
    font-weight: 500;
    color: #a0aec0;
    margin: 0;
}

.date-input-wrapper {
    position: relative;
}

.date-input {
    width: 100%;
    padding: 10px 14px;
    padding-right: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.3);
    color: #f7fafc;
    transition: all 0.2s ease;
    font-family: inherit;
}

.date-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

.date-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    pointer-events: none;
}

.date-separator {
    font-size: 14px;
    font-weight: 500;
    color: #718096;
    margin: 0 4px;
    margin-bottom: 4px;
    white-space: nowrap;
}

/* Legacy Loading states - kept for compatibility */
.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced export button hover state */
.btn-orange:hover {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add subtle animation to main export buttons */
.btn-orange {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-orange::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-orange:hover::before {
    left: 100%;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background: #007bff;
    color: white;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 123, 255, 0.3);
}

.btn-gray {
    background: #6c757d;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-gray:hover {
    background: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-gray:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(108, 117, 125, 0.3);
}

.btn-green {
    background: #28a745;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-green:hover {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-green:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.btn-red {
    background: #dc3545;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-red:hover {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-red:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.btn-orange {
    background: #fd7e14;
}

.btn-orange:hover {
    background: #e8670e;
}

.btn-blue {
    background: #007bff;
    color: white;
}

.btn-blue:hover {
    background: #0056b3;
}

.btn-blue:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

/* Stats Grid */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-num {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

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

/* Colors */
.green {
    color: #10b981;
}

.red {
    color: #ef4444;
}

.blue {
    color: #007bff;
}

.orange {
    color: #fd7e14;
}

.purple {
    color: #6f42c1;
}

/* Call List */
.call {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.call:hover {
    background: #f8f9fa;
}

.call:last-child {
    border-bottom: none;
}

.call-completed {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.call-failed {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.call-progress {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
}

.call-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.call-main {
    font-weight: 500;
    font-size: 16px;
    color: #333;
}

.call-sub {
    font-size: 13px;
    color: #666;
}

.call-meta {
    text-align: right;
    font-size: 13px;
    color: #666;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    border-radius: 12px;
    max-width: 95%;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
}

/* Detail Views */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.detail-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail {
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.detail-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.detail-value {
    color: #666;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-progress {
    background: #d1ecf1;
    color: #0c5460;
}

.status-draft {
    background: #f8f9fa;
    color: #6c757d;
}

.status-validated {
    background: #d4edda;
    color: #155724;
}

.status-in-progress {
    background: #d1ecf1;
    color: #0c5460;
}

.status-paused {
    background: #fff3cd;
    color: #856404;
}

.status-finished {
    background: #e2e3e5;
    color: #383d41;
}

.verification-pending {
    background: #fff3cd;
    color: #856404;
}

.verification-verified {
    background: #d4edda;
    color: #155724;
}

.verification-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Form Elements */
input, select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* Timeline */
.timeline {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.timeline-item {
    padding: 8px 0;
    border-left: 3px solid #007bff;
    padding-left: 15px;
    margin-left: 10px;
}

/* Dynamic Fields Support */
.field-group {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.field-group-title {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}

.detail-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.detail-content {
    max-height: 60vh;
    overflow-y: auto;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #5a6268;
}

.evaluation-section {
    background: #e8f4f8;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #b8e0ea;
}

.evaluation-section h4 {
    margin: 0 0 10px 0;
    color: #0066cc;
}

.evaluation-content {
    color: #333;
    line-height: 1.6;
}

.timeline-time {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.timeline-event {
    font-size: 14px;
    color: #333;
    margin-top: 2px;
}

/* JSON Data Display */
.json-data {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Role Badges */
.role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: #e3f2fd;
    color: #1565c0;
}

.role-client {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: white;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-tab {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    color: #666;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-tab.active {
    background: #007bff;
    color: white;
}

.nav-tab:hover:not(.active) {
    background: #f8f9fa;
}

/* User Management Forms */
.user-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

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

.form-row .form-group {
    flex: 1;
}

/* User Table */
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

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

.user-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.user-row:hover {
    background: #f8f9fa;
}

/* Textarea Maximize Feature */
.textarea-container {
    position: relative;
}

.maximize-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    z-index: 2;
}

.maximize-btn:hover {
    background: white;
    color: #007bff;
    border-color: #007bff;
}

.textarea-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.textarea-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.textarea-modal textarea {
    flex: 1;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    font-size: 14px;
    font-family: system-ui;
    resize: none;
}

.textarea-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.textarea-modal-buttons {
    margin-top: 15px;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-bar input {
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
}

/* Event Tooltip Styles */
.event-tooltip {
    position: fixed;
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
    transform: translateX(-50%);
}

.tooltip-event-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.tooltip-timestamp {
    font-size: 11px;
    opacity: 0.8;
}

/* Loading spinner animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
