@font-face {
  font-family: 'Tektur';
  src: url('fonts/Tektur.ttf') format('truetype');
}
@font-face {
  font-family: 'Strokey';
  src: url('fonts/Strokey.otf') format('opentype');
}
:root {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --primary: 217.2 91.2% 59.8%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 217.2 32.6% 17.5%;
  --accent: 45 100% 60%;
  --accent-foreground: 210 40% 98%;
  --radius: 0.5rem;
}
body {
  font-family: 'Tektur', Arial, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  margin: 0;
  padding: 0;
  min-height: auto;
  display: block;
  box-sizing: border-box;
  height: 100%;
  overflow: hidden;
}
.panel-root {
  min-width: 0;
  max-width: 420px;
  background: hsl(var(--background) / 0.95);
  border-radius: 1.3rem;
  border: 1px solid hsl(var(--primary) / 0.25);
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at top center, rgba(32,119,255,0.35) 0%, rgba(32,119,255,0.10) 70%, transparent 100%);
  height: 100%; /* Ensure it takes full height of container */
  box-sizing: border-box; /* Include padding in height calculation */
}
.panel-root::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 90px;
  z-index: 0;
  pointer-events: none;

}
.tab-panel, .tab-menu, .panel-footer {
  position: relative;
  z-index: 1;
}
.tab-menu {
  display: flex;
  gap: 0.5rem;
  overflow: hidden; /* Prevent overflow if shrinking isn't enough */
  justify-content: center; /* Center the tab buttons */
}
.tab-btn {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground) / 0.7);
  border: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.5rem 0.8rem;
  font-size: 1rem;
  font-family: 'Tektur', Arial, sans-serif;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 1; /* Allow buttons to shrink */
  min-width: 0; /* Allow shrinking below intrinsic minimum width */
}
.tab-btn.active {
  background: hsl(var(--primary) / 0.2);
  color: hsl(var(--accent));
  font-weight: 600;
  box-shadow: 0 0 0 1.5px hsl(var(--primary) / 0.25) inset;
}
.tab-btn:hover {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--accent));
}
.tab-icon {
  height: 1.5em;
  width: 1.5em;
  transition: transform 0.2s ease-in-out; /* Add transition for smooth scaling */
}
.tab-btn:hover .tab-icon {
  transform: scale(1.5); /* Scale icon on parent hover */
}
.tab-panel {
  background: hsl(var(--background) / 0.95);
  border: 1px solid hsl(var(--muted));
  border-radius: var(--radius);
  box-shadow: 0 4px 24px 0 rgba(32,119,255,0.10), 0 1.5px 8px 0 rgba(32,119,255,0.08) inset;
  padding: 1rem 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
}
.tab-panel.active {
  display: block;
  z-index: 2;
  position: relative;
  box-shadow: 0 10px 20px #2077ff33;
  border-top: 1px solid hsl(var(--primary)/ 0.9);
  border-radius: 0 0 1.3rem 1.3rem; /* Rounded corners at the bottom */

}
.tab-panel button {
  width: 100%;
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
  background: linear-gradient(135deg,rgba(32,119,255,0.18),rgba(0,89,255,0.10));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--primary) / 0.18);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Tektur', Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 8px #2077ff22, 0 0 0 1.5px rgba(32,119,255,0.10) inset;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
}
/* Add margin back only to buttons that are NOT the last child */
.tab-panel button:not(:last-child) {
  margin-bottom: 0.75rem;
}
.tab-panel button:hover {
  background: linear-gradient(135deg,rgba(32,119,255,0.28),rgba(0,89,255,0.18));
  color: hsl(var(--accent));
  box-shadow: 0 6px 24px #2077ff44, 0 0 0 2px rgba(32,119,255,0.18) inset;
  transform: translateY(-2px) scale(1.03);
}
.tab-panel button .icon {
  height: 1.5em;
  width: 1.5em;
  transition: transform 0.2s ease-in-out; /* Add transition for smooth scaling */
}
.tab-panel button:hover .icon {
  transform: scale(1.5); /* Scale icon on parent hover */
}
#jsonFilesList {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid hsl(var(--primary) / 0.2);
  padding: 0.75rem;
  background: hsl(var(--background) / 0.8);
  border-radius: var(--radius);
}
#jsonFilesList p {
  margin: 0 0 0.5rem 0;
  font-size: 0.95em;
  color: hsl(var(--muted-foreground));
}
#jsonFilesList ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#jsonFilesList li {
  padding: 0.4em 0;
  font-size: 1em;
  border-bottom: 1px solid hsl(var(--primary) / 0.1);
}
#jsonFilesList li:last-child {
  border-bottom: none;
}
/* Status div for spacing */
#status {
  min-height: 2em; /* Maintain space between content and footer */
  visibility: hidden; /* Keep it hidden but maintain space */
}

/* Status popup styling */
.status-popup {
  position: fixed;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 500;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 300px;
  text-align: center;
}

.status-popup.visible {
  opacity: 1;
  transform: translateY(0);
}

.status-popup.success {
  background-color: rgba(46, 125, 50, 0.9);
  color: white;
}

.status-popup.error {
  background-color: rgba(211, 47, 47, 0.9);
  color: white;
}

.status-popup.info {
  background-color: rgba(2, 136, 209, 0.9);
  color: white;
}
.panel-footer {
  padding: 0.5rem 0;
  text-align: center;
  margin-top: auto;
  font-family: 'Strokey', sans-serif;
  color: hsl(var(--accent));
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  box-shadow: none;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  letter-spacing: -0.05em;
  position: relative;
  z-index: 1;
}
.panel-footer .icon {
  display: inline-block; /* Needed for transform/animation */
  vertical-align: middle; /* Align icon better with text */
  width: 1.2em; /* Ensure base width is set */
  height: 1.2em; /* Ensure base height is set */
  padding-left: 0.4rem; /* Add left padding */
  padding-right: 0.4rem; /* Add right padding */
  /* Add a subtle golden glow */
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7)); 
}

/* Media Query for smaller panel widths */
@media (max-width: 200px) { /* Adjust breakpoint as needed */
  .tab-btn .tab-text,
  .tab-panel button .button-text { /* Target both tab and panel button text */
    display: none; /* Hide text */
  }
  .tab-btn {
    padding: 0.5rem 0.75rem; /* Adjust padding for icon-only */
    min-width: auto; /* Allow button to shrink further */
  }
  .tab-panel button {
    padding: 0.75rem; /* Adjust padding for icon-only panel buttons */
    justify-content: center; /* Center the icon when text is hidden */
  }
}
