/* Edit Mode System Styling */

/* Edit-Mode Toggle Button */
#edit-mode-toggle {
    transition: all 0.2s ease;
}

#edit-mode-toggle:hover {
    transform: scale(1.1);
}

#edit-mode-toggle.text-success {
    animation: edit-mode-pulse 2s infinite;
}

@keyframes edit-mode-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Editable Fields Styling */
[data-inline-edit] {
    transition: all 0.2s ease;
    position: relative;
}

[data-inline-edit].ie-editable,
[data-inline-edit].ie-active {
    border: 1px dashed rgba(13, 110, 253, 0.3);
    border-radius: 3px;
    padding: 2px 4px;
    margin: -2px -4px;
    background-color: rgba(13, 110, 253, 0.05);
}

[data-inline-edit].ie-editable:hover,
[data-inline-edit].ie-active:hover {
    border-color: rgba(13, 110, 253, 0.6);
    background-color: rgba(13, 110, 253, 0.1);
}

[data-inline-edit].ie-editable::after,
[data-inline-edit].ie-active::after {
    content: '✎';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    color: #0d6efd;
    opacity: 0;
    transition: opacity 0.2s ease;
}

[data-inline-edit].ie-editable:hover::after,
[data-inline-edit].ie-active:hover::after {
    opacity: 1;
}

/* Editing State */
.ie-input-temp {
    border: 2px solid #0d6efd !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

.ie-saving {
    background-color: #fff3cd !important;
    border-color: #ffc107 !important;
}

.ie-success {
    background-color: #d1e7dd !important;
    border-color: #198754 !important;
    animation: ie-success-flash 1s ease;
}

.ie-error {
    background-color: #f8d7da !important;
    border-color: #dc3545 !important;
    animation: ie-error-shake 0.5s ease;
}

@keyframes ie-success-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes ie-error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Status Messages */
.edit-mode-status {
    animation: slideInRight 0.3s ease;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    [data-inline-edit].ie-editable::after {
        display: none;
    }
    
    .edit-mode-status {
        right: 10px !important;
        left: 10px !important;
        min-width: auto !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    [data-inline-edit].ie-editable {
        background-color: rgba(13, 110, 253, 0.1);
        border-color: rgba(13, 110, 253, 0.4);
    }
    
    [data-inline-edit].ie-editable:hover {
        background-color: rgba(13, 110, 253, 0.15);
    }
}

/* Phase 4 Enhanced Features */

/* Loading Indicators */
.ie-loading-indicator {
    margin-left: 8px;
    font-size: 14px;
    animation: spin 1s linear infinite;
}

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

/* Status Toast Notifications */
.ie-status-toast {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    min-width: 200px;
    max-width: 400px;
    word-wrap: break-word;
}

.ie-status-toast.ie-success {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
}

.ie-status-toast.ie-error {
    background: linear-gradient(135deg, #dc3545, #e74c3c) !important;
}

/* Enhanced Field States */
.ie-updated {
    background-color: #d1e7dd !important;
    border-color: #198754 !important;
    animation: ie-updated-pulse 1.2s ease;
}

.ie-reverted {
    background-color: #fff3cd !important;
    border-color: #ffc107 !important;
    animation: ie-revert-pulse 1.2s ease;
}

@keyframes ie-updated-pulse {
    0% { 
        background-color: #d1e7dd;
        transform: scale(1);
    }
    50% { 
        background-color: #198754;
        color: white;
        transform: scale(1.02);
    }
    100% { 
        background-color: transparent;
        transform: scale(1);
    }
}

@keyframes ie-revert-pulse {
    0% { 
        background-color: #fff3cd;
        transform: scale(1);
    }
    50% { 
        background-color: #ffc107;
        color: black;
        transform: scale(1.02);
    }
    100% { 
        background-color: transparent;
        transform: scale(1);
    }
}

/* Enhanced Select Fields */
select[data-inline-edit].ie-saving {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffc107' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 8l4 4 8-8'/%3e%3c/svg%3e");
}

/* Batch Operation Indicators */
.ie-batch-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(13, 110, 253, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    animation: slideInUp 0.3s ease;
}

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

/* Keyboard Shortcut Hints */
.ie-shortcuts-hint {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 11px;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ie-shortcuts-hint.visible {
    opacity: 1;
}

/* Mobile Optimizations for Phase 4 */
@media (max-width: 768px) {
    .ie-status-toast {
        left: 10px !important;
        right: 10px !important;
        max-width: none;
        min-width: auto;
    }
    
    .ie-batch-indicator {
        left: 10px;
        right: 10px;
        text-align: center;
    }
    
    .ie-shortcuts-hint {
        display: none; /* Hide shortcuts on mobile */
    }
}
