/**
 * UI Enhancements CSS - Easy Automation
 * Styles for modern JavaScript components
 * @version 1.0.0
 * @date 2026-02-13
 */

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-notification.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification::before {
    content: '';
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 8px 0 0 8px;
}

.toast-success {
    border-left: 4px solid #008060;
}

.toast-success::before {
    background: #008060;
}

.toast-error {
    border-left: 4px solid #d62828;
}

.toast-error::before {
    background: #d62828;
}

.toast-warning {
    border-left: 4px solid #ffa500;
}

.toast-warning::before {
    background: #ffa500;
}

.toast-info {
    border-left: 4px solid #5c6ac4;
}

.toast-info::before {
    background: #5c6ac4;
}

.toast-message {
    flex: 1;
    color: #202223;
    font-size: 14px;
    line-height: 1.5;
}

/* ========================================
   CONFIRMATION MODAL
   ======================================== */

.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-modal-overlay.show {
    opacity: 1;
}

.confirm-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-modal-overlay.show .confirm-modal {
    transform: scale(1);
}

.confirm-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e1e3e5;
    font-weight: 600;
    font-size: 16px;
    color: #202223;
    display: flex;
    align-items: center;
    gap: 12px;
}

.confirm-modal-header i {
    color: #ffa500;
    font-size: 20px;
}

.confirm-modal-body {
    padding: 24px 20px;
    color: #637381;
    font-size: 14px;
    line-height: 1.6;
}

.confirm-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e1e3e5;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========================================
   LOADING OVERLAY
   ======================================== */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
}

.loading-content {
    text-align: center;
}

.loading-text {
    margin-top: 16px;
    color: #637381;
    font-size: 14px;
}

/* ========================================
   SAVE INDICATOR
   ======================================== */

.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.save-indicator.saving {
    color: #637381;
}

.save-indicator.saved {
    color: #008060;
}

.save-indicator.error {
    color: #d62828;
}

/* ========================================
   FORM VALIDATION
   ======================================== */

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
    border-color: #d62828;
    box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.15);
}

.form-group.has-error label {
    color: #d62828;
}

/* ========================================
   COLLAPSIBLE SECTIONS
   ======================================== */

.collapsible-section {
    border: 1px solid #e1e3e5;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.collapsible-header {
    padding: 16px 20px;
    background: #fafbfb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #202223;
    transition: background-color 0.2s ease;
}

.collapsible-header:hover {
    background: #f6f6f7;
}

.collapsible-header::after {
    content: '\f107';
    font-family: 'FontAwesome';
    transition: transform 0.3s ease;
}

.collapsible-section.collapsed .collapsible-header::after {
    transform: rotate(-90deg);
}

.collapsible-content {
    padding: 20px;
}

/* ========================================
   ENHANCED TABLES
   ======================================== */

.enhanced-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.enhanced-table tbody tr.selected {
    background-color: #e8f5f1 !important;
}

.enhanced-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.enhanced-table thead th.sortable:hover {
    background-color: #f0f0f0;
}

.enhanced-table thead th.sortable::after {
    content: '\f0dc';
    font-family: 'FontAwesome';
    margin-left: 8px;
    opacity: 0.3;
}

/* ========================================
   CODE COPY BUTTON
   ======================================== */

.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background: #202223;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

pre:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: #000;
}

/* ========================================
   RIPPLE EFFECT
   ======================================== */

.btn, button {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

@media (max-width: 768px) {
    .toast-notification {
        left: 20px;
        right: 20px;
        min-width: auto;
    }
    
    .confirm-modal {
        width: 95%;
        margin: 20px;
    }
    
    .save-indicator {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.toast-notification:focus,
.confirm-modal:focus,
.collapsible-header:focus {
    outline: 2px solid #5c6ac4;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .toast-notification,
    .confirm-modal-overlay,
    .confirm-modal,
    .loading-overlay,
    .save-indicator,
    .ripple {
        animation: none;
        transition: none;
    }
}




