/* IVR Flow Manager - Main Styles */

:root {
    --primary: #2563eb;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
}

body {
    background-color: #f1f5f9;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Enhanced Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Flow Builder Styles */
.flow-canvas {
    background: #fff;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    min-height: 600px;
    position: relative;
    overflow: auto;
    padding: 20px;
}

.tool-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: move;
    transition: all 0.2s;
    text-align: center;
}

.tool-item:hover {
    background: #f0f9ff;
    border-color: #3b82f6;
    transform: translateX(5px);
}

.tool-item i {
    display: block;
    font-size: 24px;
    margin-bottom: 5px;
    color: #3b82f6;
}

/* Flow Steps */
.flow-step {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin: 10px;
    position: relative;
    min-width: 200px;
    cursor: move;
    transition: all 0.2s;
}

.flow-step.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.flow-step.dragging {
    opacity: 0.5;
}

.flow-step-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
}

.flow-step-header i {
    margin-right: 8px;
    color: #3b82f6;
}

.flow-step-content {
    color: #64748b;
    font-size: 14px;
}

.flow-step-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.flow-step:hover .flow-step-actions {
    opacity: 1;
}

.flow-step-actions button {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
}

.flow-step-actions button:hover {
    color: #475569;
}

/* Connection Lines */
.flow-connection {
    position: absolute;
    background: #3b82f6;
    height: 2px;
    transform-origin: left center;
    pointer-events: none;
}

.flow-connection::after {
    content: '';
    position: absolute;
    right: -6px;
    top: -4px;
    width: 0;
    height: 0;
    border-left: 8px solid #3b82f6;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

/* Properties Panel */
#propertiesPanel .property-group {
    margin-bottom: 20px;
}

#propertiesPanel .property-group label {
    font-weight: 600;
    color: #475569;
    font-size: 14px;
    margin-bottom: 5px;
    display: block;
}

#propertiesPanel .form-control,
#propertiesPanel .form-select {
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

#propertiesPanel .form-control:focus,
#propertiesPanel .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Variable Picker */
.variable-picker {
    position: relative;
}

.variable-picker-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.variable-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.variable-list.show {
    display: block;
}

.variable-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.variable-item:hover {
    background: #f0f9ff;
}

.variable-item .var-name {
    font-weight: 600;
    color: #1e293b;
}

.variable-item .var-value {
    font-size: 12px;
    color: #64748b;
    margin-left: 10px;
}

/* Test Output */
#testOutput {
    background: #1e293b;
    color: #10b981;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

#testOutput .log-entry {
    padding: 4px 0;
    border-bottom: 1px solid #334155;
}

#testOutput .log-time {
    color: #64748b;
    margin-right: 10px;
}

#testOutput .log-level-info {
    color: #3b82f6;
}

#testOutput .log-level-success {
    color: #10b981;
}

#testOutput .log-level-warning {
    color: #f59e0b;
}

#testOutput .log-level-error {
    color: #ef4444;
}

/* Available Variables Display */
#availableVars {
    background: #f8fafc;
    font-size: 13px;
}

#availableVars .var-badge {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    margin: 2px;
    cursor: pointer;
    font-size: 12px;
}

#availableVars .var-badge:hover {
    background: #2563eb;
}

/* Dashboard Stats */
.card.text-white {
    border: none;
    background: linear-gradient(135deg, var(--bs-bg-opacity, 1) 0%, rgba(0, 0, 0, 0.1) 100%);
}

.card.text-white .card-title {
    opacity: 0.9;
    font-size: 14px;
    font-weight: 500;
}

.card.text-white h2 {
    font-weight: 700;
    margin: 0;
}

/* Recent Activity Lists */
.list-group-item {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 0;
}

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

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.activity-icon.success {
    background: #d1fae5;
    color: #10b981;
}

.activity-icon.warning {
    background: #fed7aa;
    color: #f59e0b;
}

.activity-icon.error {
    background: #fee2e2;
    color: #ef4444;
}

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

.badge.bg-success {
    background-color: #d1fae5 !important;
    color: #065f46;
}

.badge.bg-warning {
    background-color: #fed7aa !important;
    color: #92400e;
}

.badge.bg-danger {
    background-color: #fee2e2 !important;
    color: #991b1b;
}

/* Responsive Tables */
.table {
    font-size: 14px;
}

.table th {
    border-top: none;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    padding: 12px 8px;
}

/* Action Buttons in Tables */
.btn-group-sm .btn {
    padding: 4px 10px;
    font-size: 13px;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay.d-none {
    display: none !important;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: slideIn 0.3s ease-out;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .flow-canvas {
        min-height: 400px;
    }

    #flowBuilderModal .modal-dialog {
        margin: 0;
    }

    #flowBuilderModal .col-md-2,
    #flowBuilderModal .col-md-3,
    #flowBuilderModal .col-md-7 {
        border: none !important;
        margin-bottom: 20px;
    }
}