/**
 * ZT Frontend Debug - CSS Styles
 * Draggable debug windows for WordPress frontend debugging
 */

/* Main debug window container */
.zt-debug-window {
    position: fixed;
    top: 50px;
    right: 20px;
    width: 500px;
    max-width: 90vw;
    max-height: 70vh;
    background: #ffffff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Multiple debug windows stacking */
.zt-debug-window:nth-of-type(2) { top: 70px; right: 40px; }
.zt-debug-window:nth-of-type(3) { top: 90px; right: 60px; }
.zt-debug-window:nth-of-type(4) { top: 110px; right: 80px; }
.zt-debug-window:nth-of-type(5) { top: 130px; right: 100px; }

/* Debug window header */
.zt-debug-header {
    background: linear-gradient(135deg, #0073aa, #005177);
    color: #ffffff;
    padding: 8px 12px;
    cursor: move;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 13px;
    border-bottom: 1px solid #005177;
}

.zt-debug-header:hover {
    background: linear-gradient(135deg, #005177, #003f5c);
}

/* Close button */
.zt-debug-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    border-radius: 2px;
    transition: background-color 0.2s;
}

.zt-debug-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.zt-debug-close:active {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Debug content area */
.zt-debug-content {
    flex: 1;
    overflow: auto;
    padding: 12px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
}

/* Pre-formatted debug output */
.zt-debug-pre {
    margin: 0;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 11px;
    line-height: 1.4;
    color: #333333;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    max-height: none;
}

/* Syntax highlighting for different data types */
.zt-debug-pre .string {
    color: #d73a49;
}

.zt-debug-pre .number {
    color: #005cc5;
}

.zt-debug-pre .boolean {
    color: #e36209;
}

.zt-debug-pre .null {
    color: #6f42c1;
}

/* Responsive design */
@media (max-width: 768px) {
    .zt-debug-window {
        width: 95vw;
        max-width: 95vw;
        right: 2.5vw;
        top: 20px;
        max-height: 80vh;
    }
    
    .zt-debug-window:nth-of-type(2) { top: 40px; right: 2.5vw; }
    .zt-debug-window:nth-of-type(3) { top: 60px; right: 2.5vw; }
    .zt-debug-window:nth-of-type(4) { top: 80px; right: 2.5vw; }
    .zt-debug-window:nth-of-type(5) { top: 100px; right: 2.5vw; }
    
    .zt-debug-pre {
        font-size: 10px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .zt-debug-window {
        background: #1e1e1e;
        border-color: #404040;
    }
    
    .zt-debug-content {
        background: #252526;
        border-color: #404040;
    }
    
    .zt-debug-pre {
        background: #1e1e1e;
        border-color: #404040;
        color: #d4d4d4;
    }
}

/* Animation for new debug windows */
.zt-debug-window {
    animation: ztDebugFadeIn 0.3s ease-out;
}

@keyframes ztDebugFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* AJAX Debug windows - special styling */
.zt-ajax-debug {
    border-color: #ff6b35 !important;
    box-shadow: 0 5px 25px rgba(255, 107, 53, 0.4) !important;
}

.zt-ajax-debug .zt-debug-header {
    background: linear-gradient(135deg, #ff6b35, #e55a2b) !important;
}

.zt-ajax-debug .zt-debug-header:hover {
    background: linear-gradient(135deg, #e55a2b, #cc4a1f) !important;
}

.zt-ajax-debug .zt-debug-pre {
    background: #fff7f4 !important;
    border-color: #ffccb3 !important;
    color: #b83e1a !important;
}

/* Dark theme for AJAX debug */
@media (prefers-color-scheme: dark) {
    .zt-ajax-debug {
        background: #2d1810 !important;
        border-color: #ff8c42 !important;
    }
    
    .zt-ajax-debug .zt-debug-content {
        background: #3d2015 !important;
    }
    
    .zt-ajax-debug .zt-debug-pre {
        background: #2d1810 !important;
        border-color: #ff8c42 !important;
        color: #ffb366 !important;
    }
}

/* Dragging state */
.zt-debug-window.dragging {
    transition: none !important;
    transform: rotate(2deg);
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.4);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .zt-debug-window {
        border-width: 3px;
        border-color: #000000;
    }
    
    .zt-debug-header {
        background: #000000;
        color: #ffffff;
    }
    
    .zt-debug-pre {
        border-color: #000000;
        color: #000000;
    }
}