/* Reset a základ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;          /* Odstraní defaultní margin */
  padding: 0;         /* Odstraní defaultní padding */
  background-color: #1e1e1e;
  color: #ddd;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: block;     /* Není potřeba flex pro body, a tím se vyřeší odsazení */
}

/* Header musí být na vrchu s position: sticky a top: 0 */
header {
  position: sticky;
  top: 0;
  background-color: #121212;
  width: 100%;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.7);
  z-index: 1000;
}


nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-text-wrapper a img {
  height: 48px;
  width: 48px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0,0,0,0.6);
  display: block;
}

.logo-text-wrapper span {
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  user-select: none;
}

.menu {
  list-style: none;
  display: flex;
  gap: 24px;
}

.menu li a {
  color: #ddd;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.menu li a:hover,
.menu li a:focus {
  background-color: #ffcc00;
  color: #1e1e1e;
  outline: none;
}

.menu-toggle {
  display: none;
  font-size: 2rem;
  color: #ffcc00;
  cursor: pointer;
}

/* Nadpisy */
h2 {
  color: #ffcc00;
  margin: 1.5rem 0 1rem;
  font-weight: 700;
  font-size: 2rem;
  text-align: center;
}

/* Input container */
.input-container {
  display: flex;
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  width: 100%;
}

#user-input {
  flex-grow: 1;
  padding: 0.5rem 1rem;
  font-size: 1.1rem;
  border-radius: 8px;
  border: none;
  background-color: #2a2a2a;
  color: #ddd;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.7);
  transition: background-color 0.3s ease;
}

#user-input:focus {
  outline: none;
  background-color: #3c3c3c;
}

button {
  background-color: #ffcc00;
  color: #1e1e1e;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0 1.2rem;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

button:hover,
button:focus {
  background-color: #e6b800;
  outline: none;
}

#voice-button {
  width: 40px;
  height: 40px;
  padding: 0;
  font-weight: normal;
  background: url('mic.png') center center no-repeat;
  background-size: 60% 60%;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 204, 0, 0.7);
}

#voice-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  background-color: #555;
}

/* Recognized text */
#recognized-text {
  color: #ffcc00;
  text-align: center;
  margin-bottom: 1.5rem;
  min-height: 1.5rem;
  font-style: italic;
}

/* Textarea output */
#console-output {
  width: 100%;
  max-width: 700px;
  background-color: #2a2a2a;
  color: #ddd;
  border-radius: 12px;
  padding: 1rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  resize: none;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.7);
  margin: 0 auto 2rem;
  display: block;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-y: auto;
  height: 250px;
}

/* Loading spinner */
.loading-spinner {
  border: 5px solid #2a2a2a;
  border-top: 5px solid #ffcc00;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsivita */
@media (max-width: 768px) {
  nav {
    flex-wrap: wrap;
  }

  .menu {
    flex-direction: column;
    width: 100%;
    display: none;
    background-color: #121212;
    padding: 0.5rem 0;
  }

  .menu.active {
    display: flex;
  }

  .menu li {
    padding: 10px 1.5rem;
  }

  .menu-toggle {
    display: block;
  }

  .input-container {
    flex-direction: column;
  }

  button#voice-button {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    background-size: 20% 20%;
    margin-top: 0.5rem;
  }

  #console-output {
    height: 200px;
  }
}
