/* ============================================
   MENU STYLES - Navigation and settings menu
   ============================================ */

/* Pattern Menu */
#menu {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.98);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s;
  overflow: hidden;
}

#menu.hidden {
  opacity: 0;
  pointer-events: none;
}

.menu-header {
  padding: 15px 20px;
  padding-top: max(15px, env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.menu-title {
  color: white;
  font-size: 18px;
  font-weight: bold;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 5px 10px;
}

/* Tabs */
.menu-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.menu-tab {
  flex: 1;
  padding: 12px;
  color: rgba(255,255,255,0.5);
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.menu-tab:hover {
  color: rgba(255,255,255,0.8);
}

.menu-tab.active {
  color: white;
  border-bottom-color: #3b82f6;
}

.menu-tab .tab-icon {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}

.menu-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.menu-section {
  padding: 15px;
  display: none;
}

.menu-section.active {
  display: block;
}

.section-title {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-left: 5px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.menu-item {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.menu-item:hover, .menu-item:active {
  background: rgba(255,255,255,0.15);
  transform: scale(1.02);
}

.menu-item.active {
  outline: 2px solid #3b82f6;
}

.menu-preview {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
}

.menu-label {
  color: white;
  padding: 8px;
  font-size: 11px;
  text-align: center;
}

/* Settings Panel */
.settings-group {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
}

.settings-title {
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.setting-row:last-child {
  margin-bottom: 0;
}

.setting-label {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-description {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 600px) {
  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .menu-tab {
    padding: 10px 5px;
    font-size: 12px;
  }
}
