/* APK Decompiler Page Styles */

/* Alpine.js cloak - hide elements until Alpine initializes */
[x-cloak] { display: none !important; }

/* Monaco Editor Container */
.monaco_container { width: 100%; height: 100%; }
#monaco_editor { width: 100%; height: 100%; }

/* Resizable Explorer Panel */
.decompiler_file_tree { position: relative; min-width: 150px; max-width: 500px; }
.decompiler_resize_handle { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; z-index: 10; background: transparent; transition: background 0.15s; }
.decompiler_resize_handle:hover, .decompiler_resize_handle.active { background: rgb(59 130 246); }
.decompiler_resize_handle::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 2px; height: 30px; background: transparent; border-radius: 1px; transition: background 0.15s; }
.decompiler_resize_handle:hover::after { background: rgba(255, 255, 255, 0.5); }

/* Minimal scrollbar for file tree */
.decompiler_tree_content { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.decompiler_tree_content:hover { scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
.decompiler_tree_content::-webkit-scrollbar { width: 6px; height: 6px; }
.decompiler_tree_content::-webkit-scrollbar-track { background: transparent; }
.decompiler_tree_content::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.decompiler_tree_content:hover::-webkit-scrollbar-thumb { background: rgba(155, 155, 155, 0.5); }
.decompiler_tree_content::-webkit-scrollbar-thumb:hover { background: rgba(155, 155, 155, 0.7); }
.dark .decompiler_tree_content:hover { scrollbar-color: rgba(100, 100, 100, 0.6) transparent; }
.dark .decompiler_tree_content:hover::-webkit-scrollbar-thumb { background: rgba(100, 100, 100, 0.6); }
.dark .decompiler_tree_content::-webkit-scrollbar-thumb:hover { background: rgba(100, 100, 100, 0.8); }

/* Monaco Editor scrollbar - show on hover */
.monaco_container .monaco-scrollable-element > .scrollbar { opacity: 0; transition: opacity 0.2s ease; }
.monaco_container:hover .monaco-scrollable-element > .scrollbar { opacity: 1; }
.monaco_container .monaco-scrollable-element > .scrollbar > .slider { background: rgba(155, 155, 155, 0.4) !important; border-radius: 4px !important; }
.monaco_container .monaco-scrollable-element > .scrollbar > .slider:hover { background: rgba(155, 155, 155, 0.6) !important; }
.dark .monaco_container .monaco-scrollable-element > .scrollbar > .slider { background: rgba(100, 100, 100, 0.5) !important; }
.dark .monaco_container .monaco-scrollable-element > .scrollbar > .slider:hover { background: rgba(100, 100, 100, 0.7) !important; }

/* Tabs scrollbar - minimal, show on hover */
.decompiler_tabs { scrollbar-width: thin; scrollbar-color: transparent transparent; overflow-x: auto; overflow-y: hidden; }
.decompiler_tabs:hover { scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
.decompiler_tabs::-webkit-scrollbar { height: 4px; }
.decompiler_tabs::-webkit-scrollbar-track { background: transparent; }
.decompiler_tabs::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
.decompiler_tabs:hover::-webkit-scrollbar-thumb { background: rgba(155, 155, 155, 0.5); }
.dark .decompiler_tabs:hover { scrollbar-color: rgba(100, 100, 100, 0.6) transparent; }
.dark .decompiler_tabs:hover::-webkit-scrollbar-thumb { background: rgba(100, 100, 100, 0.6); }

/* Extend time button */
.decompiler_extend_btn { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.5rem; font-size: 0.75rem; color: rgb(59 130 246); background: transparent; border: 1px solid rgb(59 130 246); border-radius: 0.375rem; cursor: pointer; transition: all 0.15s; }
.decompiler_extend_btn:hover { background: rgb(59 130 246); color: white; }
.decompiler_extend_btn:disabled { opacity: 0.5; cursor: not-allowed; }
.decompiler_extend_btn svg { width: 0.875rem; height: 0.875rem; }

/* Download button in header */
.decompiler_download_btn { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem; font-size: 0.75rem; color: rgb(34 197 94); background: transparent; border: 1px solid rgb(34 197 94); border-radius: 0.375rem; cursor: pointer; transition: all 0.15s; }
.decompiler_download_btn:hover { background: rgb(34 197 94); color: white; }
.decompiler_download_btn svg { width: 0.875rem; height: 0.875rem; }


/* Quick open modal */
.decompiler_quick_open { position: fixed; top: 15%; left: 50%; transform: translateX(-50%); width: 550px; max-width: 90vw; z-index: 100; background: white; border: 1px solid rgb(209 213 219); border-radius: 0.75rem; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.dark .decompiler_quick_open { background: rgb(30 30 30); border-color: rgb(60 60 60); }
.decompiler_quick_open_input { width: 100%; padding: 1rem; font-size: 1rem; border: none; border-bottom: 1px solid rgb(229 231 235); border-radius: 0.75rem 0.75rem 0 0; outline: none; }
.dark .decompiler_quick_open_input { background: rgb(30 30 30); border-color: rgb(60 60 60); color: white; }
.decompiler_quick_open_results { max-height: 350px; overflow-y: auto; }
.decompiler_quick_open_item { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; cursor: pointer; }
.decompiler_quick_open_item:hover, .decompiler_quick_open_item.selected { background: rgb(243 244 246); }
.dark .decompiler_quick_open_item:hover, .dark .decompiler_quick_open_item.selected { background: rgb(45 45 45); }
.decompiler_quick_open_icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.decompiler_quick_open_icon.java { color: rgb(234 88 12); }
.decompiler_quick_open_icon.xml { color: rgb(59 130 246); }
.decompiler_quick_open_icon.other { color: rgb(107 114 128); }
.decompiler_quick_open_name { font-size: 0.875rem; color: rgb(17 24 39); font-weight: 500; }
.dark .decompiler_quick_open_name { color: white; }
.decompiler_quick_open_path { font-size: 0.75rem; color: rgb(107 114 128); margin-left: auto; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decompiler_backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; }

/* Mobile toggle button for explorer */
.decompiler_mobile_toggle { display: none; position: fixed; bottom: 1rem; left: 1rem; z-index: 50; width: 3rem; height: 3rem; background: rgb(59 130 246); color: white; border: none; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.2); cursor: pointer; align-items: center; justify-content: center; }
.decompiler_mobile_toggle svg { width: 1.5rem; height: 1.5rem; }

/* File stats bar */
.decompiler_file_stats { display: flex; align-items: center; gap: 1rem; padding: 0.375rem 0.75rem; font-size: 0.7rem; color: rgb(107 114 128); background: rgb(249 250 251); border-top: 1px solid rgb(229 231 235); }
.dark .decompiler_file_stats { background: rgb(17 24 39); border-color: rgb(55 65 81); }
.decompiler_file_stats span { display: flex; align-items: center; gap: 0.25rem; }

/* Breadcrumb */
.decompiler_breadcrumb { display: flex; align-items: center; gap: 0.25rem; padding: 0.375rem 0.75rem; font-size: 0.75rem; color: rgb(107 114 128); background: rgb(249 250 251); border-bottom: 1px solid rgb(229 231 235); overflow-x: auto; white-space: nowrap; }
.dark .decompiler_breadcrumb { background: rgb(17 24 39); border-color: rgb(55 65 81); }
.decompiler_breadcrumb_item { cursor: pointer; }
.decompiler_breadcrumb_item:hover { color: rgb(59 130 246); }
.decompiler_breadcrumb_sep { color: rgb(209 213 219); }

/* Toast notification */
.decompiler_toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); padding: 0.75rem 1.5rem; font-size: 0.875rem; color: white; background: rgb(34 197 94); border-radius: 0.5rem; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 100; animation: toastIn 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 1rem); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Settings Panel */
.decompiler_settings_panel { position: absolute; top: 100%; right: 0; width: 280px; background: white; border: 1px solid rgb(229 231 235); border-radius: 0.5rem; box-shadow: 0 10px 25px rgba(0,0,0,0.15); z-index: 50; padding: 0.75rem; }
.dark .decompiler_settings_panel { background: rgb(30 30 30); border-color: rgb(60 60 60); }
.decompiler_settings_row { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; font-size: 0.8rem; color: rgb(55 65 81); border-bottom: 1px solid rgb(243 244 246); }
.dark .decompiler_settings_row { color: rgb(209 213 219); border-color: rgb(55 65 81); }
.decompiler_settings_row:last-child { border-bottom: none; }
.decompiler_settings_label { display: flex; align-items: center; gap: 0.375rem; }
.decompiler_settings_label svg { width: 1rem; height: 1rem; color: rgb(107 114 128); }

/* Toggle Switch */
.decompiler_toggle { position: relative; width: 2.5rem; height: 1.25rem; background: rgb(209 213 219); border-radius: 9999px; cursor: pointer; transition: background 0.2s; }
.decompiler_toggle.active { background: rgb(59 130 246); }
.decompiler_toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 1rem; height: 1rem; background: white; border-radius: 50%; transition: transform 0.2s; }
.decompiler_toggle.active::after { transform: translateX(1.25rem); }

/* Font Size Control */
.decompiler_fontsize_control { display: flex; align-items: center; gap: 0.5rem; }
.decompiler_fontsize_btn { width: 1.5rem; height: 1.5rem; display: flex; align-items: center; justify-content: center; background: rgb(243 244 246); border: none; border-radius: 0.25rem; cursor: pointer; font-size: 0.875rem; font-weight: 600; }
.dark .decompiler_fontsize_btn { background: rgb(55 65 81); color: white; }
.decompiler_fontsize_btn:hover { background: rgb(229 231 235); }
.dark .decompiler_fontsize_btn:hover { background: rgb(75 85 99); }

/* Theme Select */
.decompiler_theme_select { padding: 0.25rem 0.5rem; font-size: 0.75rem; border: 1px solid rgb(209 213 219); border-radius: 0.25rem; background: white; cursor: pointer; }
.dark .decompiler_theme_select { background: rgb(55 65 81); border-color: rgb(75 85 99); color: white; }

/* Global Search Modal */
.decompiler_global_search { position: fixed; top: 10%; left: 50%; transform: translateX(-50%); width: 600px; max-width: 95vw; max-height: 70vh; background: white; border: 1px solid rgb(209 213 219); border-radius: 0.75rem; box-shadow: 0 25px 50px rgba(0,0,0,0.25); z-index: 100; display: flex; flex-direction: column; }
.dark .decompiler_global_search { background: rgb(30 30 30); border-color: rgb(60 60 60); }
.decompiler_global_search_header { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem; border-bottom: 1px solid rgb(229 231 235); }
.dark .decompiler_global_search_header { border-color: rgb(55 65 81); }
.decompiler_global_search_input { flex: 1; padding: 0.5rem; font-size: 0.875rem; border: 1px solid rgb(209 213 219); border-radius: 0.375rem; outline: none; }
.dark .decompiler_global_search_input { background: rgb(45 45 45); border-color: rgb(75 85 99); color: white; }
.decompiler_global_search_results { flex: 1; overflow-y: auto; max-height: 400px; }
.decompiler_search_result_item { padding: 0.625rem 0.75rem; border-bottom: 1px solid rgb(243 244 246); cursor: pointer; }
.decompiler_search_result_item:hover { background: rgb(249 250 251); }
.dark .decompiler_search_result_item { border-color: rgb(55 65 81); }
.dark .decompiler_search_result_item:hover { background: rgb(45 45 45); }
.decompiler_search_result_file { font-size: 0.75rem; color: rgb(59 130 246); margin-bottom: 0.25rem; }
.decompiler_search_result_line { font-size: 0.8rem; font-family: monospace; color: rgb(55 65 81); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dark .decompiler_search_result_line { color: rgb(209 213 219); }
.decompiler_search_result_line mark { background: rgb(254 240 138); color: inherit; padding: 0 0.125rem; border-radius: 0.125rem; }
.dark .decompiler_search_result_line mark { background: rgb(133 77 14); }

/* Filter Bar */
.decompiler_filter_bar { display: flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.5rem; background: rgb(249 250 251); border-bottom: 1px solid rgb(229 231 235); font-size: 0.7rem; }
.dark .decompiler_filter_bar { background: rgb(17 24 39); border-color: rgb(55 65 81); }
.decompiler_filter_btn { padding: 0.25rem 0.5rem; background: transparent; border: 1px solid rgb(209 213 219); border-radius: 0.25rem; cursor: pointer; font-size: 0.65rem; color: rgb(107 114 128); }
.decompiler_filter_btn:hover, .decompiler_filter_btn.active { background: rgb(59 130 246); border-color: rgb(59 130 246); color: white; }
.dark .decompiler_filter_btn { border-color: rgb(75 85 99); }

/* Tab Context Menu */
.decompiler_context_menu { position: fixed; background: white; border: 1px solid rgb(209 213 219); border-radius: 0.375rem; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 100; min-width: 150px; padding: 0.25rem 0; }
.dark .decompiler_context_menu { background: rgb(30 30 30); border-color: rgb(60 60 60); }
.decompiler_context_item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; font-size: 0.8rem; color: rgb(55 65 81); cursor: pointer; }
.decompiler_context_item:hover { background: rgb(243 244 246); }
.dark .decompiler_context_item { color: rgb(209 213 219); }
.dark .decompiler_context_item:hover { background: rgb(45 45 45); }
.decompiler_context_item svg { width: 0.875rem; height: 0.875rem; color: rgb(107 114 128); }
.decompiler_context_sep { height: 1px; background: rgb(229 231 235); margin: 0.25rem 0; }
.dark .decompiler_context_sep { background: rgb(55 65 81); }

/* Pinned Tab */
.decompiler_tab.pinned { background: rgba(59, 130, 246, 0.1); }
.decompiler_tab.pinned .decompiler_tab_close { display: none; }
.decompiler_tab_pin { width: 0.625rem; height: 0.625rem; color: rgb(59 130 246); }

/* Recent Files */
.decompiler_recent_files { padding: 0.5rem; border-bottom: 1px solid rgb(229 231 235); }
.dark .decompiler_recent_files { border-color: rgb(55 65 81); }
.decompiler_recent_title { font-size: 0.65rem; text-transform: uppercase; color: rgb(107 114 128); margin-bottom: 0.375rem; padding: 0 0.25rem; }
.decompiler_recent_item { display: flex; align-items: center; gap: 0.375rem; padding: 0.25rem; font-size: 0.75rem; color: rgb(55 65 81); cursor: pointer; border-radius: 0.25rem; }
.decompiler_recent_item:hover { background: rgb(243 244 246); }
.dark .decompiler_recent_item { color: rgb(209 213 219); }
.dark .decompiler_recent_item:hover { background: rgb(45 45 45); }

/* Mobile overlay when explorer is open */
.decompiler_mobile_overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 55; }

/* Print styles */
@media print {
    .decompiler_file_tree, .decompiler_ide_header, .decompiler_tabs, .decompiler_breadcrumb, .decompiler_file_stats, .decompiler_mobile_toggle, .decompiler_resize_handle { display: none !important; }
    .decompiler_code_panel { width: 100% !important; }
    .monaco_container { height: auto !important; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .decompiler_mobile_toggle { display: flex; }
    .decompiler_mobile_overlay.active { display: block; }
    .decompiler_ide_body { position: relative; }
    .decompiler_file_tree { position: fixed !important; top: 0; left: 0; width: 85vw !important; max-width: 320px !important; height: 100vh; z-index: 60; transform: translateX(-100%); transition: transform 0.3s ease; box-shadow: 4px 0 20px rgba(0,0,0,0.2); }
    .decompiler_file_tree.mobile_open { transform: translateX(0); }
    .decompiler_resize_handle { display: none; }
    .decompiler_ide_header { flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem; }
    .decompiler_ide_actions { flex-wrap: wrap; gap: 0.375rem; }
    .decompiler_ide_stats { display: none; }
    .decompiler_tabs { padding: 0 0.5rem; }
    .decompiler_tab { padding: 0.375rem 0.5rem; font-size: 0.7rem; }
    .decompiler_download_btn span, .decompiler_extend_btn span:not(:first-child) { display: none; }
    .decompiler_download_btn, .decompiler_extend_btn { padding: 0.375rem; }
    .decompiler_quick_open { top: 5%; width: 95vw; }
    .decompiler_file_stats { flex-wrap: wrap; gap: 0.5rem; }
}
