/* AI Voice Agent Dashboard Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 2rem;
    color: #fbbf24;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.connection-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-dot.connecting {
    background: #f59e0b;
    animation: pulse 1.5s infinite;
}

.status-dot.offline {
    background: #ef4444;
}

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

/* Main Layout */
.main-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 80px); /* Adjust for header height */
}

/* Sidebar Navigation Styles */
.sidebar-navigation {
    width: 250px;
    background: white;
    border-right: 1px solid #e5e7eb;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

.nav-container {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-right: 3px solid transparent;
    transition: all 0.3s ease;
    color: #6b7280;
    font-weight: 500;
    margin: 0.125rem 0;
}

.nav-item:hover {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.05);
}

.nav-item.active {
    color: #4f46e5;
    border-right-color: #4f46e5;
    background: rgba(79, 70, 229, 0.08);
    font-weight: 600;
}

.nav-item i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

/* Agent Panel Styles */
.agent-panel {
    width: 280px;
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.agent-panel.show {
    display: flex;
}

.agent-panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: white;
}

.agent-panel-header h3 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.create-agent-btn {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.create-agent-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.agent-list {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agent-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.agent-item:hover {
    border-color: #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.agent-item.active {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.02);
}

.agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.agent-info {
    flex: 1;
    min-width: 0;
}

.agent-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-description {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agent-actions {
    display: flex;
    gap: 0.25rem;
}

.agent-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.agent-action-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Agent Select Dropdowns */
.agent-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    color: #374151;
    font-weight: 500;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.agent-select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.agent-select option {
    padding: 0.5rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    background: #f9fafb;
    overflow-y: auto;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Chat Layout */
.chat-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    height: 70vh;
}

.chat-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    gap: 0.75rem;
    animation: fadeInUp 0.3s ease;
}

.message-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.user .message-icon {
    background: #4f46e5;
    color: white;
}

.message.assistant .message-icon,
.message.bot .message-icon {
    background: #10b981;
    color: white;
}

.message.system .message-icon {
    background: #6b7280;
    color: white;
}

.message.caller .message-icon {
    background: #f59e0b;
    color: white;
}

/* Modern Minimalist Message Design */
.message {
    display: block;
    margin-bottom: 1rem;
    animation: fadeInUp 0.2s ease;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-speaker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.85rem;
}

.speaker-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.speaker-name {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* User Messages */
.message.user .speaker-icon {
    background: #4f46e5;
    color: white;
}

.message.user .speaker-name {
    color: #4f46e5;
}

.message.user .message-content {
    background: #4f46e5;
    color: white;
    margin-left: 2rem;
}

/* Assistant Messages */
.message.assistant .speaker-icon,
.message.bot .speaker-icon {
    background: #10b981;
    color: white;
}

.message.assistant .speaker-name,
.message.bot .speaker-name {
    color: #10b981;
}

.message.assistant .message-content,
.message.bot .message-content {
    background: #f3f4f6;
    color: #374151;
    margin-left: 2rem;
}

/* Caller Messages */
.message.caller .speaker-icon {
    background: #f59e0b;
    color: white;
}

.message.caller .speaker-name {
    color: #f59e0b;
}

.message.caller .message-content {
    background: #fef3c7;
    color: #92400e;
    margin-left: 2rem;
}

.message-content {
    border-radius: 16px;
    padding: 0.875rem 1.125rem;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-text {
    line-height: 1.5;
    margin: 0;
}

.message-time {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 400;
}

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

/* Control Panel */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.control-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 8px;
}

.phone-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.phone-input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.phone-input-group input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.phone-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    font-family: monospace;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-text {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.primary-btn.connected {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.primary-btn.connected:hover:not(:disabled) {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.icon-btn {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}

.icon-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Knowledge Base Layout */
.kb-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 70vh;
}

.kb-upload-section,
.kb-files-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.upload-area {
    background: white;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.02);
}

.upload-content i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.upload-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.upload-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}

.upload-link:hover {
    text-decoration: underline;
}

.upload-content small {
    color: #9ca3af;
    font-size: 0.875rem;
}

.upload-actions {
    display: flex;
    justify-content: center;
}

.selected-files-preview {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}

.selected-files-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selected-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.selected-file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.selected-file-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #4f46e5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.selected-file-details {
    display: flex;
    flex-direction: column;
}

.selected-file-name {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.selected-file-size {
    font-size: 0.75rem;
    color: #6b7280;
}

.selected-file-remove {
    background: #fee2e2;
    border: none;
    border-radius: 4px;
    padding: 0.25rem;
    cursor: pointer;
    color: #dc2626;
    transition: all 0.3s ease;
}

.selected-file-remove:hover {
    background: #fecaca;
}

.storage-usage {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

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

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

.files-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.3s ease;
}

.file-item:hover {
    background: #f8fafc;
}

.file-item:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #4f46e5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.875rem;
    color: #6b7280;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #6b7280;
}

.empty-state small {
    font-size: 0.875rem;
}

/* Agent Configuration Layout */
.agent-config-layout {
    width: 100%;
    margin: 0;
}

.agent-config-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.config-section {
    padding: 2rem;
    border-bottom: 1px solid #f3f4f6;
}

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

.config-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.config-section h3 i {
    color: #4f46e5;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input[type="range"] {
    padding: 0;
    background: transparent;
    border: none;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
}

.form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Toggle Switch Styles */
.function-toggle {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .toggle-slider {
    background-color: #4f46e5;
}

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

.function-info {
    flex: 1;
}

.function-info strong {
    display: block;
    color: #1f2937;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.function-info p {
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
}

/* Action Buttons */
.config-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.secondary-btn {
    background: #f8fafc;
    color: #374151;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
}

.secondary-btn:hover {
    background: #f1f5f9;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

/* ============= TOOLS PAGE STYLES ============= */
.tools-config-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    height: 70vh;
}

.tools-config-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 2rem;
}

.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.tool-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tool-card:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tool-card.active {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.tool-card.selected {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.15);
}

.tool-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f9fafb;
}

.tool-card.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #e5e7eb;
}

.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.tool-header i {
    font-size: 1.5rem;
    color: #4f46e5;
    margin-right: 0.5rem;
}

.tool-header h4 {
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.tool-status {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
}

.tool-status.enabled i {
    color: #10b981;
}

.tool-status.disabled i {
    color: #ef4444;
}

.tool-card p {
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.tool-actions {
    display: flex;
    gap: 0.5rem;
}

.tool-detail-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    max-height: 70vh;
    overflow-y: auto;
}

.tool-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f3f4f6;
    background: #f8fafc;
}

.tool-config-header h3 {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-panel {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.close-panel:hover {
    background: #e5e7eb;
    color: #374151;
}

.tool-config-content {
    padding: 2rem;
}

.tool-config-content .config-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.tool-config-content .config-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.tool-config-content h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
}

.tool-config-content h4 i {
    color: #4f46e5;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.4;
}

.config-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
}

.config-actions .primary-btn,
.config-actions .secondary-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Agent Tools Configuration */
.tools-selection {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.tools-selector-container {
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    /* max-width: 600px; */
}

.tools-selector-container:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tools-selector-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tools-selector-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 60px;
}

.loading-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6b7280;
    padding: 1rem;
}

.loading-tools i {
    color: #3b82f6;
}

.tool-group {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.tool-group:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tool-group-header {
    background: #f9fafb;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.8rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tool-group-header i {
    color: #6b7280;
}

.tool-list {
    padding: 0.25rem;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
}

.tool-item:hover {
    background: #f3f4f6;
}

.tool-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tool-item.disabled:hover {
    background: transparent;
}

.tool-checkbox {
    width: 16px !important;
    height: 16px !important;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.tool-checkbox:disabled { 
    width: 16px !important;
    height: 16px !important;
    cursor: not-allowed;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-weight: 500;
    color: #111827;
    font-size: 0.85rem;
    line-height: 1.2;
}

.tool-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    margin-left: auto;
}

.tool-status.connected {
    color: #059669;
}

.tool-status.warning {
    color: #d97706;
}

.tool-status.error {
    color: #dc2626;
}

.no-tools-available {
    text-align: center;
    padding: 1.5rem;
    color: #6b7280;
}

.no-tools-available i {
    font-size: 2rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.no-tools-available h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.no-tools-available p {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.create-tools-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.create-tools-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.tool-selector-header i {
    font-size: 1.25rem;
    color: #3b82f6;
    width: 20px;
    text-align: center;
}

.tool-selector-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}


.tool-selector {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.tool-selector label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.tool-selector select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    font-size: 0.875rem;
    color: #374151;
}

.tool-selector select:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.tool-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tool-option:hover:not(.disabled) {
    border-color: #4f46e5;
    background: #f8fafc;
}

.tool-option.disabled {
    opacity: 0.6;
    background: #f9fafb;
}

.tool-option input[type="checkbox"] {
    margin-right: 1rem;
    width: 18px;
    height: 18px;
}

.tool-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex: 1;
    gap: 1rem;
}

.tool-label i {
    font-size: 1.5rem;
    color: #4f46e5;
    width: 24px;
    text-align: center;
}

.tool-info {
    flex: 1;
}

.tool-name {
    font-weight: 600;
    color: #1f2937;
    display: block;
}


.tool-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-top: 0.5rem;
    background: #f3f4f6;
    color: #6b7280;
}

.tool-status.configured {
    background: #d1fae5;
    color: #065f46;
}

.function-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.function-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafafa;
}

.function-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.function-option label {
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}

/* ============= NEW TOOLS PAGE STYLES ============= */

/* New Tools Layout */
.tools-layout {
    width: 100%;
    padding: 2rem;
}

.tools-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.tools-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.tools-header h3 i {
    color: #4f46e5;
}

.tools-list {
    min-height: 400px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: white;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.empty-icon i {
    font-size: 2rem;
    color: #6b7280;
}

.empty-state h4 {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    max-width: 400px;
}

/* Tool Instance Cards */
.tool-instance-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.tool-instance-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.tool-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.tool-info {
    flex: 1;
}

.tool-info h4 {
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.tool-type {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}


.tool-instance-card .tool-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.tool-instance-card .tool-status.enabled {
    background: #d1fae5;
    color: #065f46;
}

.tool-instance-card .tool-status.disabled {
    background: #fee2e2;
    color: #991b1b;
}

.tool-instance-card .tool-status.not-configured {
    background: #fef3c7;
    color: #92400e;
}

.tool-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.tool-config-summary {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.config-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.config-item i {
    color: #9ca3af;
}

.tool-actions {
    display: flex;
    gap: 0.5rem;
}

.tool-action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.tool-action-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.tool-action-btn.delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.close-modal {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Tool Type Selection */
.tool-type-selection {
    padding: 2rem;
}

.tool-type-selection h4 {
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
}

.tool-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.tool-type-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tool-type-card:hover:not(.disabled) {
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.tool-type-card.selected {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.tool-type-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f9fafb;
}

.tool-type-card i {
    font-size: 2rem;
    color: #4f46e5;
    margin-bottom: 0.75rem;
}

.tool-type-card.disabled i {
    color: #9ca3af;
}

.tool-type-card h5 {
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.tool-type-card.disabled h5 {
    color: #6b7280;
}

.tool-type-card p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.tool-type-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #10b981;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.tool-type-card.disabled .tool-type-badge {
    background: #6b7280;
}

/* Tool Configuration */
.tool-configuration {
    padding: 2rem;
}

.config-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.back-btn {
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: #6b7280;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.config-header h4 {
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.config-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.config-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.config-section h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.config-section h5 i {
    color: #4f46e5;
}

/* Integration Requirement */
.integration-requirement {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.integration-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.integration-status i {
    font-size: 1.25rem;
}

.integration-status span {
    flex: 1;
    font-weight: 500;
}

.integration-status .secondary-btn {
    margin-left: auto;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.btn-spinner {
    display: none;
}

/* OAuth Integration Styles */
.oauth-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.connect-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #4285f4;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.connect-btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
}

.disconnect-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.disconnect-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Status Message Updates */
.status-message.info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.status-message.info i {
    color: #3b82f6;
}

/* Responsive Design for Tools */
@media (max-width: 1200px) {
    .tools-config-layout {
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
    }
    
    .tools-layout {
        padding: 1.5rem;
    }
}

@media (max-width: 968px) {
    .tools-config-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tool-detail-panel {
        max-height: none;
    }
    
    .tools-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .tool-types-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 768px) {
    .tools-config-panel,
    .tool-detail-panel {
        padding: 1rem;
    }
    
    .tool-config-content {
        padding: 1rem;
    }
    
    .tools-layout {
        padding: 1rem;
    }
    
    .tool-type-selection,
    .tool-configuration {
        padding: 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .tool-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .tool-config-summary {
        order: 2;
    }
    
    .tool-actions {
        order: 1;
        align-self: flex-end;
    }
}

/* History Layout */
.history-layout {
    display: grid;
    grid-template-columns: 350px minmax(400px, 800px);
    gap: 2rem;
    height: 70vh;
    justify-content: start;
    max-width: 1200px;
    margin: 0 auto;
}

.history-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.history-header h3 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.history-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filter-select {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #4f46e5;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.history-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.history-item:hover {
    background: #f1f5f9;
    border-color: #e5e7eb;
}

.history-item.active {
    background: rgba(79, 70, 229, 0.05);
    border-color: #4f46e5;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-item-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.history-item-type i {
    width: 16px;
    text-align: center;
}

.history-item-time {
    font-size: 0.75rem;
    color: #6b7280;
}

.history-item-duration {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.history-item-preview {
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.history-details {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    flex: 1;
}

.empty-selection {
    text-align: center;
    padding: 3rem 2rem;
    color: #9ca3af;
}

.empty-selection i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.empty-selection h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #6b7280;
}

.call-details {
    display: none;
}

.call-details.active {
    display: block;
}

.call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.call-info h3 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 700;
}

.call-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.call-transcript {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    background: #f8fafc;
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 0.95rem;
}

.post-processing-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.processing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.processing-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.processing-actions {
    display: flex;
    gap: 0.75rem;
}

.processing-results {
    padding: 1.5rem;
}

.result-section {
    margin-bottom: 2rem;
}

.result-section:last-child {
    margin-bottom: 0;
}

.result-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
}

.result-section h4 i {
    color: #4f46e5;
}

.summary-content,
.key-points-content,
.action-items-content {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.loading-placeholder {
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

.summary-text {
    line-height: 1.6;
    color: #374151;
}

.key-points-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-points-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #4f46e5;
}

.key-points-list li:last-child {
    margin-bottom: 0;
}

.key-points-list li i {
    color: #4f46e5;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.action-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.action-items-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #f59e0b;
}

.action-items-list li:last-child {
    margin-bottom: 0;
}

.action-items-list li i {
    color: #f59e0b;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.processing-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #eff6ff;
    border-radius: 8px;
    color: #1e40af;
    font-weight: 500;
    margin-bottom: 1rem;
}

.processing-status i {
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .history-layout {
        grid-template-columns: 300px minmax(350px, 1fr);
    }
}

@media (max-width: 1024px) {
    .chat-layout,
    .kb-layout,
    .history-layout {
        grid-template-columns: 1fr;
        height: auto;
        width: 100%;
    }
    
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar-navigation {
        width: 100%;
        order: 2;
    }
    
    .nav-container {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.5rem 1rem;
    }
    
    .nav-item {
        white-space: nowrap;
        border-right: none;
        border-bottom: 3px solid transparent;
        padding: 0.75rem 1rem;
    }
    
    .nav-item.active {
        border-right: none;
        border-bottom-color: #4f46e5;
    }
    
    .agent-panel {
        width: 100%;
        order: 3;
        max-height: 300px;
    }
    
    .main-content {
        padding: 1rem;
        order: 1;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .config-actions {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
    }
    
    .nav-item {
        justify-content: center;
        border-bottom: none;
        border-right: 3px solid transparent;
    }
    
    .nav-item.active {
        border-right-color: #4f46e5;
        border-bottom: none;
    }
    
    .phone-input-group {
        flex-direction: column;
    }
    
    .app-container {
        width: 100%;
        border-radius: 0;
    }
}

/* Custom Scrollbar */
.messages-container::-webkit-scrollbar,
.files-list::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track,
.files-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb,
.files-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.files-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Loading Spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #4f46e5;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    pointer-events: auto;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.toast-content i {
    font-size: 1.1rem;
}

.toast-success .toast-content i {
    color: #10b981;
}

.toast-error .toast-content i {
    color: #ef4444;
}

.toast-warning .toast-content i {
    color: #f59e0b;
}

.toast-info .toast-content i {
    color: #3b82f6;
}

.toast-content span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* ============= VOICE PROVIDERS PAGE STYLES ============= */

.voice-providers-layout {
    padding: 2rem;
    width: 100%;
}

.providers-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-radius: 8px;
}

.providers-header h2 {
    color: #f3f4f6;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.voice-provider-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.voice-provider-card:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.2);
}

.voice-provider-card.configured {
    border-color: #10b981;
}

.provider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.provider-header h3 {
    color: #f3f4f6;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.external-link {
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s ease;
}

.external-link:hover {
    color: #9ca3af;
}

.provider-description {
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.provider-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.provider-status.not-configured {
    color: #fbbf24;
}

.provider-status.configured {
    color: #10b981;
}

.provider-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.provider-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.provider-field label {
    color: #d1d5db;
    font-size: 0.875rem;
    font-weight: 500;
}

.provider-input {
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 6px;
    padding: 0.75rem;
    color: #f3f4f6;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.provider-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.provider-input::placeholder {
    color: #9ca3af;
}

.save-btn {
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.save-btn:hover {
    background: #3730a3;
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.add-custom-provider {
    display: flex;
    justify-content: center;
}

.add-custom-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    color: #9ca3af;
    border: 2px dashed #4b5563;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-custom-btn:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.05);
}

/* Modal Enhancements */
.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control[type="password"] {
    font-family: monospace;
}

/* Status Messages */
.status-message {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    max-width: 400px;
}

.status-message.success {
    background: #10b981;
    color: white;
}

.status-message.error {
    background: #ef4444;
    color: white;
}

/* Dark theme overrides for voice providers */
#integrations-tab .tab-content {
    background: #111827;
    color: #f3f4f6;
}

/* Modal styles for dark theme */
#custom-provider-modal .modal-content {
    background: #1f2937;
    color: #f3f4f6;
}

#custom-provider-modal .form-control {
    background: #374151;
    border: 1px solid #4b5563;
    color: #f3f4f6;
}

#custom-provider-modal .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#custom-provider-modal .form-control::placeholder {
    color: #9ca3af;
}

#custom-provider-modal label {
    color: #d1d5db;
}

/* Pulse animation for highlighting integrations tab */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.02); 
        opacity: 0.8; 
        box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
    }
}
