/* Custom CSS for AI Voice Calls Platform */

/* Root variables - Light Theme Only */
:root {
    /* Use tokens from modern-theme.css */
    --primary-color: var(--brand-500);
    --primary-hover: var(--brand-600);
    --secondary-color: #1F2937;
    --success-color: var(--success-500);
    --error-color: var(--danger-500);
    --warning-color: var(--warning-500);
    --background-color: var(--bg-app);
    --surface-color: var(--bg-surface);
    --text-color: var(--text-primary);
    --muted-text-color: var(--text-muted);
    --border-color: var(--border-subtle);
}

/* Body */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-size: 0.875rem; /* 14px base */
}

/* Sidebar Styles */
#sidebar {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    background-color: var(--secondary-color);
}

.nav-item {
    transition: all 0.2s ease;
}

.nav-item:hover {
    transform: translateX(2px);
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Button styles */
.btn-primary {
    background-color: var(--primary);
    color: var(--on-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background-color: #DC2626;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Card styles - Enhanced */
.card {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Table styles - Enhanced */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 0.5rem;
    overflow: hidden;
}

.table th {
    background-color: var(--bg-muted);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary); /* Better contrast - not muted */
    border-bottom: 1px solid var(--border-strong);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 0.875rem; /* 14px - improved from default */
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: #FAFAFA;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badge styles - Enhanced */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.badge-error {
    background-color: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background-color: #DBEAFE;
    color: #1E40AF;
}

/* Status badges for campaigns */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.draft {
    background-color: #F3F4F6;
    color: #374151;
}

.status-badge.scheduled {
    background-color: var(--warning-100);
    color: #92400E;
}

.status-badge.running {
    background-color: var(--info-100);
    color: #1E40AF;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-badge.completed {
    background-color: var(--success-100);
    color: #065F46;
}

.status-badge.paused {
    background-color: var(--warning-100);
    color: #92400E;
}

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

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 0.75rem;
    background-color: #E5E7EB;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
    border-radius: 9999px;
}

/* File upload drag and drop */
.file-drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    background-color: var(--bg);
}

.file-drop-area.drag-over {
    border-color: var(--primary);
    background-color: #FFF5F0;
    transform: scale(1.02);
}

/* Form inputs - Enhanced */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(232, 92, 46, 0.1);
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="date"]:focus-visible,
input[type="datetime-local"]:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

/* Filter section styles */
.filter-group {
    background: var(--surface);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.filter-group-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Filter chips */
.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background-color: #FFF5F0;
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.25rem;
}

.filter-chip button {
    margin-left: 0.5rem;
    color: var(--primary);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.filter-chip button:hover {
    opacity: 1;
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Slide in animation for sidebar */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Responsive utilities */
@media (max-width: 1024px) {
    #sidebar {
        transform: translateX(-100%);
    }
    
    #sidebar:not(.-translate-x-full) {
        animation: slideIn 0.3s ease-out;
    }
}

@media (max-width: 640px) {
    .card {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Smooth transitions */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Theme helpers */
.theme-surface {
    background-color: var(--surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.theme-text-muted {
    color: var(--text-muted);
}

.theme-border {
    border-color: var(--border-color);
    border-width: 1px;
    border-style: solid;
}

.theme-border-b {
    border-bottom-color: var(--border-color);
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.theme-border-t {
    border-top-color: var(--border-color);
    border-top-width: 1px;
    border-top-style: solid;
}

.theme-bg {
    background-color: var(--bg);
    color: var(--text-primary);
}

.theme-text {
    color: var(--text-primary);
}

.theme-input {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.theme-surface-secondary {
    background-color: var(--bg);
}

.theme-border-action {
    border: 2px solid var(--border-color);
}

/* Icon backgrounds */
.theme-icon-bg-indigo {
    background-color: #EEF2FF;
}

.theme-icon-bg-emerald {
    background-color: #D1FAE5;
}

.theme-icon-bg-amber {
    background-color: #FEF3C7;
}

.theme-icon-bg-blue {
    background-color: #DBEAFE;
}

.theme-icon-bg-red {
    background-color: #FEE2E2;
}

/* Icon colors */
.theme-icon-indigo {
    color: #4F46E5;
}

.theme-icon-emerald {
    color: #10B981;
}

.theme-icon-amber {
    color: #F59E0B;
}

.theme-icon-blue {
    color: #3B82F6;
}

.theme-icon-red {
    color: #EF4444;
}
