/* Gaeilge Live — Meta Ray-Ban Display Translator */
/* Green theme | Helvetica | D-pad optimized */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 22px;
  line-height: 1.4;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 0;
}

#app {
  width: 100%;
  max-width: 600px;
  height: 100vh;
  height: -webkit-fill-available;
  max-height: 600px;
  display: flex;
  flex-direction: column;
  background: #0a1f0a;
  margin: 0 auto;
}

/* Desktop: center-top alignment */
@media (min-width: 601px) {
  html, body {
    padding-top: 40px;
  }
  #app {
    border-radius: 12px;
    border: 1px solid #2E7D32;
    box-shadow: 0 4px 40px rgba(76, 175, 80, 0.1);
  }
}

/* Mobile: fill the screen */
@media (max-width: 600px) {
  #app {
    max-height: 100vh;
    max-height: -webkit-fill-available;
    border-radius: 0;
  }
  .mode-title { font-size: 30px; }
  .mode-btn { font-size: 18px; padding: 18px; }
  .panel-content { font-size: 22px; }
  .glasses-translation, #target-content { font-size: 24px !important; }
  #controls { gap: 10px; }
  .focusable { padding: 10px 16px; font-size: 16px; }
  .numpad-key { width: 80px; height: 50px; font-size: 24px; }
  #numpad-grid { width: 270px; gap: 8px; }
}

/* Small phones */
@media (max-width: 380px) {
  .mode-title { font-size: 26px; }
  .panel-content { font-size: 20px; }
  .focusable { padding: 8px 12px; font-size: 15px; }
  .numpad-key { width: 70px; height: 45px; font-size: 22px; }
  #numpad-grid { width: 240px; }
}

.hidden { display: none !important; }

/* --- Mode Selector --- */
#mode-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
  padding: 40px;
}

.mode-title {
  font-size: 38px;
  font-weight: 300;
  color: #fff;
  letter-spacing: 2px;
}

.mode-subtitle {
  font-size: 16px;
  color: #81C784;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.mode-btn {
  width: 80%;
  padding: 22px;
  font-size: 20px;
  text-align: center;
  letter-spacing: 0.5px;
}

.mode-hint {
  font-size: 13px;
  color: #4CAF50;
  margin-top: 24px;
  letter-spacing: 1px;
}

/* --- Shared Styles --- */
#status-bar, #glasses-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-size: 16px;
  border-bottom: 1px solid #1B5E20;
}

#direction-label, #glasses-direction {
  font-weight: 600;
  color: #A5D6A7;
  letter-spacing: 1px;
}

#session-code-display, #glasses-session {
  font-family: "Helvetica Neue", monospace;
  font-size: 18px;
  color: #fff;
  font-weight: 700;
  background: #1B5E20;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 2px;
}

.mic-off { color: #555; }
.mic-on { color: #66BB6A; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* --- Translation Panels --- */
#translation-area, #glasses-display {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 16px;
}

.text-panel, .glasses-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 22px;
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
}

#source-text, #glasses-source {
  background: #0d260d;
  border: 1px solid #2E7D32;
}

#target-text, #glasses-target {
  background: #1a3a1a;
  border: 1px solid #43A047;
}

.panel-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #66BB6A;
  margin-bottom: 8px;
  font-weight: 500;
}

.panel-content {
  font-size: 26px;
  font-weight: 400;
  line-height: 1.3;
  word-wrap: break-word;
  color: #E8F5E9;
}

.glasses-translation, #target-content {
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 28px !important;
}

#divider, #glasses-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #4CAF50, transparent);
  margin: 6px 50px;
}

/* --- Controls --- */
#controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 14px 0;
}

.focusable {
  background: #0d260d;
  color: #C8E6C9;
  border: 2px solid #2E7D32;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 17px;
  font-weight: 600;
  font-family: "Helvetica Neue", Helvetica, sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  letter-spacing: 0.5px;
}

.focusable:focus, .focusable.active {
  border-color: #66BB6A;
  background: #1B5E20;
  box-shadow: 0 0 16px rgba(76, 175, 80, 0.4);
  color: #fff;
  transform: scale(1.05);
}

/* --- Language Bar --- */
#lang-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 10px;
  font-size: 16px;
}

.lang-active { color: #A5D6A7; font-weight: 600; }
#lang-arrow { color: #4CAF50; font-size: 20px; }

/* --- Glasses Footer --- */
#glasses-footer { text-align: center; padding: 16px; }
.glasses-hint { font-size: 14px; color: #66BB6A; letter-spacing: 1px; }

/* --- Number Pad --- */
#numpad-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 30px;
}

.numpad-title {
  font-size: 22px;
  color: #A5D6A7;
  font-weight: 400;
  margin-bottom: 24px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#numpad-display {
  display: flex;
  gap: 14px;
  margin-bottom: 32px;
}

.digit-slot {
  width: 52px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 300;
  font-family: "Helvetica Neue", monospace;
  color: #2E7D32;
  border-bottom: 2px solid #2E7D32;
}

.digit-filled {
  color: #fff;
  border-bottom-color: #66BB6A;
}

#numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 320px;
}

.numpad-key {
  width: 100px;
  height: 60px;
  font-size: 28px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: "Helvetica Neue", Helvetica, sans-serif;
}

.numpad-del { color: #FFAB91; }
.numpad-ok { color: #A5D6A7; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2E7D32; border-radius: 2px; }
