/**
 * Advanced Widget Kit - Editor Styles
 * 
 * Styles for Elementor editor interface
 * 
 * @package Advanced_Widget_Kit
 * @since 1.0.0
 */

/* Widget Icons in Panel */
.elementor-element .icon .eicon-button {
    color: #667eea;
}

.elementor-element .icon .eicon-testimonial {
    color: #4caf50;
}

.elementor-element .icon .eicon-price-table {
    color: #ff9800;
}

.elementor-element .icon .eicon-image-box {
    color: #e91e63;
}

.elementor-element .icon .eicon-bullet-list {
    color: #9c27b0;
}

/* Advanced Widget Kit Category - Force to Top */
#elementor-panel-categories .elementor-element[data-category="advanced-widget-kit-for-elementor"],
#elementor-panel-category-advanced-widget-kit-for-elementor {
    order: -999 !important;
    position: relative !important;
    z-index: 999 !important;
}

#elementor-panel-categories .elementor-element[data-category="advanced-widget-kit-pro"],
#elementor-panel-category-advanced-widget-kit-pro {
    order: -998 !important;
    position: relative !important;
    z-index: 998 !important;
}

/* Alternative selectors for different Elementor versions */
#elementor-panel-categories .elementor-element:has([data-category="advanced-widget-kit-for-elementor"]) {
    order: -999 !important;
}

#elementor-panel-categories .elementor-element:has([data-category="advanced-widget-kit-pro"]) {
    order: -998 !important;
}

/* Force positioning using CSS Grid/Flexbox */
#elementor-panel-categories {
    display: flex !important;
    flex-direction: column !important;
}

#elementor-panel-categories .elementor-element[data-category="advanced-widget-kit-for-elementor"] {
    order: -999 !important;
}

#elementor-panel-categories .elementor-element[data-category="advanced-widget-kit-pro"] {
    order: -998 !important;
}

/* Category Header Styling */
.elementor-panel-category-title {
    position: relative;
}

.elementor-panel-category-title[data-category="advanced-widget-kit-for-elementor"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
    position: relative;
    overflow: visible;
}

.elementor-panel-category-title[data-category="advanced-widget-kit-for-elementor"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.elementor-panel-category-title[data-category="advanced-widget-kit-for-elementor"]:hover {
    background: linear-gradient(135deg, #7c8ef5 0%, #8a5bb0 100%) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

.elementor-panel-category-title[data-category="advanced-widget-kit-for-elementor"] .elementor-element-toggle {
    color: white !important;
}

/* Pro Category */
.elementor-panel-category-title[data-category="advanced-widget-kit-pro"] {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3) !important;
}

.elementor-panel-category-title[data-category="advanced-widget-kit-pro"]:hover {
    background: linear-gradient(135deg, #ffe14d 0%, #ffa033 100%) !important;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4) !important;
}

.elementor-panel-category-title[data-category="advanced-widget-kit-pro"] .elementor-element-toggle {
    color: white !important;
}

/* Add visual separator after our categories */
.elementor-panel-category-title[data-category="advanced-widget-kit-for-elementor"] + .elementor-element,
.elementor-panel-category-title[data-category="advanced-widget-kit-pro"] + .elementor-element {
    border-top: 2px solid #e0e0e0;
    margin-top: 8px;
    padding-top: 8px;
}

/* Widget items in our categories */
.elementor-element[data-category="advanced-widget-kit-for-elementor"] .elementor-element,
.elementor-element[data-category="advanced-widget-kit-pro"] .elementor-element {
    transition: all 0.2s ease;
}

.elementor-element[data-category="advanced-widget-kit-for-elementor"] .elementor-element:hover,
.elementor-element[data-category="advanced-widget-kit-pro"] .elementor-element:hover {
    background: #f8f4ff;
    border-left: 3px solid #667eea;
}

/* Category Divider - Separates our categories from Elementor defaults */
.awke-category-divider {
    height: 8px;
    background: linear-gradient(to bottom, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
    margin: 8px 0;
    position: relative;
}

.awke-category-divider::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, #667eea 50%, transparent 100%);
}

/* Widget Preview in Editor */
.elementor-widget-awke-button .elementor-widget-container {
    text-align: center;
}

.elementor-widget-awke-testimonial .elementor-widget-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.elementor-widget-awke-pricing-table .elementor-widget-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.elementor-widget-awke-image-box .elementor-widget-container {
    border: 1px dashed #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.elementor-widget-awke-icon-list .elementor-widget-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

/* ========================================
   AWKE Editor Panel Styles
   ======================================== */

/* Top Bar Button */
#awke-top-bar-button .elementor-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border-radius: 3px;
    transition: all 0.3s ease;
}

#awke-top-bar-button .elementor-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

#awke-top-bar-button .elementor-button i {
    color: white !important;
}

/* Floating Button */
.awke-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
}

.awke-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
}

.awke-fab:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.awke-fab:active {
    transform: translateY(-2px) scale(0.98);
}

.awke-fab svg {
    width: 24px;
    height: 24px;
}

.awke-fab-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 8px;
}

.awke-floating-btn:hover .awke-fab-tooltip {
    opacity: 1;
}

/* Panel Overlay */
.awke-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.awke-panel-overlay.awke-overlay-visible {
    opacity: 1;
    visibility: visible;
}

/* Editor Panel */
#awke-editor-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 9999999;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#awke-editor-panel.awke-panel-open {
    display: flex !important;
}

#awke-editor-panel.awke-panel-animated {
    right: 0;
}

/* Panel Header */
.awke-editor-panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.awke-editor-panel-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.awke-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.awke-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Panel Content */
.awke-editor-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.awke-editor-panel-content::-webkit-scrollbar {
    width: 6px;
}

.awke-editor-panel-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.awke-editor-panel-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.awke-editor-panel-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Panel Sections */
.awke-panel-section {
    margin-bottom: 30px;
}

.awke-panel-section:last-child {
    margin-bottom: 0;
}

.awke-panel-section h3 {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Panel Actions */
.awke-panel-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.awke-panel-button {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.awke-panel-button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateX(4px);
}

.awke-panel-button .dashicons {
    margin-right: 10px;
    font-size: 18px;
}

.awke-panel-button .awke-badge {
    margin-left: auto;
    background: #ff4444;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Panel Widgets */
.awke-panel-widgets {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.awke-panel-widget-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
}

.awke-panel-widget-item i {
    margin-right: 10px;
    font-size: 16px;
    color: #667eea;
}

.awke-no-widgets {
    color: #999;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

.awke-panel-link {
    display: inline-flex;
    align-items: center;
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.awke-panel-link:hover {
    color: #764ba2;
    transform: translateX(4px);
}

/* Panel Resources */
.awke-panel-resources {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.awke-resource-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.awke-resource-link:hover {
    background: #667eea;
    color: white;
    transform: translateX(4px);
}

.awke-resource-link .dashicons {
    margin-right: 10px;
    font-size: 16px;
}

/* Notifications */
.awke-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99999999;
    min-width: 300px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.awke-notification.awke-notification-show {
    transform: translateX(0);
    opacity: 1;
}

.awke-notification-info {
    border-left: 4px solid #2196F3;
}

.awke-notification-success {
    border-left: 4px solid #4CAF50;
}

.awke-notification-warning {
    border-left: 4px solid #FF9800;
}

.awke-notification-error {
    border-left: 4px solid #F44336;
}

.awke-notification-message {
    font-size: 14px;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    #awke-editor-panel {
        width: 100%;
        right: -100%;
    }
    
    .awke-floating-btn {
        bottom: 20px;
        right: 20px;
    }
    
    .awke-fab {
        width: 48px;
        height: 48px;
    }
}

/* Body class when panel is active */
body.awke-panel-active {
    overflow: hidden;
}