/* ==================== GLOBAL STYLES ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html, body {
  background: #090d16;
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #f8fafc;
}

/* ==================== TI-84 CALCULATOR STYLES ==================== */
.calculator-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
}

.calculator-body {
  width: 380px;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
  border-radius: 28px;
  padding: 22px 20px 26px;
  border: 2px solid #334155;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.85),
    inset 0 2px 4px rgba(255, 255, 255, 0.12),
    inset 0 -4px 8px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 14px;
  user-select: none;
}

.ti-brand-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.brand-name {
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.8px;
}

.brand-model {
  color: #38bdf8;
  font-size: 0.9rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.5px;
}

.lcd-bezel {
  background: #020617;
  border-radius: 12px;
  padding: 10px;
  border: 2px solid #1e293b;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.9);
}

.lcd-screen {
  background: #9ebb9e;
  border-radius: 6px;
  padding: 8px 12px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
}

.lcd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: monospace;
  font-size: 0.62rem;
  color: #142e14;
  border-bottom: 1px solid rgba(20, 46, 20, 0.25);
  padding-bottom: 4px;
  font-weight: 700;
}

.lcd-indicators {
  display: flex;
  gap: 6px;
  align-items: center;
}

.indicator {
  padding: 1px 4px;
  border-radius: 2px;
  background: transparent;
  color: transparent;
  font-size: 0.55rem;
  font-weight: 900;
}

.indicator.active-2nd {
  background: #1e3a8a;
  color: #ffffff;
}

.indicator.active-alpha {
  background: #14532d;
  color: #ffffff;
}

.lcd-history {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  color: #1a381a;
  opacity: 0.75;
}

.lcd-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.prompt-symbol {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.2rem;
  color: #0f240f;
  font-weight: bold;
}

.calc-display {
  width: 100%;
  height: 38px;
  background: transparent;
  border: none;
  color: #051405;
  font-size: 1.35rem;
  text-align: right;
  outline: none;
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  letter-spacing: 1px;
}

/* Keypad Styling */
.key-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.key-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.ti-btn {
  height: 36px;
  background: #334155;
  border: 1px solid #475569;
  color: #f8fafc;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #0f172a;
  transition: transform 0.05s ease, box-shadow 0.05s ease, background 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ti-btn:hover {
  filter: brightness(1.15);
}

.ti-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #0f172a;
}

.func-btn {
  height: 28px;
  background: #1e293b;
  border-color: #334155;
  font-size: 0.7rem;
  color: #cbd5e1;
}

.btn-2nd {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 3px 0 #1d4ed8 !important;
}

.btn-alpha {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #22c55e !important;
  box-shadow: 0 3px 0 #15803d !important;
}

.op-btn {
  background: #475569;
  color: #93c5fd;
}

.math-op {
  color: #38bdf8;
  font-size: 1rem;
}

.num-btn {
  background: #334155;
  color: #ffffff;
}

.enter-btn {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 3px 0 #0369a1 !important;
}

.clear-btn {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #f87171 !important;
  box-shadow: 0 3px 0 #991b1b !important;
}

/* ==================== MULTI-TAB FIREFOX BROWSER UI (FULLSCREEN EDGE-TO-EDGE) ==================== */
.browser-container {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: #1c1b22;
  border-radius: 0;
  border: none;
  overflow: hidden;
  display: none;
  flex-direction: column;
  box-shadow: none;
}

.tabs-strip {
  background: #0c0c0d;
  height: 40px;
  display: flex;
  align-items: flex-end;
  padding: 0 10px;
  gap: 4px;
  border-bottom: 1px solid #2b2a33;
}

.tabs-list {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-list::-webkit-scrollbar { display: none; }

.tab {
  height: 32px;
  background: #141417;
  color: #8f8f9d;
  border-radius: 8px 8px 0 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  max-width: 200px;
  min-width: 130px;
  cursor: pointer;
  border: 1px solid #2b2a33;
  border-bottom: none;
  user-select: none;
  transition: background 0.1s ease;
}

.tab:hover { background: #1c1b22; color: #cfcfd8; }

.tab.active-tab {
  background: #1c1b22;
  color: #fbfbfe;
  border-color: #42414d;
  font-weight: 500;
}

.tab-favicon { font-size: 0.85rem; }

.tab-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-close-btn {
  background: transparent;
  border: none;
  color: #8f8f9d;
  font-size: 0.9rem;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tab-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.new-tab-btn {
  background: transparent;
  border: none;
  color: #cfcfd8;
  font-size: 1.2rem;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.new-tab-btn:hover { background: rgba(255, 255, 255, 0.1); }

.window-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.win-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.win-btn.close { background: #ff5f56; }
.win-btn.minimize { background: #ffbd2e; }
.win-btn.expand { background: #27c93f; }

.browser-header {
  background: #2b2a33;
  padding: 6px 12px;
  border-bottom: 1px solid #1c1b22;
}

.nav-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: #fbfbfe;
  height: 32px;
  width: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.nav-btn:hover { background: rgba(255, 255, 255, 0.12); }

.address-bar-wrapper {
  flex: 1;
  background: #1c1b22;
  border: 1px solid #52525e;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  height: 34px;
  transition: border-color 0.15s ease;
}

.address-bar-wrapper:focus-within {
  border-color: #00ddff;
  box-shadow: 0 0 0 2px rgba(0, 221, 255, 0.2);
}

.security-shield { font-size: 0.85rem; cursor: pointer; }
.ssl-icon { font-size: 0.75rem; opacity: 0.7; }

.address-input {
  flex: 1;
  background: transparent;
  border: none;
  height: 100%;
  color: #fbfbfe;
  font-size: 0.88rem;
  outline: none;
}

.action-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.82rem;
  transition: opacity 0.15s ease;
}

.go-btn { background: #00ddff; color: #0c0c0d; }
.go-btn:hover { opacity: 0.9; }

.report-btn { background: #ff3b30; color: #ffffff; }
.report-btn:hover { background: #d70015; }

.lock-trigger {
  width: auto;
  padding: 0 10px;
  background: rgba(255, 189, 46, 0.15);
  border: 1px solid rgba(255, 189, 46, 0.4);
  color: #ffbd2e;
  font-weight: 600;
  font-size: 0.8rem;
}

.lock-trigger:hover { background: rgba(255, 189, 46, 0.3); }

.menu-hamburger {
  background: transparent;
  border: none;
  color: #fbfbfe;
  font-size: 1.2rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.menu-hamburger:hover { background: rgba(255, 255, 255, 0.12); }

.viewport-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
  background: #ffffff;
  position: relative;
  margin: 0;
  padding: 0;
}

.tab-frame {
  width: 100%;
  height: 100%;
  border: none;
  margin: 0;
  padding: 0;
  background: #ffffff;
  display: none;
}

.tab-frame.active-frame {
  display: block;
}

/* ==================== MODAL STYLES ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-box {
  background: #2b2a33;
  border: 1px solid #52525e;
  border-radius: 12px;
  width: 460px;
  max-width: 90vw;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #fbfbfe;
  animation: modalPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon { font-size: 1.5rem; }

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fbfbfe;
}

.modal-body-text {
  font-size: 0.9rem;
  color: #cfcfd8;
  line-height: 1.4;
}

.modal-callout {
  background: rgba(0, 221, 255, 0.1);
  border: 1px solid rgba(0, 221, 255, 0.3);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: #80ebff;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.modal-btn {
  height: 38px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.modal-btn:hover { filter: brightness(1.15); }

.btn-primary { background: #00ddff; color: #0c0c0d; }
.btn-secondary { background: #42414d; color: #fbfbfe; }

.btn-form {
  background: rgba(255, 189, 46, 0.15);
  border: 1px solid rgba(255, 189, 46, 0.4);
  color: #ffbd2e;
}

.hidden { display: none !important; }
