/* Android app viewport setup */
html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

body {
  font-family: "Roboto", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* App bar */
.app-bar {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

.app-title {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  flex-grow: 1;
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.menu-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  position: relative;
  z-index: 101;
}

.menu-btn svg {
  width: 24px;
  height: 24px;
}

.menu-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

/* Main content area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
  height: calc(100vh - 56px - 72px);
}

textarea {
  flex: 1;
  width: 100%;
  padding: 16px;
  font-size: 16px;
  background: #111;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  resize: none;
  font-family: "Roboto", inherit;
  line-height: 1.5;
  outline: none;
}

textarea:focus {
  border-color: #4facfe;
}

.status {
  margin-top: 16px;
  font-style: italic;
  color: #ccc;
  text-align: center;
  min-height: 20px;
}

/* Custom dropdown styles */
.custom-select-container {
  position: fixed;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 250px;
  z-index: 1000;
  display: none;
}

.voice-select-btn {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  background: #000;
  color: #fff;
  border: 2px solid #4facfe;
  border-radius: 8px;
  cursor: pointer;
  text-align: right;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.voice-select-btn:hover {
  border-color: #005bea;
}

.voice-select-btn::after {
  content: '▼';
  color: #4facfe;
  font-size: 0.8rem;
}

.voice-dropdown {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  background: #000;
  border: 2px solid #4facfe;
  border-radius: 8px;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, border-width 0.3s ease-in-out, padding 0.3s ease-in-out;
  opacity: 1;
  visibility: visible;
}

.voice-dropdown.hidden {
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  border-width: 0;
  padding: 0;
}

.voice-option {
  padding: 16px;
  color: #fff;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 254, 0.1);
  transition: background-color 0.2s ease;
  font-size: 16px;
}

.voice-option:hover, .voice-option:active {
  background-color: rgba(79, 172, 254, 0.1);
}

.voice-option.selected {
  background-color: #4facfe;
  color: #000;
  font-weight: 500;
}

.voice-option:last-child {
  border-bottom: none;
}

/* Bottom navigation */
.bottom-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #111;
  border-top: 1px solid #333;
  flex-shrink: 0;
  height: 72px;
  box-sizing: border-box;
}

.nav-right {
  display: flex;
  gap: 12px;
}

.nav-btn {
  background: none;
  border: 1px solid #4facfe;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nav-btn:active {
  background-color: rgba(79, 172, 254, 0.1);
}

.nav-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.nav-btn svg {
  width: 24px;
  height: 24px;
}

/* Hide elements */
#audio-player {
  display: none !important;
}

#raw-response {
  display: none !important;
}

.icon-btn {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  background: #4facfe;
  border: none;
  color: #000;
  padding: 1rem;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.icon-btn svg {
  width: 24px;
  height: 24px;
}

/* Remove web-specific styles */
.generate-section,
.telegram-btn,
#controls,
.voice-select-btn,
.nav-btn span,
.icon-btn {
  display: none !important;
}

/* Ensure full viewport coverage */
@media screen and (max-height: 600px) {
  .app-bar {
    height: 48px;
  }
  
  .main-content {
    height: calc(100vh - 48px - 64px);
  }
  
  .bottom-nav {
    height: 64px;
  }
}

/* Hide scrollbars for Android app feel */
::-webkit-scrollbar {
  display: none;
}

* {
  -ms-overflow-style: none;
  scrollbar-width: none;
}