/**
 * INSERTR CSS - Centralized Styles for Content Management Interface
 * 
 * Architecture: Simple class-based CSS with proper specificity
 * - Class selectors (0,0,1,0) automatically beat universal selectors (0,0,0,0)
 * - No cascade layers needed - works in all browsers
 * - No !important needed - specificity handles conflicts naturally
 * - Explicit colors prevent inheritance issues
 * 
 * Components:
 * - .insertr-gate: Minimal styling for user-defined gates
 * - .insertr-auth-*: Authentication controls and buttons  
 * - .insertr-form-*: Modal forms and inputs
 * - .insertr-style-aware-*: Style-aware editor components
 */

/* =================================================================
   CSS CUSTOM PROPERTIES (CSS VARIABLES)
   ================================================================= */

:root {
    /* Core theme colors */
    --insertr-primary: #007bff;
    --insertr-primary-hover: #0056b3;
    --insertr-success: #28a745;
    --insertr-danger: #dc3545;
    --insertr-warning: #ffc107;
    --insertr-info: #17a2b8;
    
    /* Text colors */
    --insertr-text-primary: #333333;
    --insertr-text-secondary: #666666;
    --insertr-text-muted: #999999;
    --insertr-text-inverse: #ffffff;
    
    /* Background colors */
    --insertr-bg-primary: #ffffff;
    --insertr-bg-secondary: #f8f9fa;
    --insertr-bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Border and spacing */
    --insertr-border-color: #dee2e6;
    --insertr-border-radius: 4px;
    --insertr-spacing-xs: 4px;
    --insertr-spacing-sm: 8px;
    --insertr-spacing-md: 16px;
    --insertr-spacing-lg: 24px;
    
    /* Z-index management */
    --insertr-z-modal-backdrop: 1040;
    --insertr-z-modal: 1050;
    --insertr-z-tooltip: 1070;
    --insertr-z-overlay: 999999;
    
    /* Typography */
    --insertr-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --insertr-font-size-sm: 12px;
    --insertr-font-size-base: 14px;
    --insertr-line-height: 1.4;
    
    /* Form elements - using existing variables */
    
    /* Animation */
    --insertr-transition: all 0.2s ease-in-out;
}

/* =================================================================
   USER-DEFINED GATES
   Minimal styling - developers control appearance
   ================================================================= */

.insertr-gate {
    cursor: pointer;
    user-select: none;
}

/* =================================================================
   UNIFIED CONTROL PANEL
   ================================================================= */

.insertr-control-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: var(--insertr-z-overlay);
    display: flex;
    flex-direction: column;
    gap: var(--insertr-spacing-sm);
    font-family: var(--insertr-font-family);
    font-size: var(--insertr-font-size-base);
    max-width: 280px;
}

/* Status Section */
.insertr-status-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--insertr-spacing-xs);
}

.insertr-status-indicator {
    background: var(--insertr-bg-primary);
    color: var(--insertr-text-primary);
    border: 1px solid var(--insertr-border-color);
    border-radius: var(--insertr-border-radius);
    padding: var(--insertr-spacing-xs) var(--insertr-spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--insertr-spacing-xs);
    font-size: var(--insertr-font-size-sm);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: var(--insertr-transition);
}

.insertr-status-text {
    margin: 0;
    padding: 0;
    font-weight: 500;
    color: inherit;
    white-space: nowrap;
}

.insertr-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: var(--insertr-transition);
}

.insertr-status-visitor {
    background: var(--insertr-text-muted);
}

.insertr-status-authenticated {
    background: var(--insertr-primary);
}

.insertr-status-editing {
    background: var(--insertr-success);
    animation: insertr-pulse 2s infinite;
}

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

/* Action Buttons Section */
.insertr-action-section {
    display: flex;
    flex-direction: column;
    gap: var(--insertr-spacing-xs);
}

.insertr-action-btn {
    background: var(--insertr-primary);
    color: var(--insertr-text-inverse);
    border: none;
    border-radius: var(--insertr-border-radius);
    padding: var(--insertr-spacing-sm) var(--insertr-spacing-md);
    margin: 0;
    font-family: var(--insertr-font-family);
    font-size: var(--insertr-font-size-base);
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    transition: var(--insertr-transition);
    line-height: var(--insertr-line-height);
    min-width: 120px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.insertr-action-btn:hover {
    background: var(--insertr-primary-hover);
    color: var(--insertr-text-inverse);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.insertr-action-btn:focus {
    outline: 2px solid var(--insertr-primary);
    outline-offset: 2px;
}

.insertr-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.insertr-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Button Type Variants */
.insertr-enhance-btn {
    background: var(--insertr-info);
}

.insertr-enhance-btn:hover {
    background: #138496;
}

.insertr-edit-btn.insertr-edit-active {
    background: var(--insertr-success);
}

.insertr-edit-btn.insertr-edit-active:hover {
    background: #1e7e34;
}

.insertr-auth-btn.insertr-authenticated {
    background: var(--insertr-text-secondary);
}

.insertr-auth-btn.insertr-authenticated:hover {
    background: var(--insertr-text-primary);
}

/* =================================================================
   EDITING INDICATORS
   Visual feedback for editable content
   ================================================================= */

.insertr-editing-hover {
    outline: 2px dashed var(--insertr-primary);
    outline-offset: 2px;
    background: rgba(0, 123, 255, 0.05);
    position: relative;
    transition: var(--insertr-transition);
}

.insertr-editing-hover::after {
    content: '✏️ Click to edit';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--insertr-text-primary);
    color: var(--insertr-text-inverse);
    padding: var(--insertr-spacing-xs) var(--insertr-spacing-sm);
    border-radius: var(--insertr-border-radius);
    font-size: var(--insertr-font-size-sm);
    font-family: var(--insertr-font-family);
    white-space: nowrap;
    z-index: var(--insertr-z-tooltip);
    opacity: 0;
    animation: insertr-tooltip-show 0.2s ease-in-out forwards;
}

@keyframes insertr-tooltip-show {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Hide editing indicators when not in edit mode */
body:not(.insertr-edit-mode) .insertr-editing-hover {
    outline: none;
    background: transparent;
}

body:not(.insertr-edit-mode) .insertr-editing-hover::after {
    display: none;
}

/* =================================================================
   MODAL OVERLAY & CONTAINER
   ================================================================= */

.insertr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--insertr-bg-overlay);
    z-index: var(--insertr-z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--insertr-spacing-lg);
    margin: 0;
}

.insertr-modal-container {
    background: var(--insertr-bg-primary);
    color: var(--insertr-text-primary);
    border-radius: var(--insertr-border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: var(--insertr-z-modal);
    margin: 0;
    padding: 0;
}

/* =================================================================
   STYLE-AWARE EDITOR STYLES
   Modern interface for content editing with style preservation
   ================================================================= */

/* Main editor container */
.insertr-style-aware-editor {
    background: var(--insertr-bg-primary);
    border: 1px solid var(--insertr-border-color);
    border-radius: var(--insertr-border-radius);
    padding: var(--insertr-spacing-lg);
    min-width: 400px;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: var(--insertr-font-family);
    color: var(--insertr-text-primary);
}

/* Style toolbar */
.insertr-style-toolbar {
    display: flex;
    align-items: center;
    gap: var(--insertr-spacing-xs);
    padding: var(--insertr-spacing-sm);
    background: var(--insertr-bg-secondary);
    border: 1px solid var(--insertr-border-color);
    border-radius: var(--insertr-border-radius);
    margin-bottom: var(--insertr-spacing-md);
    flex-wrap: wrap;
}

.insertr-toolbar-title {
    font-size: var(--insertr-font-size-sm);
    font-weight: 500;
    color: var(--insertr-text-muted);
    margin-right: var(--insertr-spacing-xs);
}

.insertr-style-btn {
    background: var(--insertr-bg-primary);
    border: 1px solid var(--insertr-border-color);
    border-radius: var(--insertr-border-radius);
    padding: var(--insertr-spacing-xs) var(--insertr-spacing-sm);
    font-size: var(--insertr-font-size-sm);
    font-weight: 500;
    color: var(--insertr-text-primary);
    cursor: pointer;
    transition: var(--insertr-transition);
}

.insertr-style-btn:hover {
    background: var(--insertr-bg-secondary);
    border-color: var(--insertr-text-muted);
}

.insertr-style-btn:active {
    background: var(--insertr-border-color);
    transform: translateY(1px);
}

/* Style preview buttons - three-layer architecture for style isolation */
.insertr-style-btn.insertr-style-preview {
    /* Strong button container - prevents content from affecting button structure */
    background: var(--insertr-bg-primary) !important;
    border: 1px solid var(--insertr-border-color) !important;
    border-radius: var(--insertr-border-radius) !important;
    padding: 6px 10px !important; /* Move padding to button level */
    font-size: var(--insertr-font-size-sm);
    cursor: pointer;
    transition: var(--insertr-transition);
    
    /* Fixed button dimensions and layout */
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    /* Reset button-level text properties to prevent inheritance */
    font-family: var(--insertr-font-family);
    text-decoration: none;
    font-weight: normal;
    text-transform: none;
    color: var(--insertr-text-primary);
}

/* Button frame - minimal layout container with no padding */
.insertr-button-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    /* Create style containment boundary */
    contain: layout style;
    overflow: hidden;
}

/* Style sample - authentic style preview with NO resets */
.insertr-style-sample {
    /* Authentic style preview - let all styling come through naturally */
    display: inline-block;
    
    /* Size constraints only */
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    
    /* All other styling (color, weight, transform, decoration, etc.) 
       comes from applied classes - no interference */
}

/* Fallback styling when no meaningful classes are detected */
.insertr-style-sample.insertr-fallback-style {
    color: var(--insertr-text-primary);
}

/* Hover state for preview buttons - subtle visual feedback */
.insertr-style-btn.insertr-style-preview:hover {
    border-color: var(--insertr-text-muted);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Active state for preview buttons */
.insertr-style-btn.insertr-style-preview:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Active/applied formatting state - shows current selection has this formatting */
.insertr-style-btn.insertr-style-active {
    background: var(--insertr-primary);
    border-color: var(--insertr-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.insertr-style-btn.insertr-style-active .insertr-style-sample {
    color: white;
}

.insertr-style-btn.insertr-style-active:hover {
    background: var(--insertr-primary-hover);
    border-color: var(--insertr-primary-hover);
    transform: none;
}



/* Editor components */
.insertr-simple-editor,
.insertr-rich-editor,
.insertr-fallback-textarea {
    width: 100%;
    border: 1px solid var(--insertr-border-color);
    border-radius: var(--insertr-border-radius);
    padding: var(--insertr-spacing-md);
    font-size: var(--insertr-font-size-base);
    line-height: var(--insertr-line-height);
    font-family: var(--insertr-font-family);
    color: var(--insertr-text-primary);
    background: var(--insertr-bg-primary);
    margin-bottom: var(--insertr-spacing-md);
    transition: var(--insertr-transition);
    box-sizing: border-box;
}

.insertr-simple-editor:focus,
.insertr-rich-editor:focus,
.insertr-fallback-textarea:focus {
    outline: none;
    border: 1px solid var(--insertr-primary);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.insertr-simple-editor,
.insertr-fallback-textarea {
    resize: vertical;
    min-height: 120px;
}

.insertr-rich-editor {
    min-height: 100px;
    overflow-y: auto;
}

/* =================================================================
   MULTI-PROPERTY FORM COMPONENTS
   Professional form styling for direct editors (links, buttons, images)
   ================================================================= */

/* Direct editor container */
.insertr-direct-editor {
    background: var(--insertr-bg-primary);
    border: 1px solid var(--insertr-border-color);
    border-radius: var(--insertr-border-radius);
    padding: var(--insertr-spacing-lg);
    min-width: 400px;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: var(--insertr-font-family);
    color: var(--insertr-text-primary);
}

/* Form groups */
.insertr-form-group {
    margin-bottom: var(--insertr-spacing-md);
}

.insertr-form-group:last-child {
    margin-bottom: 0;
}

/* Form labels */
.insertr-form-label {
    display: block;
    margin-bottom: var(--insertr-spacing-xs);
    font-weight: 500;
    font-size: var(--insertr-font-size-sm);
    color: var(--insertr-text-primary);
    line-height: 1.4;
}

/* Form inputs and selects */
.insertr-form-input, 
.insertr-form-select {
    width: 100%;
    padding: var(--insertr-spacing-sm) var(--insertr-spacing-md);
    border: 1px solid var(--insertr-border-color);
    border-radius: var(--insertr-border-radius);
    font-size: var(--insertr-font-size-base);
    font-family: var(--insertr-font-family);
    line-height: 1.4;
    color: var(--insertr-text-primary);
    background: var(--insertr-bg-primary);
    transition: var(--insertr-transition);
    box-sizing: border-box;
}

/* Focus states */
.insertr-form-input:focus, 
.insertr-form-select:focus {
    outline: none;
    border-color: var(--insertr-primary);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Hover states for selects */
.insertr-form-select:hover {
    border-color: var(--insertr-text-secondary);
}

/* Disabled states */
.insertr-form-input:disabled, 
.insertr-form-select:disabled {
    background: var(--insertr-bg-secondary);
    color: var(--insertr-text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Error states */
.insertr-form-input.insertr-error, 
.insertr-form-select.insertr-error {
    border-color: var(--insertr-danger);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* Success states */
.insertr-form-input.insertr-success, 
.insertr-form-select.insertr-success {
    border-color: var(--insertr-success);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

/* Form validation messages */
.insertr-form-message {
    margin-top: var(--insertr-spacing-xs);
    font-size: var(--insertr-font-size-sm);
    line-height: 1.3;
}

.insertr-form-message.insertr-error {
    color: var(--insertr-danger);
}

.insertr-form-message.insertr-success {
    color: var(--insertr-success);
}

.insertr-form-message.insertr-info {
    color: var(--insertr-info);
}

/* Specific editor variants */
.insertr-link-editor {
    /* Link-specific styling if needed */
}

.insertr-button-editor {
    /* Button-specific styling if needed */
}

.insertr-image-editor {
    /* Image-specific styling if needed */
}

/* Form actions */
.insertr-form-actions {
    display: flex;
    gap: var(--insertr-spacing-sm);
    justify-content: flex-end;
    margin: 0;
    padding: var(--insertr-spacing-md) 0 0 0;
    border-top: 1px solid var(--insertr-border-color);
}

.insertr-btn-save,
.insertr-btn-cancel,
.insertr-btn-history {
    background: var(--insertr-primary);
    color: var(--insertr-text-inverse);
    border: none;
    border-radius: var(--insertr-border-radius);
    padding: var(--insertr-spacing-sm) var(--insertr-spacing-md);
    margin: 0;
    font-family: var(--insertr-font-family);
    font-size: var(--insertr-font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: var(--insertr-transition);
    line-height: var(--insertr-line-height);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
}

.insertr-btn-cancel {
    background: var(--insertr-text-secondary);
    color: var(--insertr-text-inverse);
}

.insertr-btn-cancel:hover {
    background: var(--insertr-text-primary);
    color: var(--insertr-text-inverse);
}

.insertr-btn-history {
    background: var(--insertr-info);
    color: var(--insertr-text-inverse);
    margin-right: auto;
}

.insertr-btn-history:hover {
    background: #138496;
    color: var(--insertr-text-inverse);
}

.insertr-btn-save:hover {
    background: var(--insertr-primary-hover);
    color: var(--insertr-text-inverse);
}

.insertr-btn-save:focus,
.insertr-btn-cancel:focus,
.insertr-btn-history:focus {
    outline: 2px solid var(--insertr-primary);
    outline-offset: 2px;
}

/* Fallback editor */
.insertr-fallback-editor {
    background: var(--insertr-bg-primary);
    border: 1px solid var(--insertr-border-color);
    border-radius: var(--insertr-border-radius);
    padding: var(--insertr-spacing-lg);
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: var(--insertr-font-family);
    color: var(--insertr-text-primary);
}



/* =================================================================
   STATUS AND FEEDBACK MESSAGES
   ================================================================= */

.insertr-status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--insertr-z-overlay);
    background: var(--insertr-bg-primary);
    color: var(--insertr-text-primary);
    border: 1px solid var(--insertr-border-color);
    border-radius: var(--insertr-border-radius);
    padding: var(--insertr-spacing-md);
    margin: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: var(--insertr-font-family);
    font-size: var(--insertr-font-size-base);
    line-height: var(--insertr-line-height);
    max-width: 300px;
    transition: var(--insertr-transition);
}

.insertr-status-message.success {
    border-color: var(--insertr-success);
    background: #d4edda;
    color: #155724;
}

.insertr-status-message.error {
    border-color: var(--insertr-danger);
    background: #f8d7da;
    color: #721c24;
}

.insertr-status-message.warning {
    border-color: var(--insertr-warning);
    background: #fff3cd;
    color: #856404;
}

.insertr-status-text {
    margin: 0;
    padding: 0;
    font-weight: 500;
    color: inherit;
}

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

.insertr-hide {
    display: none;
}

.insertr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */

@media (max-width: 768px) {
    .insertr-modal-overlay {
        padding: var(--insertr-spacing-sm);
    }

    .insertr-control-panel {
        bottom: 10px;
        right: 10px;
        max-width: 240px;
    }

    .insertr-action-btn {
        min-width: 100px;
        font-size: var(--insertr-font-size-sm);
        padding: var(--insertr-spacing-xs) var(--insertr-spacing-sm);
    }

    .insertr-status-indicator {
        font-size: 11px;
        padding: 3px var(--insertr-spacing-xs);
    }

    .insertr-editing-hover::after {
        font-size: 11px;
        padding: 2px var(--insertr-spacing-xs);
        top: -25px;
    }

    /* StyleAware Editor responsive adjustments */
    .insertr-style-aware-editor,
    .insertr-fallback-editor {
        min-width: 300px;
        max-width: calc(100vw - 2rem);
        padding: var(--insertr-spacing-md);
    }

    .insertr-style-toolbar {
        padding: var(--insertr-spacing-xs);
        gap: var(--insertr-spacing-xs);
    }

    .insertr-style-btn {
        padding: var(--insertr-spacing-xs);
        font-size: var(--insertr-font-size-sm);
    }

    .insertr-form-actions {
        flex-direction: column;
    }

    .insertr-btn-save,
    .insertr-btn-cancel {
        width: 100%;
    }

    .insertr-btn-history {
        margin-right: 0;
        order: -1;
    }
}

/* =================================================================
   COLLECTION MANAGEMENT STYLES (.insertr-add)
   ================================================================= */

/* Collection container when active */
.insertr-collection-active {
    outline: 2px dashed var(--insertr-primary);
    outline-offset: 4px;
    border-radius: var(--insertr-border-radius);
}

/* Add button positioned in top right of container */
.insertr-add-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    background: var(--insertr-primary);
    color: var(--insertr-text-inverse);
    border: none;
    padding: var(--insertr-spacing-xs) var(--insertr-spacing-sm);
    border-radius: var(--insertr-border-radius);
    font-size: var(--insertr-font-size-sm);
    font-weight: 600;
    cursor: pointer;
    z-index: var(--insertr-z-floating);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.insertr-add-btn:hover {
    background: var(--insertr-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

/* Item controls positioned in top right corner of each item */
.insertr-item-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: var(--insertr-z-floating);
}

/* Individual control buttons */
.insertr-control-btn {
    width: 20px;
    height: 20px;
    background: var(--insertr-bg-primary);
    border: 1px solid var(--insertr-border-color);
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--insertr-text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
}

.insertr-control-btn:hover {
    background: var(--insertr-bg-secondary);
    border-color: var(--insertr-primary);
    color: var(--insertr-primary);
    transform: scale(1.1);
}

/* Remove button specific styling */
.insertr-control-btn:last-child {
    color: var(--insertr-danger);
}

.insertr-control-btn:last-child:hover {
    background: var(--insertr-danger);
    color: var(--insertr-text-inverse);
    border-color: var(--insertr-danger);
}

/* Collection items hover state */
.insertr-collection-active > *:hover {
    background: rgba(0, 123, 255, 0.03);
    outline: 1px solid rgba(var(--insertr-primary), 0.2);
    outline-offset: 2px;
    border-radius: var(--insertr-border-radius);
}

/* Show item controls on hover */
.insertr-collection-active > *:hover .insertr-item-controls {
    opacity: 1;
}

/* Responsive adjustments for collection management */
@media (max-width: 768px) {
    .insertr-add-btn {
        position: static;
        display: block;
        margin: var(--insertr-spacing-sm) auto 0;
        width: 100%;
        max-width: 200px;
    }
    
    .insertr-item-controls {
        position: relative;
        opacity: 1;
        top: auto;
        right: auto;
        justify-content: center;
        margin-top: var(--insertr-spacing-xs);
    }
    
    .insertr-control-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}