/* Custom CSS for PineCoder */

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.2s ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

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

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

/* Custom focus styles */
.custom-focus:focus {
    outline: none;
    box-shadow: 0 0 0 2px #1e40af;
    border-color: transparent;
}

/* Modal animations */
.modal-enter {
    opacity: 0;
    transform: scale(0.95);
}

.modal-enter-active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.modal-exit {
    opacity: 1;
    transform: scale(1);
}

.modal-exit-active {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s ease-in, transform 0.15s ease-in;
}

/* Strategy element cards */
.strategy-element-card {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    transition: all 0.2s ease-in-out;
}

.strategy-element-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

/* Condition row styling */
.condition-row {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: all 0.2s ease-in-out;
}

.condition-row:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* Toggle button styling */
.toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.25rem;
}

.toggle-btn .toggle-option {
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.toggle-btn .toggle-option.active {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.toggle-btn .toggle-option:not(.active) {
    color: #6b7280;
}

.toggle-btn .toggle-option:not(.active):hover {
    background: #e2e8f0;
    color: #374151;
}

/* Collapsible section animations */
.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.collapsible-content.expanded {
    max-height: 2000px; /* Large enough to accommodate content */
}

/* Equation builder specific styles */
.equation-builder {
    min-height: 200px;
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    background: #f8fafc;
    transition: all 0.2s ease-in-out;
}

.equation-builder.drag-over {
    border-color: #3b82f6;
    background: #dbeafe;
}

.equation-element {
    background: #3b82f6;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    margin: 0.25rem;
    cursor: move;
    user-select: none;
}

.equation-operator {
    background: #059669;
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 50%;
    margin: 0.25rem;
    cursor: move;
    user-select: none;
    min-width: 2rem;
    text-align: center;
}

/* Nested indicator styling */
.nested-indicator {
    margin-left: 1rem;
    border-left: 2px solid #e2e8f0;
    padding-left: 1rem;
    background: #f9fafb;
    border-radius: 0 0.375rem 0.375rem 0;
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .condition-row .grid-cols-4 > *:nth-child(3),
    .condition-row .grid-cols-4 > *:nth-child(4) {
        margin-top: 0.5rem;
    }
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    animation: spin 1s linear infinite;
}

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

/* Color picker custom styling */
.color-picker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.375rem;
    cursor: pointer;
}

.color-picker::-webkit-color-swatch {
    border-radius: 0.25rem;
    border: none;
}

.color-picker::-moz-color-swatch {
    border-radius: 0.25rem;
    border: none;
}

/* Value tooltip for indicator parameters */
.value-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-left: 0.375rem;
    background: #94a3b8;
    color: #ffffff;
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: 700;
    cursor: help;
    position: relative;
    vertical-align: middle;
    line-height: 1;
}

.value-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: -4px;
    background: #1e293b;
    color: #ffffff;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
}

.value-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 2px;
    border: 4px solid transparent;
    border-top-color: #1e293b;
    z-index: 50;
    pointer-events: none;
}

/* Webhook wizard step styling */
.webhook-step {
    display: none;
}

.webhook-step.active {
    display: block;
}

.webhook-warning {
    background-color: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 1.5rem;
    color: #92400e;
}

/* Form validation styling */
.form-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success styling */
.success-message {
    color: #059669;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}
