/* Main styles for Japanese Real-Time Transcribe & Translate */

:root {
  /* Color palette */
  --primary: #4361ee;
  --primary-light: #4895ef;
  --secondary: #3f37c9;
  --accent: #f72585;
  --accent-light: #ff4d6d;
  --background: #b5d7fa;
  --card: #ffffff;
  --text: #2b2d42;
  --text-light: #6c757d;
  --border: #dee2e6;
  --success: #4cc9f0;
  --warning: #ffbe0b;
  --error: #d90429;
}

/* Base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Typography */
h1, h2, h3 {
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 2.5rem;
  margin-top: 1rem;
  position: relative;
}

h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--accent);
  margin: 0.5rem auto;
  border-radius: 2px;
}

h2 {
  font-size: 1.8rem;
  margin-top: 2rem;
  padding-bottom: 0.5rem;
  position: relative;
}

h2::after {
  content: '';
  display: block;
  width: 100px;
  height: 3px;
  background-color: var(--primary-light);
  margin: 0.5rem auto;
  border-radius: 2px;
}

/* Card layout */
.form-section {
  background-color: var(--card);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.form-section:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

.animated-card {
  animation: fadeInUp 0.7s cubic-bezier(.39,.575,.56,1.000) both;
}
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.hero-card {
  transition: box-shadow 0.3s;
}
.hero-card:hover {
  box-shadow: 0 10px 40px rgba(67,97,238,0.18);
}

/* Form elements */
form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

label {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.3rem;
  display: block;
}

textarea {
  width: 100%;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  transition: all 0.3s;
}

textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.controls-group {
  margin-top: 1rem;
}

/* Button styling */
.btn-del{
  background-color: var(---error, #f77f7f);
  color: white;
  border: none;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  margin-right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  margin-right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-pagination {
  background-color: var(--primary-light);
  color: white;
  border: none;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  margin-right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-mic {
  display: flex;
  align-items: center;
}

.btn-mic::before {
  content: '🎤';
  margin-right: 0.5rem;
}

.btn-stop::before {
  content: '⏹️';
  margin-right: 0.5rem;
}

.btn-submit {
  background-color: var(--accent);
  display: block;
  width: 100%;
  max-width: 300px;
  margin-top: 1.5rem;
}

.btn-submit:hover {
  background-color: var(--accent-light);
}

/* Small logout button */
.btn-logout {
  padding: 0.4rem 1rem;
  font-size: 0.95rem;
  border-radius: 5px;
  background: var(--accent, #ff8a65);
  color: #fff;
  margin-left: 0.5rem;
  margin-top: 0;
  margin-bottom: 0;
  box-shadow: none;
}
.btn-logout:hover {
  background: #ff7043;
}

/* Status indicator */
.status {
  display: inline-flex;
  align-items: center;
  margin-left: 1rem;
  font-style: italic;
  color: var(--text-light);
}

.status.active {
  color: var(--primary);
}

.status.active::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--success);
  margin-right: 0.5rem;
  display: inline-block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* File input styling */
.file-input-wrapper {
  position: relative;
  margin-top: 0.5rem;
}

input[type="file"] {
  border: 1px solid var(--border);
  padding: 0.7rem;
  border-radius: 8px;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.02);
}

/* File upload section styling */
.file-input-wrapper {
  background: #f3f6fa;
  border: 1.5px dashed var(--primary, #4a86e8);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.file-input-wrapper input[type="file"] {
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--primary, #4a86e8);
  padding: 0;
  margin: 0;
}
.file-input-wrapper label {
  margin-bottom: 0;
  font-weight: 500;
  color: var(--primary, #4a86e8);
}

/* Table styling */
.table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  background-color: var(--card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

tr:hover {
  background-color: rgba(67, 97, 238, 0.05);
}

.table-wrapper table tr {
  transition: background 0.2s;
}
.table-wrapper table tr:hover {
  background: #e3f0ff;
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(67, 97, 238, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

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

/* Login page dropdown styling */
.login-container select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1.2rem;
  background: #f8f9fa;
  color: #333;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.login-container select:focus {
  border-color: var(--primary, #4a86e8);
  outline: none;
  box-shadow: 0 0 0 2px rgba(74, 134, 232, 0.15);
}

/* Stylish modal overlay for delete confirmation */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(44, 44, 44, 0.35);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.modal-content {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(67,97,238,0.13);
  padding: 2.2rem 2.5rem 1.5rem 2.5rem;
  min-width: 320px;
  max-width: 90vw;
  text-align: center;
  animation: fadeInUp 0.3s cubic-bezier(.39,.575,.56,1.000) both;
}
.modal-icon {
  margin-bottom: 1rem;
}
.modal-message {
  font-size: 1.25rem;
  color: #222;
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
}
.btn-cancel {
  background: #f1f1f1;
  color: #333;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-cancel:hover {
  background: #e0e7ff;
}
.btn-danger {
  background: var(--error, #d90429);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover {
  background: #b3001b;
}

/* Center mic controls group */
.mic-center-group {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.5em;
}

/* Larger Start Mic button */
#start-mic.btn-mic {
  font-size: 1.25rem;
  padding: 1.1rem 2.5rem;
  border-radius: 2.5rem;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(67,97,238,0.10);
  transition: background 0.2s, transform 0.1s;
}
#start-mic.btn-mic:hover {
  background: linear-gradient(90deg, var(--primary-light), var(--accent-light));
  transform: scale(1.05);
}

/* Conversation styles */
.conversation-section {
  background-color: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.conversation-section h3 {
  margin-bottom: 1rem;
  color: var(--primary);
  text-align: left;
}

#saved-conversations {
  list-style-type: none;
  margin: 1rem 0;
  padding: 0;
}

#saved-conversations li {
  margin: 0.5rem 0;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

#saved-conversations a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
  display: block;
}

#saved-conversations a:hover {
  color: var(--primary);
  text-decoration: underline;
}

#new-conv-modal .modal-content {
  width: 90%;
  max-width: 400px;
}

#new-conv-modal input {
  width: 100%;
  padding: 0.75rem;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

#new-conv-modal .modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

#conv-error {
  font-size: 0.9rem;
  color: var(--error);
}

/* Hamburger button styles */
.hamburger-button {
  display: inline-block;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
  margin-left: auto;
}

.hamburger-icon {
  width: 28px;
  height: 22px;
  position: relative;
  display: inline-block;
  cursor: pointer;
  transition: .4s;
}

.hamburger-icon span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--primary);
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transition: all 0.3s cubic-bezier(.4,2,.6,1);
}

/* Default: show hamburger */
.hamburger-icon span:nth-child(1) {
  top: 0px;
  transform: rotate(0deg);
}
.hamburger-icon span:nth-child(2) {
  opacity: 1;
  left: 0;
  top: 9px;
}
.hamburger-icon span:nth-child(3) {
  top: 18px;
  transform: rotate(0deg);
}

/* When open: show X */
.hamburger-icon.open span:nth-child(1) {
  top: 9px;
  transform: rotate(45deg);
}
.hamburger-icon.open span:nth-child(2) {
  opacity: 0;
  left: 50%;
}
.hamburger-icon.open span:nth-child(3) {
  top: 9px;
  transform: rotate(-45deg);
}

/* Collapsible conversation section */
.conversation-content {
  max-height: 500px; /* Adjust as needed */
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.conversation-content.collapsed {
  max-height: 0;
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.conversation-header h3 {
  margin-bottom: 0;
}

/* Delete button animation */
.btn-del svg {
  transition: transform 0.25s cubic-bezier(.4,2,.6,1), fill 0.25s, stroke 0.25s;
}
.btn-del:hover svg {
  transform: scale(1.18) rotate(-12deg);
  stroke: var(--accent, #f72585);
  fill: var(--accent-light, #ff4d6d);
  animation: wiggle 0.3s 1;
}
@keyframes wiggle {
  0% { transform: scale(1.18) rotate(-12deg); }
  25% { transform: scale(1.22) rotate(8deg); }
  50% { transform: scale(1.18) rotate(-8deg); }
  75% { transform: scale(1.22) rotate(6deg); }
  100% { transform: scale(1.18) rotate(-12deg); }
}

/* Small TTS button style */
.btn-tts-small {
  font-size: 1em;
  padding: 0.15em 0.45em;
  border-radius: 50%;
  min-width: 1.8em;
  min-height: 1.8em;
  line-height: 1;
  background: #f3f6fa;
  color: var(--primary);
  border: 1px solid var(--primary-light);
  margin-left: 0.2em;
  margin-right: 0.2em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}