/* ==========================================
   APK Extractor Web - Main Stylesheet
   ========================================== */

/* Font Family */
body {
  font-family: 'Space Grotesk', sans-serif;
}

/* ==========================================
   File Viewer Modal
   ========================================== */

.file-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 2rem;
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.file-viewer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.file-viewer-content {
  background: white;
  border-radius: 12px;
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.file-viewer-overlay.active .file-viewer-content {
  transform: scale(1);
}

.dark .file-viewer-content {
  background: #1f2937;
}

.file-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .file-viewer-header {
  border-bottom-color: #374151;
}

.file-viewer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.file-viewer-body pre {
  margin: 0;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.file-viewer-body pre code {
  display: block;
  padding: 1.5rem;
  overflow-x: auto;
}

.file-viewer-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  min-height: 400px;
}

.dark .file-viewer-image-container {
  background: #111827;
}

/* ==========================================
   XAPK Tabs
   ========================================== */

.xapk-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.xapk-tab.active {
  color: #10b981;
  border-bottom-color: #10b981;
}

.dark .xapk-tab.active {
  color: #34d399;
  border-bottom-color: #34d399;
}

.xapk-tab:not(.active):hover {
  color: #10b981;
}

.dark .xapk-tab:not(.active):hover {
  color: #34d399;
}

/* ==========================================
   File Tree Container
   ========================================== */

.file-tree-container {
  overflow-y: auto;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.dark .file-tree-container {
  background: #101622;
  border-color: #374151;
}

/* File Tree Animations */
#fileTree {
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#fileTree.slide-out {
  transform: translateX(20px);
  opacity: 0;
}

#fileTree.slide-in {
  transform: translateX(-20px);
  opacity: 0;
}

#fileTree.visible {
  transform: translateX(0);
  opacity: 1;
}

/* ==========================================
   Custom Scrollbar Styles
   ========================================== */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 6px;
}

.dark ::-webkit-scrollbar-track {
  background: #1a1f2e;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #15803d 0%, #14532d 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
  background: #14532d;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #16a34a #f1f3f5;
}

.dark * {
  scrollbar-color: #16a34a #1a1f2e;
}

/* Scrollbar for code blocks */
.file-viewer-body pre::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.file-viewer-body pre::-webkit-scrollbar-track {
  background: #21252b;
}

.file-viewer-body pre::-webkit-scrollbar-thumb {
  background: #16a34a;
  border-radius: 5px;
}

.file-viewer-body pre::-webkit-scrollbar-thumb:hover {
  background: #15803d;
}

/* ==========================================
   Theme Switcher Animation
   ========================================== */

.theme-toggle-btn {
  position: relative;
  overflow: hidden;
}

.theme-icon {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.theme-icon.rotate-out {
  transform: rotate(180deg);
  opacity: 0;
}

.theme-icon.rotate-in {
  transform: rotate(0deg);
  opacity: 1;
}

/* ==========================================
   Smooth Theme Transitions
   ========================================== */

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

* {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Language Switcher */
.lang-dropdown {
  display: none;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
}

.lang-dropdown.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Custom scrollbar for language dropdown */
.lang-dropdown::-webkit-scrollbar {
  width: 6px;
}

.lang-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.lang-dropdown::-webkit-scrollbar-thumb {
  background: #16a34a;
  border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb:hover {
  background: #15803d;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lang-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  transition: background-color 0.2s ease;
  border: none;
  background: transparent;
  cursor: pointer;
}

.dark .lang-option {
  color: #e5e7eb;
}

.lang-option:hover {
  background-color: #f3f4f6;
}

.dark .lang-option:hover {
  background-color: #374151;
}

.lang-option.active {
  background-color: #dcfce7;
  color: #16a34a;
  font-weight: 600;
}

.dark .lang-option.active {
  background-color: rgba(22, 163, 74, 0.2);
  color: #4ade80;
}

