/**
 * PureDash Cleaner Styles
 */

/* Hover Overlay */
.cleanview-hover-overlay {
    position: absolute;
    background: rgba(110, 88, 255, 0.1);
    border: 2px solid #6e58ff;
    z-index: 999999;
    pointer-events: none;
    /* Let clicks pass through to document handler */
    transition: all 0.1s ease;
    box-shadow: 0 0 10px rgba(110, 88, 255, 0.3);
    border-radius: 4px;
}

/* Modal Overlay */
.cleanview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

/* Modal Content */
.cleanview-modal {
    background: #fff;
    width: 500px;
    max-width: 90%;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: cleanview-pop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

@keyframes cleanview-pop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cleanview-modal h2 {
    margin-top: 0;
    color: #1d2327;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cleanview-modal h2 .dashicons {
    color: #6e58ff;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.cleanview-modal-body {
    margin: 20px 0;
}

.cleanview-field {
    margin-bottom: 15px;
}

.cleanview-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #3c434a;
}

.cleanview-field input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
}

.cleanview-field code {
    display: block;
    background: #f0f0f1;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    word-break: break-all;
    font-size: 12px;
    color: #646970;
}

.cleanview-warning {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    padding: 12px;
    color: #d63638;
    margin-bottom: 15px;
    font-size: 13px;
    display: none;
}

.cleanview-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    border-top: 1px solid #f0f0f1;
    padding-top: 15px;
}

.cleanview-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
}

.cleanview-btn-secondary {
    background: transparent;
    color: #2271b1;
    border: 1px solid transparent;
}

.cleanview-btn-secondary:hover {
    background: #f0f0f1;
    color: #135e96;
}

.cleanview-btn-primary {
    background: #2271b1;
    color: white;
}

.cleanview-btn-primary:hover {
    background: #135e96;
}

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

.cleanview-btn-danger:hover {
    background: #a32224;
}

/* Toggle Logic */
body.cleanview-mode-active {
    cursor: crosshair !important;
}

/* Settings Page */
.cleanview-card {
    position: relative;
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.cleanview-card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f1;
    margin-bottom: 20px;
}

.cleanview-blocks-table td {
    vertical-align: top;
    padding: 10px 8px;
}

/* Settings Page Popup (Label editing) */
.cleanview-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cleanview-popup-content {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 400px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.cleanview-popup-content h3 {
    margin: 0 0 8px;
}

.cleanview-popup-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */

.cleanview-toast-container {
    position: fixed;
    top: 50px;
    right: 20px;
    z-index: 100002;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.cleanview-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #2271b1;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    max-width: 400px;
}

.cleanview-toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.cleanview-toast-hiding {
    opacity: 0;
    transform: translateX(100%);
}

.cleanview-toast .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.cleanview-toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #1d2327;
}

.cleanview-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #787c82;
    transition: color 0.2s;
}

.cleanview-toast-close:hover {
    color: #1d2327;
}

.cleanview-toast-close .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Toast Types */
.cleanview-toast-success {
    border-left-color: #00a32a;
}

.cleanview-toast-success .dashicons {
    color: #00a32a;
}

.cleanview-toast-error {
    border-left-color: #d63638;
}

.cleanview-toast-error .dashicons {
    color: #d63638;
}

.cleanview-toast-warning {
    border-left-color: #dba617;
}

.cleanview-toast-warning .dashicons {
    color: #dba617;
}

.cleanview-toast-info {
    border-left-color: #2271b1;
}

/* Admin Bar Indicator */
#wpadminbar #wp-admin-bar-cleanview-parent > .ab-item {
    display: flex !important;
    align-items: center !important;
}

#wpadminbar #wp-admin-bar-cleanview-parent.cleanview-active-blocks > .ab-item,
#wpadminbar #wp-admin-bar-cleanview-parent.cleanview-active-blocks > .ab-item * {
    background: #46b450 !important;
    color: #fff !important;
}

#wpadminbar #wp-admin-bar-cleanview-parent.cleanview-active-blocks:hover > .ab-item,
#wpadminbar #wp-admin-bar-cleanview-parent.cleanview-active-blocks:hover > .ab-item * {
    background: #34963d !important;
}

#wpadminbar #wp-admin-bar-cleanview-parent.cleanview-active-blocks .ab-icon:before {
    color: #fff !important;
}

/* Category Sections */
.cleanview-category-section {
    background: #fff;
    margin-bottom: 30px;
}

.cleanview-category-section h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1d2327;
}

.cleanview-category-section h3 .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.cleanview-empty-state {
    transition: all 0.3s ease;
}

.cleanview-empty-state:hover {
    border-color: #2271b1 !important;
    background: #f0f6fc !important;
}

.cleanview-empty-state .dashicons {
    transition: transform 0.3s ease;
}

.cleanview-empty-state:hover .dashicons {
    transform: scale(1.1);
    color: #2271b1 !important;
}

/* Modal Category Badge */
.cleanview-category-badge {
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
