<script setup>
defineProps({
  isOpen: {
    type: Boolean,
    default: true
  }
})
</script>

<template>
  <aside class="sidebar unselectable" :class="{ 'is-open': isOpen }">
    <nav class="sidebar-nav">
      <router-link to="/passwords" class="nav-item" v-ripple>Passwords</router-link>
      <router-link to="/clipboard-sniffer" class="nav-item" v-ripple>Clipboard Sniffer</router-link>
      <router-link to="/url-cleaner" class="nav-item" v-ripple>URL Cleaner</router-link>
      <router-link to="/qr-scanner" class="nav-item" v-ripple>QR Scanner</router-link>
      <router-link to="/qr-code" class="nav-item" v-ripple>QR Code</router-link>
    </nav>
  </aside>
</template>

<style scoped>
.sidebar {
  /* Mobile First Styles */
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 250px;
  background-color: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-x: hidden;
  transition: transform 0.3s ease;
  border-right: 1px solid var(--panel-border);
  z-index: 1000;
  box-shadow: var(--panel-shadow);
  transform: translateX(-100%);
}

.sidebar.is-open {
  transform: translateX(0);
}

@media (min-width: 768px) {
  .sidebar {
    position: static;
    transform: none;
    width: 0;
    height: auto;
    transition: width 0.3s ease;
    z-index: auto;
    box-shadow: none; /* Shadow handled by panel logic or not needed inline */
  }

  .sidebar.is-open {
    width: 250px;
    transform: none;
  }
}

.sidebar-nav {
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 250px; /* Fixed width for content */
  min-width: 250px;
  padding-top: 1rem; /* Add some top padding for mobile aesthetic */
}

@media (min-width: 768px) {
  .sidebar-nav {
    padding-top: 0;
  }
}

.nav-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
  font-weight: bold;
}

.nav-item:hover {
  background-color: var(--button-hover-bg);
  color: var(--text-strong);
}

.nav-item.router-link-active {
  color: var(--primary-accent);
  background-color: var(--toggle-bg);
  border-right: 2px solid var(--primary-accent);
}

.divider {
  height: 1px;
  background-color: var(--panel-border);
  margin: 0.5rem 0;
}
</style>
