@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* Color Accents (Branding) */
:root, :root[data-accent="default"] {
    --color-primary: #4facfe;
    --color-primary-rgb: 79, 172, 254;
    --color-secondary: #00f2fe;
    --color-secondary-rgb: 0, 242, 254;
    
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #f43f5e;
    --color-info: #3b82f6;
}

:root[data-accent="concentrix"] {
    --color-primary: #003d5b;            /* Bleu Concentrix officiel */
    --color-primary-rgb: 0, 61, 91;
    --color-secondary: #25e2cc;          /* Turquoise Concentrix officiel */
    --color-secondary-rgb: 37, 226, 204;
    
    --color-success: #10b981;
    --color-warning: #fa9907;
    --color-danger: #f43f5e;
    --color-info: #003d5b;
}

/* Common sizing & animations */
:root {
    --sidebar-width: 260px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    --color-gradient: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

/* Light / Dark Mode Colors */
:root, :root[data-theme="dark"] {
    --bg-primary: #080c14;
    --bg-secondary: #0f1626;
    --bg-card: rgba(20, 28, 48, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-glow: rgba(var(--color-primary-rgb), 0.25);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 15px rgba(var(--color-primary-rgb), 0.15);

    --topbar-bg: rgba(15, 22, 38, 0.4);
    --card-hover-bg: rgba(255, 255, 255, 0.03);
    --btn-secondary-bg: rgba(255, 255, 255, 0.05);
    --btn-secondary-hover: rgba(255, 255, 255, 0.1);
    --form-bg: rgba(0, 0, 0, 0.25);
    --table-header-bg: rgba(15, 22, 38, 0.6);
    --menu-active-text: #ffffff;
}

:root[data-theme="light"] {
    --bg-primary: #f3f4f6;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-glow: rgba(var(--color-primary-rgb), 0.2);
    
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.09);
    --shadow-glow: 0 0 15px rgba(var(--color-primary-rgb), 0.08);

    --topbar-bg: rgba(255, 255, 255, 0.7);
    --card-hover-bg: rgba(0, 0, 0, 0.03);
    --btn-secondary-bg: rgba(0, 0, 0, 0.05);
    --btn-secondary-hover: rgba(0, 0, 0, 0.08);
    --form-bg: #ffffff;
    --table-header-bg: rgba(243, 244, 246, 0.95);
    --menu-active-text: var(--color-primary);
}

:root[data-theme="concentrix"] {
    --bg-primary: #002233;         /* Bleu profond sombre pour l'arrière-plan */
    --bg-secondary: #003d5b;       /* Bleu officiel Concentrix */
    --bg-card: rgba(0, 61, 91, 0.45); /* Transparent glassmorphism basé sur le bleu officiel */
    --border-color: rgba(37, 226, 204, 0.15); /* Bordures turquoise Concentrix très légères */
    --border-color-glow: rgba(37, 226, 204, 0.4);
    
    --text-primary: #ffffff;
    --text-secondary: #aae0d9;     /* Un turquoise très clair adouci pour les textes secondaires */
    --text-muted: #5e8c87;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 15px rgba(37, 226, 204, 0.2);

    --topbar-bg: rgba(0, 61, 91, 0.6);
    --card-hover-bg: rgba(37, 226, 204, 0.05);
    --btn-secondary-bg: rgba(37, 226, 204, 0.1);
    --btn-secondary-hover: rgba(37, 226, 204, 0.2);
    --form-bg: rgba(0, 0, 0, 0.2);
    --table-header-bg: rgba(0, 61, 91, 0.85);
    --menu-active-text: #25e2cc;   /* Turquoise officiel Concentrix pour les menus actifs */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* App Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    background: var(--color-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    color: #fff;
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.menu-item:hover {
    color: var(--text-primary);
    background-color: var(--card-hover-bg);
    border-color: var(--border-color);
}

.menu-item.active {
    color: var(--menu-active-text);
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: var(--border-color-glow);
    box-shadow: inset 0 0 12px rgba(var(--color-primary-rgb), 0.05);
}

.menu-item i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.status-badge-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-success);
    box-shadow: 0 0 10px var(--color-success);
}

.status-indicator.offline {
    background-color: var(--text-muted);
    box-shadow: none;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.top-bar {
    height: 80px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background-color: var(--topbar-bg);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 16px;
}

.content-pane {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    display: none;
}

.content-pane.active {
    display: block;
}

/* Glass Card styling */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    outline: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--color-gradient);
    color: #080c14;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}

.btn-secondary {
    background-color: var(--btn-secondary-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--btn-secondary-hover);
    border-color: rgba(var(--color-primary-rgb), 0.25);
}

.btn-danger {
    background-color: rgba(244, 63, 94, 0.1);
    color: var(--color-danger);
    border-color: rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
    background-color: rgba(244, 63, 94, 0.2);
    border-color: var(--color-danger);
}

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

/* Grid & Dashboard specific styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--color-primary);
}

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

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Dashboard Plots Container */
.dashboard-plots {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .dashboard-plots {
        grid-template-columns: 1fr;
    }
}

.plot-card h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.canvas-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background-color: var(--form-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.15);
    outline: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Drag & Drop File Upload Area */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    background-color: rgba(255, 255, 255, 0.01);
}

.file-upload-area:hover, .file-upload-area.dragover {
    border-color: var(--color-primary);
    background-color: rgba(79, 172, 254, 0.03);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 16px;
    display: inline-block;
}

.file-upload-area h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.file-upload-area p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.file-upload-area input[type="file"] {
    display: none;
}

/* Data Table Stylings */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th, .data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--table-header-bg);
    color: var(--text-secondary);
    font-weight: 600;
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: var(--card-hover-bg);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 6px;
}

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

.status-pill.pending {
    background-color: rgba(156, 163, 175, 0.1);
    color: var(--text-secondary);
}
.status-pill.pending::before { background-color: var(--text-secondary); }

.status-pill.calling {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
    animation: pulse 1.5s infinite;
}
.status-pill.calling::before { background-color: var(--color-info); }

.status-pill.completed {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}
.status-pill.completed::before { background-color: var(--color-success); }

.status-pill.failed {
    background-color: rgba(244, 63, 94, 0.1);
    color: var(--color-danger);
}
.status-pill.failed::before { background-color: var(--color-danger); }

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

/* Call Simulator Panel & Phone Layout */
.simulator-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
}

@media (max-width: 900px) {
    .simulator-layout {
        grid-template-columns: 1fr;
    }
}

.phone-mockup {
    background: #0d121f;
    border: 12px solid #242c42;
    border-radius: 40px;
    height: 580px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.phone-speaker {
    width: 60px;
    height: 4px;
    background: #242c42;
    border-radius: 2px;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.phone-screen {
    flex-grow: 1;
    padding: 30px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.phone-header {
    text-align: center;
    margin-top: 20px;
}

.phone-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-gradient);
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #080c14;
    box-shadow: var(--shadow-glow);
}

.phone-avatar.calling-animation {
    animation: phonePulse 2s infinite ease-in-out;
}

@keyframes phonePulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 242, 254, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(0, 242, 254, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 242, 254, 0); }
}

.phone-contact-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.phone-status-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.phone-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.phone-pulse-ring {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-actions {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 10px;
}

.phone-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    color: #fff;
}

.phone-btn.decline {
    background-color: var(--color-danger);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.phone-btn.decline:hover {
    transform: scale(1.1);
    background-color: #e11d48;
}

.phone-btn.accept {
    background-color: var(--color-success);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.phone-btn.accept:hover {
    transform: scale(1.1);
    background-color: #059669;
}

.phone-btn.mute {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.phone-btn.mute:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.phone-btn.mute.active {
    background-color: var(--color-warning);
    color: #000;
}

/* Chat/Transcript Log inside Simulator Panel */
.transcript-panel {
    display: flex;
    flex-direction: column;
    height: 580px;
}

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

.transcript-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-bubble.bot {
    align-self: flex-start;
    background-color: rgba(79, 172, 254, 0.1);
    border: 1px solid rgba(79, 172, 254, 0.15);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
}

.chat-bubble.user {
    align-self: flex-end;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-right-radius: 2px;
}

.chat-bubble.system {
    align-self: center;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 12px;
}

.transcript-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.transcript-footer input {
    flex-grow: 1;
}

/* Campaign Panel design elements */
.campaign-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.progress-container {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    height: 16px;
    width: 100%;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background: var(--color-gradient);
    width: 0%;
    transition: width 0.4s ease;
}

.progress-stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Question manager specific styles */
.question-item {
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.question-number {
    background: var(--color-gradient);
    color: #080c14;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.question-details {
    flex-grow: 1;
}

.question-header-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.question-type-badge {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--color-secondary);
    font-weight: 500;
}

.question-text {
    font-weight: 500;
    margin-bottom: 4px;
}

.question-helper {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1rem;
    padding: 4px;
    border-radius: 4px;
}

.icon-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.icon-btn.danger:hover {
    color: var(--color-danger);
    background-color: rgba(244, 63, 94, 0.1);
}

/* Notification banner */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color-glow);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    color: var(--text-primary);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-success {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.notification-danger {
    border-color: rgba(244, 63, 94, 0.3);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.15);
}

/* Settings view custom elements */
.settings-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    margin-bottom: 16px;
    font-size: 1.15rem;
    font-weight: 600;
}

/* Pulse voice animation indicator */
.voice-wave {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    margin-top: 10px;
}

.voice-wave span {
    display: block;
    width: 3px;
    height: 4px;
    background-color: var(--color-secondary);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.voice-wave.active span {
    animation: waveAnimation 1.2s infinite ease-in-out;
}

.voice-wave.active span:nth-child(1) { animation-delay: 0.1s; height: 18px; }
.voice-wave.active span:nth-child(2) { animation-delay: 0.2s; height: 26px; }
.voice-wave.active span:nth-child(3) { animation-delay: 0.3s; height: 12px; }
.voice-wave.active span:nth-child(4) { animation-delay: 0.4s; height: 22px; }
.voice-wave.active span:nth-child(5) { animation-delay: 0.5s; height: 8px; }
.voice-wave.active span:nth-child(6) { animation-delay: 0.6s; height: 28px; }
.voice-wave.active span:nth-child(7) { animation-delay: 0.7s; height: 16px; }

@keyframes waveAnimation {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(3.5); }
}

/* Modal Backdrop & Content Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 8, 16, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-backdrop.show {
    opacity: 1;
}

.modal-backdrop.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--color-danger);
}

/* --- LOGIN OVERLAY --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-box {
    width: 90%;
    max-width: 800px;
    padding: 40px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 24px;
}

.login-box h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 30%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.login-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 600px) {
    .login-options {
        grid-template-columns: 1fr;
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.login-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-secondary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.login-icon {
    font-size: 2.5rem;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.login-card:hover .login-icon {
    background: var(--color-secondary);
    color: #080c14;
    transform: scale(1.1);
}

.login-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.login-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
    flex-grow: 1;
    text-align: center;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* --- SMS OVERLAY SIMULATOR --- */
.sms-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    z-index: 100;
    animation: smsSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes smsSlideIn {
    from { opacity: 0; transform: translate(-50%, -30%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.sms-bubble {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--color-secondary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--shadow-glow);
    border-radius: 16px;
    padding: 14px;
}

.sms-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--color-secondary);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
}

.sms-header i {
    width: 14px;
    height: 14px;
}

.sms-close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
}

.sms-close-btn:hover {
    color: var(--color-danger);
}

.sms-content {
    font-size: 0.82rem;
    color: #fff;
    line-height: 1.4;
    word-break: break-word;
}

/* --- LOGIN BOT ANIMATIONS --- */
.login-bot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    gap: 15px;
}

.login-bot-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: danceBot 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    transform-origin: bottom center;
}

.login-bot-avatar .bot-ball {
    position: absolute;
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at 35% 35%, #ff0055, #990033);
    border-radius: 50%;
    top: -24px;
    left: 33px;
    z-index: 3;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.8), 0 0 3px #ff0055;
    animation: juggleBall 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

@keyframes juggleBall {
    0%, 100% {
        transform: translateY(0) scale(1);
        background: radial-gradient(circle at 35% 35%, #ff0055, #990033);
        box-shadow: 0 0 10px rgba(255, 0, 85, 0.8), 0 0 3px #ff0055;
    }
    25% {
        transform: translateY(-60px) scale(0.85) translateX(-10px);
    }
    50% {
        transform: translateY(8px) scale(1.1) translateX(-16px);
        background: radial-gradient(circle at 35% 35%, #00f2fe, #007788);
        box-shadow: 0 0 10px rgba(0, 242, 254, 0.8), 0 0 3px #00f2fe;
    }
    75% {
        transform: translateY(-55px) scale(0.85) translateX(10px);
    }
    90% {
        transform: translateY(8px) scale(1.1) translateX(16px);
        background: radial-gradient(circle at 35% 35%, #39ff14, #119900);
        box-shadow: 0 0 10px rgba(57, 255, 20, 0.8), 0 0 3px #39ff14;
    }
}

@keyframes danceBot {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    15% {
        transform: translateY(-8px) rotate(-5deg) scaleY(1.06) scaleX(0.94);
    }
    30% {
        transform: translateY(0) rotate(4deg) scaleY(0.94) scaleX(1.06);
    }
    45% {
        transform: translateY(-6px) rotate(-3deg) scaleY(1.03) scaleX(0.97);
    }
    50% {
        transform: translateY(2px) rotate(-10deg) scaleY(0.92) scaleX(1.08) translateX(-12px);
    }
    60% {
        transform: translateY(2px) rotate(8deg) scaleY(0.94) scaleX(1.06);
    }
    75% {
        transform: translateY(-10px) rotate(-8deg) scaleY(1.08) scaleX(0.92);
    }
    90% {
        transform: translateY(2px) rotate(10deg) scaleY(0.92) scaleX(1.08) translateX(12px);
    }
}

.login-bot-avatar .bot-face {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.login-bot-avatar .bot-icon {
    color: #fff;
    width: 32px;
    height: 32px;
}

.login-bot-avatar .bot-ring, 
.login-bot-avatar .bot-ring-inner {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0, 242, 254, 0.3);
    z-index: 1;
}

.login-bot-avatar .bot-ring {
    width: 84px;
    height: 84px;
    animation: pulseOuter 2.5s ease-out infinite;
}

.login-bot-avatar .bot-ring-inner {
    width: 72px;
    height: 72px;
    animation: pulseInner 2s ease-out infinite;
}

@keyframes pulseOuter {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes pulseInner {
    0% { transform: scale(0.95); opacity: 0.9; }
    100% { transform: scale(1.2); opacity: 0; }
}

.login-bot-bubble {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 16px 24px;
    max-width: 450px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
}

/* typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 20px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--color-secondary);
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

.bot-text {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.5;
    color: #fff;
    font-weight: 500;
    text-align: center;
}

/* --- FLOWCHART TREE VISUALIZER --- */
#survey-flowchart {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#survey-flowchart::-webkit-scrollbar {
    height: 6px;
}

#survey-flowchart::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.flowchart-node {
    flex: 0 0 180px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.flowchart-node:hover {
    border-color: var(--color-secondary);
    background: rgba(0, 242, 254, 0.03);
}

.flowchart-node h4 {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--color-secondary);
    text-transform: uppercase;
}

.flowchart-node p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flowchart-node .node-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 6px;
}

.flowchart-node .node-badge.rating { background: rgba(79, 172, 254, 0.15); color: #4facfe; }
.flowchart-node .node-badge.yes_no { background: rgba(0, 242, 254, 0.15); color: #00f2fe; }
.flowchart-node .node-badge.open { background: rgba(168, 85, 247, 0.15); color: #a855f7; }

.flowchart-connector {
    flex: 0 0 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.flowchart-arrow {
    width: 24px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    position: relative;
}

.flowchart-arrow::after {
    content: '';
    position: absolute;
    right: -2px;
    top: -3px;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid rgba(255, 255, 255, 0.15);
}

.flowchart-connector span {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

/* --- PRINT STYLES FOR PDF REPORT EXPORT --- */
@media print {
    /* Hide everything except the dashboard content */
    body * {
        visibility: hidden;
    }
    
    #pane-dashboard, #pane-dashboard * {
        visibility: visible;
    }
    
    /* Make the dashboard container fill the page */
    #pane-dashboard {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #000 !important;
        display: block !important;
    }
    
    /* Hide specific controls that shouldn't print */
    .sidebar, 
    .navbar, 
    .app-header, 
    .btn, 
    .tabs-nav,
    .controls,
    .campaign-control-card,
    #excel-upload-area,
    .icon-btn,
    .menu-item,
    .app-header *,
    .glass-card style {
        display: none !important;
    }
    
    /* Force light background and dark text for contrast */
    :root {
        --bg-app: #ffffff !important;
        --bg-card: #ffffff !important;
        --text-primary: #000000 !important;
        --text-secondary: #444444 !important;
        --border-color: #dddddd !important;
        --color-primary: #4facfe !important;
        --color-secondary: #00f2fe !important;
    }
    
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .glass-card {
        background: #ffffff !important;
        border: 1px solid #cccccc !important;
        color: #000000 !important;
        box-shadow: none !important;
        margin-bottom: 20px !important;
        page-break-inside: avoid;
    }
    
    .kpi-card {
        border-left: 4px solid var(--color-primary) !important;
    }
    
    .data-table th {
        background: #eeeeee !important;
        color: #000000 !important;
        border-bottom: 2px solid #cccccc !important;
    }
    
    .data-table td {
        border-bottom: 1px solid #eeeeee !important;
        color: #333333 !important;
    }
    
    /* Avoid breaking chart canvases across pages */
    .chart-container {
        page-break-inside: avoid;
        max-height: 300px !important;
    }
}
