/**
 * DGA Sitemap Styles - Enhanced with Role-based Features
 * Clear level visualization with modern blue and orange theme + role indicators
 * Version: 1.0.3
 */

/* Container and base styles */
.dga-sitemap-container-xkp492 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

/* Header section */
.dga-sitemap-header-xkp492 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 20px;
}

.dga-sitemap-title-xkp492 {
    color: #1e3a8a;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    position: relative;
    padding-left: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dga-sitemap-title-xkp492::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6 0%, #f97316 100%);
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Level legend with role indicators */
.dga-level-legend-xkp492 {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.dga-legend-title-xkp492 {
    font-weight: 600;
    color: #475569;
}

.dga-legend-item-xkp492 {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.dga-legend-0-xkp492 {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.dga-legend-1-xkp492 {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
}

.dga-legend-2-xkp492 {
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: white;
}

.dga-legend-3-xkp492 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #7c2d12;
}

/* Role indicators in legend */
.dga-legend-roles-xkp492 {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-left: auto;
}

.dga-role-icon-xkp492 {
    font-size: 14px;
}

.dga-role-text-xkp492 {
    text-transform: capitalize;
}

/* Role filtering notice */
.dga-role-notice-xkp492 {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #065f46;
}

.dga-notice-icon-xkp492 {
    font-size: 16px;
    flex-shrink: 0;
}

/* Search box */
.dga-sitemap-search-xkp492 {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.dga-sitemap-search-input-xkp492 {
    width: 100%;
    padding: 14px 50px 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dga-sitemap-search-input-xkp492:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.dga-sitemap-search-input-xkp492:not(:placeholder-shown) {
    border-color: #f97316 !important;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%) !important;
}

.dga-search-icon-xkp492 {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 18px;
}

/* Search results badge */
.dga-search-results-badge-xkp492 {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
    animation: dga-pop-xkp492 0.3s ease-out;
}

@keyframes dga-pop-xkp492 {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Loading state */
.dga-sitemap-loading-xkp492 {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #64748b;
    gap: 20px;
}

.dga-loading-spinner-xkp492 {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-right-color: #f97316;
    border-radius: 50%;
    animation: dga-spin-xkp492 1s linear infinite;
}

@keyframes dga-spin-xkp492 {
    to { transform: rotate(360deg); }
}

/* Control buttons */
.dga-sitemap-controls-xkp492 {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(59, 130, 246, 0.03);
    border-radius: 12px;
}

.dga-control-btn-xkp492 {
    padding: 10px 18px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    color: #475569;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dga-btn-icon-xkp492 {
    font-size: 16px;
}

.dga-control-btn-xkp492:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

/* Stats display for role filtering */
.dga-sitemap-stats-xkp492 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #065f46;
}

.dga-stats-item-xkp492 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dga-stats-number-xkp492 {
    font-weight: 700;
    color: #047857;
}

.dga-stats-hidden-xkp492 {
    color: #dc2626;
}

/* Sitemap list styles with clear level differentiation */
.dga-sitemap-list-root-xkp492 {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dga-sitemap-list-xkp492 {
    list-style: none;
    padding-left: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.dga-sitemap-item-xkp492 {
    margin: 0;
    position: relative;
    transition: all 0.2s ease;
}

/* Connection lines for hierarchy */
.dga-connection-line-xkp492 {
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
    pointer-events: none;
}

.dga-last-item-xkp492 > .dga-connection-line-xkp492 {
    height: 28px;
}

/* Level-specific styling with clear visual distinction */
.dga-level-0-xkp492 {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-left: 4px solid #3b82f6;
    margin: 10px 0;
    border-radius: 8px;
}

.dga-level-1-xkp492 {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.06) 0%, transparent 100%);
    border-left: 3px solid #60a5fa;
    margin: 8px 0 8px 30px;
    padding-left: 20px;
    border-radius: 6px;
}

.dga-level-2-xkp492 {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.05) 0%, transparent 100%);
    border-left: 3px solid #fb923c;
    margin: 6px 0 6px 60px;
    padding-left: 20px;
    border-radius: 6px;
}

.dga-level-3-xkp492 {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.04) 0%, transparent 100%);
    border-left: 3px solid #fbbf24;
    margin: 4px 0 4px 90px;
    padding-left: 20px;
    border-radius: 6px;
}

/* Item wrapper */
.dga-item-wrapper-xkp492 {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    min-height: 48px;
}

/* Level badges */
.dga-level-badge-xkp492 {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.dga-badge-0-xkp492 {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.dga-badge-1-xkp492 {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
}

.dga-badge-2-xkp492 {
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: white;
}

.dga-badge-3-xkp492 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #7c2d12;
}

/* Role restriction badges */
.dga-role-badge-xkp492 {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.dga-role-badge-admin-xkp492 {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.dga-role-badge-editor-xkp492 {
    background: linear-gradient(135deg, #059669, #047857);
}

.dga-role-badge-author-xkp492 {
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

.dga-role-badge-subscriber-xkp492 {
    background: linear-gradient(135deg, #64748b, #475569);
}

.dga-role-badge-logged-in-xkp492 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Role info tooltip */
.dga-role-info-xkp492 {
    position: relative;
    cursor: help;
}

.dga-role-info-xkp492:hover .dga-role-tooltip-xkp492 {
    visibility: visible;
    opacity: 1;
}

.dga-role-tooltip-xkp492 {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.dga-role-tooltip-xkp492::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

/* Toggle button */
.dga-toggle-btn-xkp492 {
    width: 32px;
    height: 32px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dga-toggle-btn-xkp492:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.dga-toggle-btn-xkp492:hover .dga-toggle-icon-xkp492 {
    color: white;
}

.dga-toggle-icon-xkp492 {
    font-size: 14px;
    color: #64748b;
    transition: transform 0.3s ease, color 0.3s ease;
    display: inline-block;
}

/* Leaf indicator */
.dga-leaf-indicator-xkp492 {
    color: #94a3b8;
    font-size: 20px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

/* Links */
.dga-sitemap-link-xkp492 {
    color: #1e40af;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    flex: 1;
}

.dga-link-text-xkp492 {
    flex: 1;
}

.dga-child-count-xkp492 {
    font-size: 12px;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.dga-sitemap-link-xkp492:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
    transform: translateX(3px);
}

/* Restricted item styling */
.dga-item-restricted-xkp492 {
    opacity: 0.7;
    position: relative;
}

.dga-item-restricted-xkp492::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(239, 68, 68, 0.1) 2px,
        rgba(239, 68, 68, 0.1) 4px
    );
    pointer-events: none;
    border-radius: 6px;
}

/* Expanded state */
.dga-expanded-xkp492 > .dga-sitemap-list-xkp492 {
    max-height: none !important;
}

.dga-expanded-xkp492 > .dga-item-wrapper-xkp492 {
    background: rgba(59, 130, 246, 0.03);
}

/* Search match highlighting - Enhanced visibility */
.dga-search-match-xkp492 {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%) !important;
    border: 2px solid #f97316 !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25) !important;
    animation: dga-pulse-highlight-xkp492 1.5s ease-in-out infinite;
    position: relative;
}

@keyframes dga-pulse-highlight-xkp492 {
    0% { 
        background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
        box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
    }
    50% { 
        background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
        box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
    }
    100% { 
        background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
        box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
    }
}

/* Text highlight - Make searched text stand out */
.dga-highlight-xkp492,
mark.dga-highlight-xkp492 {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%) !important;
    color: #ffffff !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    display: inline-block !important;
    transform: scale(1.05) !important;
    margin: 0 2px !important;
}

/* Matched search items */
.dga-search-match-xkp492 .dga-sitemap-link-xkp492 {
    color: #ea580c !important;
    font-weight: 600 !important;
}

.dga-search-match-xkp492 .dga-item-wrapper-xkp492 {
    background: rgba(249, 115, 22, 0.1) !important;
    border-radius: 8px;
}

/* Non-matching items - fade them */
.dga-search-hidden-xkp492 {
    opacity: 0.2 !important;
    filter: grayscale(100%) !important;
}

/* Search indicator icon */
.dga-search-match-xkp492::before {
    content: '🔍';
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    animation: dga-bounce-xkp492 1s ease-in-out infinite;
}

@keyframes dga-bounce-xkp492 {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

/* Level colors when search matches */
.dga-search-match-xkp492.dga-level-0-xkp492 {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.2) 0%, rgba(249, 115, 22, 0.05) 100%) !important;
    border-left: 5px solid #f97316 !important;
}

.dga-search-match-xkp492.dga-level-1-xkp492 {
    background: linear-gradient(90deg, rgba(251, 146, 60, 0.2) 0%, rgba(251, 146, 60, 0.05) 100%) !important;
    border-left: 5px solid #fb923c !important;
}

.dga-search-match-xkp492.dga-level-2-xkp492 {
    background: linear-gradient(90deg, rgba(252, 165, 82, 0.2) 0%, rgba(252, 165, 82, 0.05) 100%) !important;
    border-left: 5px solid #fca552 !important;
}

.dga-search-match-xkp492.dga-level-3-xkp492 {
    background: linear-gradient(90deg, rgba(253, 186, 116, 0.2) 0%, rgba(253, 186, 116, 0.05) 100%) !important;
    border-left: 5px solid #fdba74 !important;
}

/* Error message */
.dga-sitemap-error-xkp492 {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 2px solid #fecaca;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: #dc2626;
}

.dga-error-icon-xkp492 {
    font-size: 32px;
    display: block;
    margin-bottom: 15px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .dga-sitemap-container-xkp492 {
        padding: 20px;
    }
    
    .dga-sitemap-header-xkp492 {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dga-sitemap-title-xkp492 {
        font-size: 26px;
    }
    
    .dga-sitemap-search-xkp492 {
        max-width: 100%;
    }
    
    .dga-level-1-xkp492 { margin-left: 20px; }
    .dga-level-2-xkp492 { margin-left: 40px; }
    .dga-level-3-xkp492 { margin-left: 60px; }
    
    .dga-control-btn-xkp492 {
        flex: 1;
        padding: 10px;
    }
    
    .dga-btn-text-xkp492 {
        display: none;
    }
    
    .dga-btn-icon-xkp492 {
        font-size: 20px;
    }
    
    .dga-level-legend-xkp492 {
        font-size: 12px;
    }
    
    .dga-search-match-xkp492::before {
        display: none;
    }
    
    .dga-role-notice-xkp492 {
        font-size: 13px;
    }
    
    .dga-sitemap-stats-xkp492 {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Accessibility - Focus styles */
.dga-toggle-btn-xkp492:focus,
.dga-sitemap-link-xkp492:focus,
.dga-control-btn-xkp492:focus,
.dga-sitemap-search-input-xkp492:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .dga-sitemap-link-xkp492 {
        text-decoration: underline;
    }
    
    .dga-level-0-xkp492,
    .dga-level-1-xkp492,
    .dga-level-2-xkp492,
    .dga-level-3-xkp492 {
        border-left-width: 5px;
    }
    
    .dga-highlight-xkp492,
    mark.dga-highlight-xkp492 {
        background: #000000 !important;
        color: #ffff00 !important;
        border: 2px solid #ffff00 !important;
    }
    
    .dga-search-match-xkp492 {
        background: #ffff00 !important;
        color: #000000 !important;
        border: 3px solid #000000 !important;
    }
    
    .dga-role-badge-xkp492 {
        border: 2px solid #000000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dga-sitemap-container-xkp492 {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        color: #e5e7eb;
    }
    
    .dga-sitemap-header-xkp492 {
        border-bottom-color: #374151;
    }
    
    .dga-sitemap-title-xkp492 {
        color: #93c5fd;
    }
    
    .dga-sitemap-search-input-xkp492 {
        background: #374151;
        border-color: #4b5563;
        color: #e5e7eb;
    }
    
    .dga-control-btn-xkp492 {
        background: #374151;
        border-color: #4b5563;
        color: #e5e7eb;
    }
    
    .dga-sitemap-link-xkp492 {
        color: #93c5fd;
    }
    
    .dga-role-notice-xkp492 {
        background: linear-gradient(135deg, #064e3b, #065f46);
        border-color: #047857;
        color: #a7f3d0;
    }
    
    .dga-highlight-xkp492,
    mark.dga-highlight-xkp492 {
        background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
        color: #1f2937 !important;
    }
    
    .dga-search-match-xkp492 {
        background: linear-gradient(135deg, rgba(251, 191, 36, 0.3) 0%, rgba(245, 158, 11, 0.3) 100%) !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .dga-sitemap-list-xkp492,
    .dga-toggle-icon-xkp492,
    .dga-sitemap-link-xkp492,
    .dga-control-btn-xkp492,
    .dga-search-match-xkp492 {
        transition: none;
        animation: none;
    }
    
    .dga-loading-spinner-xkp492 {
        animation: none;
        border-top-color: #1e40af;
    }
    
    .dga-search-match-xkp492::before {
        animation: none;
    }
}

/* Print styles */
@media print {
    .dga-sitemap-search-xkp492,
    .dga-sitemap-controls-xkp492,
    .dga-toggle-btn-xkp492,
    .dga-level-legend-xkp492,
    .dga-search-results-badge-xkp492,
    .dga-role-notice-xkp492,
    .dga-sitemap-stats-xkp492,
    .dga-role-badge-xkp492 {
        display: none;
    }
    
    .dga-sitemap-list-xkp492 {
        max-height: none !important;
        display: block !important;
    }
    
    .dga-sitemap-item-xkp492 {
        page-break-inside: avoid;
    }
    
    .dga-search-match-xkp492 {
        background: none !important;
        border: none !important;
    }
    
    .dga-highlight-xkp492 {
        background: none !important;
        font-weight: bold !important;
        color: inherit !important;
    }
}