/* assets/styles/fonts.css */

@font-face {
  font-family: 'Noto Sans Assamese';
  src: url('../fonts/NotoSansBengali-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap; 
}

@font-face {
  font-family: 'Noto Sans Assamese';
  src: url('../fonts/NotoSansBengali-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

.transliteration-output {
  font-family: 'Noto Sans Assamese', sans-serif;
  font-size: 16px;
  line-height: 1.4;
  text-rendering: optimizeLegibility;
  font-variant-ligatures: common-ligatures;
  font-feature-settings: "kern" 1, "liga" 1, "mkmk" 1;
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Noto Sans Assamese', sans-serif;
  background: #f9f9f9;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background: #007acc;
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 1.5rem;
  font-weight: bold;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem;
}

.container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0 auto;
  gap: 6px;
}

textarea {
  width: 100%;
  min-height: 150px;
  font-size: 16px;
  padding: 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  resize: vertical;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  caret-color: black;
}

.buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
}

button {
  padding: 6px 12px;
  border: solid 1px;
  border-color: #858482;
  border-radius: 5px;
  background: #c5c8c9;
  color: #000000;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #f2ea91;
}

.reverse-wrapper {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
}

#reverseOutput {
  width: 100%;
  height: 100px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #f9f9f9;
  color: #333;
  font-family: 'Courier New', Courier, monospace;
  resize: none;
}

/* MODAL --------------------*/
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  height: 80vh;
  background: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: #333;
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
  z-index: 2;
}

.modal-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* MODAL TABLE --------------------*/
.table-container {
  overflow-x: auto;
  background: #fff;
  padding: 15px;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th, td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
}

th {
  background: #222;
  color: #fff;
}

tr:nth-child(even) {
  background: #f2f2f2;
}

/* INLINE RECORDER BAR --------------------*/
.recorder-bar {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
}

.rec-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

#audioPreview {
  height: 32px;
}

#audioVisualizer {
  flex: 1;
  height: 26px;
  width: 186px;
  background: transparent;
  border: solid 1px;
  border-color: #007acc;
  border-radius: 5px;
}

#uploadBtn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.9;
}

#uploadBtn.loading::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top: 2px solid #fff;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  animation: spin 0.7s linear infinite;
}

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

/* MOBILE --------------------*/
@media(max-width: 480px) {
  .container {
    width: 100%;
    max-width: 400px;
    min-height: 150px;
    margin: 0 auto;
  }
  textarea {
    font-size: 1rem;
  }
  button {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
}
