/**
 * FilamentPHP Builder v3 - Custom Styles
 * Separated from the main HTML for better maintainability
 */

/* Canvas Grid Background */
.canvas-grid {
    background-color: #f8fafc;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
}

.canvas-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.03), transparent 70%);
    pointer-events: none;
}

/* Drag and Drop Styles */
.drag-over {
    background-color: #dbeafe;
    border: 3px dashed #3b82f6;
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.1),
        0 0 20px rgba(59, 130, 246, 0.2),
        inset 0 0 60px rgba(59, 130, 246, 0.05);
    transform: scale(1.02);
    animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow:
            0 0 0 4px rgba(59, 130, 246, 0.1),
            0 0 20px rgba(59, 130, 246, 0.2),
            inset 0 0 60px rgba(59, 130, 246, 0.05);
    }
    50% {
        box-shadow:
            0 0 0 8px rgba(59, 130, 246, 0.15),
            0 0 30px rgba(59, 130, 246, 0.3),
            inset 0 0 80px rgba(59, 130, 246, 0.08);
    }
}

.dragging {
    opacity: 0.5;
    transform: rotate(3deg) scale(0.95);
    cursor: grabbing !important;
    filter: brightness(1.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
}

/* Drag Ghost/Preview */
.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.8;
    transform: rotate(-5deg);
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.3));
    animation: float 0.3s ease-out;
}

@keyframes float {
    from {
        transform: rotate(-5deg) scale(0.9);
        opacity: 0.4;
    }
    to {
        transform: rotate(-5deg) scale(1);
        opacity: 0.8;
    }
}

/* Drop zone indicators */
.drop-zone-indicator {
    position: relative;
}

.drop-zone-indicator::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 3px solid transparent;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    pointer-events: none;
}

.drop-zone-indicator:hover::before {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.02);
}

.drop-zone-active::before {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.05) !important;
    animation: glow-pulse 1s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
    }
}

/* Drop success feedback */
.drop-success {
    animation: drop-success-flash 0.6s ease-out;
}

@keyframes drop-success-flash {
    0% {
        background-color: rgba(34, 197, 94, 0.1);
        border-color: #22c55e;
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
    }
    50% {
        background-color: rgba(34, 197, 94, 0.2);
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

.nested-dropzone {
    min-height: 120px;
    border: 2px dashed #cbd5e1;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.nested-dropzone::after {
    content: 'Drop components here';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0.5;
}

.nested-dropzone:not(:empty)::after {
    display: none;
}

.nested-dropzone.drag-over {
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), inset 0 0 20px rgba(59, 130, 246, 0.05);
    transform: scale(1.02);
}

/* Smooth transitions */
* {
    transition: all 0.2s ease;
}

/* Code display styles */
pre {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 0.5rem;
    overflow-x: auto;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Component card gradients */
.component-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.layout-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Component Cards on Canvas */
.component-container {
    background: white;
    border-radius: 1rem;
    border: 2px solid #e5e7eb;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

/* Animated top accent bar */
.component-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1rem 1rem 0 0;
}

/* Glowing border effect on hover */
.component-container::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
}

.component-container:hover::before {
    transform: scaleX(1);
}

.component-container:hover::after {
    opacity: 0.15;
}

.component-container:hover {
    border-color: #cbd5e1;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(99, 102, 241, 0.1),
        0 0 30px rgba(99, 102, 241, 0.1);
    transform: translateY(-4px) scale(1.01);
}

/* Active state when dragging over */
.component-container:active,
.component-container.active {
    transform: translateY(0) scale(0.99);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.component-container-layout {
    border-color: #f9a8d4;
    background: linear-gradient(135deg, #ffffff 0%, #fef3f7 100%);
}

.component-container-layout::before {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.component-container-layout::after {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.component-container-layout:hover {
    box-shadow:
        0 20px 25px -5px rgba(240, 147, 251, 0.15),
        0 10px 10px -5px rgba(245, 87, 108, 0.1),
        0 0 0 1px rgba(240, 147, 251, 0.15),
        0 0 30px rgba(240, 147, 251, 0.2);
}

.component-container-field {
    border-color: #93c5fd;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.component-container-field::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.component-container-field::after {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Component Header */
.component-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.component-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.component-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect */
.component-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.component-container:hover .component-badge::before {
    left: 100%;
}

.component-badge-layout {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #be185d;
    border: 1.5px solid #f9a8d4;
    box-shadow:
        0 1px 2px rgba(190, 24, 93, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.component-badge-layout:hover {
    background: linear-gradient(135deg, #fbcfe8 0%, #f9a8d4 100%);
    transform: scale(1.05);
    box-shadow:
        0 2px 4px rgba(190, 24, 93, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.component-badge-field {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1.5px solid #93c5fd;
    box-shadow:
        0 1px 2px rgba(30, 64, 175, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.component-badge-field:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
    transform: scale(1.05);
    box-shadow:
        0 2px 4px rgba(30, 64, 175, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

/* Component Actions */
.component-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.component-container:hover .component-actions {
    opacity: 1;
    transform: translateX(0);
}

.component-action-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: white;
    border: 1.5px solid #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Ripple effect background */
.component-action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.component-action-btn:hover::before {
    opacity: 1;
}

.component-action-btn:hover {
    background: #f9fafb;
    color: #111827;
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.15),
        0 2px 4px -1px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.component-action-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Danger button styles */
.component-action-btn.danger::before {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.1) 0%, transparent 70%);
}

.component-action-btn.danger:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
    box-shadow:
        0 4px 6px -1px rgba(220, 38, 38, 0.2),
        0 2px 4px -1px rgba(220, 38, 38, 0.1);
}

/* Duplicate button styles */
.component-action-btn.duplicate::before {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

.component-action-btn.duplicate:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
    box-shadow:
        0 4px 6px -1px rgba(59, 130, 246, 0.2),
        0 2px 4px -1px rgba(59, 130, 246, 0.1);
}

/* Staggered animation for action buttons */
.component-action-btn:nth-child(1) {
    transition-delay: 0s;
}

.component-action-btn:nth-child(2) {
    transition-delay: 0.05s;
}

.component-action-btn:nth-child(3) {
    transition-delay: 0.1s;
}

.component-action-btn:nth-child(4) {
    transition-delay: 0.15s;
}

/* Component border colors (legacy) */
.component-border-layout {
    border-color: #f9a8d4;
    background-color: #fdf2f8;
}

.component-border-field {
    border-color: #93c5fd;
    background-color: #eff6ff;
}

/* Tab and Wizard navigation */
.tab-button {
    transition: all 0.2s ease;
}

.tab-button:hover {
    transform: translateY(-1px);
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Toast notifications (for future use) */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

/* Modal styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Empty state styles */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

/* Property editor styles */
.property-group {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.property-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
}

/* Code highlighting (basic) */
.code-keyword {
    color: #c678dd;
}

.code-string {
    color: #98c379;
}

.code-comment {
    color: #5c6370;
    font-style: italic;
}

.code-function {
    color: #61afef;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        margin: 1rem;
    }

    .component-card,
    .layout-card {
        font-size: 0.875rem;
    }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
    /* Will be implemented in future version */
}

/* Utility classes */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Component preview styles */
.component-preview {
    border: 1px dashed #cbd5e1;
    border-radius: 0.375rem;
    padding: 0.5rem;
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.component-preview:empty::before {
    content: 'Drop components here';
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Enhanced Input Fields */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid #e5e7eb;
    background: #ffffff;
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
select:hover,
textarea:hover {
    border-color: #cbd5e1;
    background: #f9fafb;
}

/* Focus states with glowing effect */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

/* Checkbox and Toggle styling */
input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.375rem;
    border: 1.5px solid #cbd5e1;
    transition: all 0.2s ease;
    cursor: pointer;
}

input[type="checkbox"]:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

/* Label improvements */
label {
    font-weight: 500;
    color: #374151;
    transition: color 0.2s ease;
}

label:hover {
    color: #111827;
}

/* Button styles */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

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

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

/* ============================================================
   FilamentPHP v4 Preview Styles
   ============================================================ */

.fi-preview {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Form Input Styles */
.fi-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s;
}

.fi-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

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

/* Label Styles */
.fi-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.fi-label-required::after {
    content: " *";
    color: #ef4444;
}

/* Section Styles */
.fi-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.fi-section-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.fi-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.fi-section-description {
    font-size: 0.875rem;
    color: #6b7280;
}

.fi-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    margin-right: 0.75rem;
    background: #f3f4f6;
}

/* Grid Styles */
.fi-grid {
    display: grid;
    gap: 1rem;
}

.fi-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.fi-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fi-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fi-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fi-grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Fieldset Styles */
.fi-fieldset {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.fi-fieldset-legend {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

/* Tabs Styles */
.fi-tabs {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.fi-tabs-header {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.fi-tab {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.fi-tab-active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
    background: white;
}

.fi-tab-content {
    padding: 1.5rem;
}

/* Wizard Styles */
.fi-wizard {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.fi-wizard-steps {
    display: flex;
    background: #f9fafb;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    gap: 0.5rem;
}

.fi-wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 0.5rem;
}

.fi-wizard-step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.fi-wizard-step-active .fi-wizard-step-number {
    background: #f59e0b;
    color: white;
}

.fi-wizard-step-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.fi-wizard-step-active .fi-wizard-step-label {
    color: #f59e0b;
    font-weight: 600;
}

.fi-wizard-content {
    padding: 1.5rem;
}

/* Checkbox & Toggle Styles */
.fi-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    accent-color: #f59e0b;
    transition: all 0.2s;
}

.fi-checkbox:hover {
    border-color: #f59e0b;
}

.fi-checkbox:checked {
    background: #f59e0b;
    border-color: #f59e0b;
}

.fi-toggle {
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 9999px;
    appearance: none;
    background: #e5e7eb;
    position: relative;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.fi-toggle:hover {
    background: #d1d5db;
}

.fi-toggle:checked {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.fi-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1rem;
    height: 1rem;
    background: white;
    border-radius: 9999px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.fi-toggle:checked::after {
    transform: translateX(1.25rem);
}

/* Select Styles */
.fi-select {
    width: 100%;
    padding: 0.625rem 2rem 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: white url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 0.5rem center/1.25rem;
    appearance: none;
}

/* Textarea Styles */
.fi-textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: white;
    min-height: 100px;
    resize: vertical;
}

/* File Upload Styles */
.fi-file-upload {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2.5rem;
    text-align: center;
    background: linear-gradient(135deg, #fafafa 0%, #f9fafb 100%);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.fi-file-upload::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(245, 158, 11, 0.05), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.fi-file-upload:hover {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
    transform: translateY(-2px);
}

.fi-file-upload:hover::before {
    opacity: 1;
}

.fi-file-upload-icon {
    font-size: 2.5rem;
    color: #f59e0b;
    margin-bottom: 0.75rem;
    opacity: 0.7;
    transition: all 0.3s;
}

.fi-file-upload:hover .fi-file-upload-icon {
    opacity: 1;
    transform: scale(1.1);
}

.fi-file-upload-text {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Rich Editor Placeholder */
.fi-rich-editor {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    min-height: 250px;
    background: white;
    overflow: hidden;
}

.fi-rich-editor-toolbar {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
    padding: 0.5rem;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.fi-rich-editor-button {
    padding: 0.5rem 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.fi-rich-editor-button:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.fi-rich-editor-button:active {
    background: #e5e7eb;
    transform: scale(0.95);
}

/* Radio Button Styles */
.fi-radio {
    width: 1.125rem;
    height: 1.125rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
    accent-color: #f59e0b;
}

.fi-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fi-radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Color Picker Styles */
.fi-color-picker {
    width: 100%;
    height: 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
}

/* Date Time Picker Styles */
.fi-datetime-picker {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: white;
}

/* Field Wrapper */
.fi-field {
    margin-bottom: 1.25rem;
}

/* Helper Text */
.fi-helper-text {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.375rem;
}

/* ============================================================
   NEW COMPONENT STYLES - FilamentPHP v4 Design
   ============================================================ */

/* Checkbox List Styles */
.fi-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.fi-checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    cursor: pointer;
}

.fi-checkbox-option:hover {
    background: #f9fafb;
}

/* Tags Input Styles */
.fi-tags-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    transition: all 0.2s;
}

.fi-tags-input:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.fi-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.fi-tag:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fi-tag-remove {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.fi-tag-remove:hover {
    opacity: 1;
}

.fi-tags-input-field {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    font-size: 0.875rem;
    padding: 0.25rem;
    background: transparent;
}

/* Key-Value Styles */
.fi-key-value {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.fi-key-value-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.fi-key-value-row:hover {
    background: #f3f4f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.fi-key-value-key,
.fi-key-value-value {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s;
}

.fi-key-value-key:focus,
.fi-key-value-value:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.fi-key-value-remove {
    padding: 0.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.375rem;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.fi-key-value-remove:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.2);
}

.fi-key-value-add {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: white;
    border: 1px dashed #d1d5db;
    border-radius: 0.375rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.fi-key-value-add:hover {
    background: #f9fafb;
    border-color: #f59e0b;
    color: #f59e0b;
    border-style: solid;
}

/* Markdown Editor Styles */
.fi-markdown-editor {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    overflow: hidden;
    background: white;
}

.fi-markdown-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.fi-toolbar-button {
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.fi-toolbar-button:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.fi-toolbar-button:active {
    background: #e5e7eb;
}

.fi-markdown-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: none;
    outline: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
}

/* Repeater Styles */
.fi-repeater {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.fi-repeater-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.fi-repeater-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.fi-repeater-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.fi-repeater-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

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

.fi-repeater-action {
    padding: 0.375rem 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.fi-repeater-action:hover {
    background: #f3f4f6;
    color: #374151;
}

.fi-repeater-content {
    padding: 1rem;
}

.fi-repeater-add {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: white;
    border: 1px dashed #d1d5db;
    border-radius: 0.375rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.fi-repeater-add:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: white;
    border-style: solid;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* Builder Styles */
.fi-builder {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.fi-builder-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.fi-builder-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.fi-builder-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
}

.fi-builder-header i {
    color: #f59e0b;
    font-size: 1rem;
}

.fi-builder-label {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

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

.fi-builder-action {
    padding: 0.375rem 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.fi-builder-action:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.fi-builder-content {
    padding: 1rem;
}

.fi-builder-add {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: white;
    border: 1px dashed #d1d5db;
    border-radius: 0.375rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.fi-builder-add:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: white;
    border-style: solid;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* Toggle Buttons Styles */
.fi-toggle-buttons {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
}

.fi-toggle-button {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.fi-toggle-button:hover {
    background: white;
    color: #374151;
}

.fi-toggle-button-active {
    background: white;
    color: #f59e0b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Slider Styles */
.fi-slider-container {
    padding: 1rem;
}

.fi-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #dbeafe 0%, #3b82f6 50%, #1e40af 100%);
    border-radius: 4px;
    outline: none;
    transition: opacity 0.2s;
}

.fi-slider:hover {
    opacity: 0.9;
}

.fi-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.fi-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.fi-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.fi-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.fi-slider-value-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

/* ============================================================
   Component Button Styles (Sidebar) - Compact Horizontal Layout
   ============================================================ */

.component-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
    cursor: grab;
    transition: all 0.15s;
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.component-btn:active {
    cursor: grabbing;
}

/* Layout button styling */
.component-btn.layout-btn {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #be185d;
    border-color: #f9a8d4;
}

.component-btn.layout-btn:hover {
    background: linear-gradient(135deg, #fbcfe8 0%, #f9a8d4 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(190, 24, 93, 0.25);
    border-color: #ec4899;
}

/* Field button styling */
.component-btn.field-btn {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-color: #93c5fd;
}

.component-btn.field-btn:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25);
    border-color: #3b82f6;
}

/* Active/dragging state */
.component-btn.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Icon styling */
.component-btn i {
    flex-shrink: 0;
}

/* Text styling */
.component-btn span {
    line-height: 1.2;
}

/* ============================================================
   Canvas Internal Drag and Drop Styles
   ============================================================ */

/* Drag handle styling */
.drag-handle {
    cursor: grab;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.drag-handle:hover {
    opacity: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Component being dragged */
.component-container.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Drop indicators */
.drop-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    pointer-events: none;
    z-index: 10;
    transition: all 0.2s ease;
}

.drop-indicator-top {
    top: -2px;
}

.drop-indicator-bottom {
    bottom: -2px;
}

/* Active drop indicator when dragging over */
.component-container.drag-over-top .drop-indicator-top {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    height: 4px;
}

.component-container.drag-over-bottom .drop-indicator-bottom {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    height: 4px;
}

/* Component container when drag is over it */
.component-container.drag-over-top {
    border-top-color: #3b82f6;
    border-top-width: 2px;
}

.component-container.drag-over-bottom {
    border-bottom-color: #3b82f6;
    border-bottom-width: 2px;
}

/* Prevent text selection while dragging */
.component-container[draggable="true"] {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    position: relative;
}
