/* ==========================================================================
   CONFIGURAÇÕES GERAIS
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0c0e15;
  color: #e2e8f0;
  height: 100vh;
  width: 100vw;
  overflow: hidden; /* Impede qualquer rolagem na página toda */
}

.app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #0c0e15 0%, #1a1f2e 100%);
  position: relative;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
header {
  padding: 15px 20px;
  text-align: left;
  z-index: 100;
}

header h1 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffcc00, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   ESTRUTURA DE TELAS (SCREENS)
   ========================================================================== */
.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 80px; /* Espaço para o menu inferior não cobrir o conteúdo */
}

.screen.active {
  display: flex;
}

/* Conteúdo interno das telas com distribuição inteligente */
.screen-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly; /* Distribui os elementos verticalmente sem apertar */
  align-items: center;
  padding: 10px 24px;
  text-align: center;
}

/* ==========================================================================
   HOME: LÂMPADA E RELÓGIO
   ========================================================================== */

.lamp-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lamp {
  font-size: 80px;
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(255, 204, 0, 0.5));
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lamp.off {
  opacity: 0.3;
  filter: none;
}

.lamp-glow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: conic-gradient(from 0deg, #ffcc00, #ff9900, #ffcc00, transparent);
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.6;
  transition: all 0.4s ease;
  animation: pulse 2s infinite;
}
/* O sinal de '~' diz: 'Procure o glow que vem depois de uma lamp com a classe off' */
.lamp.off ~ .lamp-glow {
  animation: none !important; /* Força a parada da animação */
  opacity: 0.1 !important;    /* Garante que o brilho fique bem baixinho */
  transform: translate(-50%, -50%) scale(0.7); /* Mantém ele parado e menor */
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.clock {
  font-size: clamp(48px, 8vh, 64px);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -2px;
}

.modo-container {
  font-size: 16px;
  margin-top: -10px;
}

.modo {
  font-weight: 600;
  color: #ffcc00;
}

/* ==========================================================================
   CONTROLES (BOTÃO ON/OFF E SLIDER)
   ========================================================================== */
.quick-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Botão Power Estilizado apenas com brilho no texto quando ON */
.control-btn {
  background: none;
  border: none;
  font-size: 28px;
  font-weight: 800;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-btn.on {
  color: #22c55e;
  text-shadow: 0 0 15px rgba(34, 197, 94, 0.8);
}

.control-btn.off {
  color: #ef4444;
  opacity: 0.6;
}

.brightness-slider {
  width: 80%;
  max-width: 250px;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffcc00;
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
  cursor: pointer;
}

/* Botoes de Modo Mini */
.modes-mini {
  display: flex;
  gap: 15px;
}

.mode-btn {
  width: 55px;
  height: 55px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-size: 20px;
  cursor: pointer;
  transition: 0.3s;
}

.mode-btn.active {
  border-color: #ffcc00;
  background: rgba(255, 204, 0, 0.1);
}

/* ==========================================================================
   MENU INFERIOR (BOTTOM NAV) - O QUE VOCÊ PEDIU
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-around;
  padding: 10px 10px 25px 10px; /* Padding extra embaixo para safe areas */
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 1000;
}

.nav-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.nav-btn span:first-child {
  font-size: 22px;
}

.nav-btn span:last-child {
  font-size: 11px;
  font-weight: 500;
}

/* ESTADO ATIVO: Sem quadrado, apenas brilho atrás */
.nav-btn.active {
  color: #ffcc00;
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 45px;
  height: 45px;
  background: radial-gradient(circle, rgba(255, 204, 0, 0.25) 0%, transparent 70%);
  z-index: -1;
  filter: blur(4px);
}

/* ==========================================================================
   TELAS ADICIONAIS (MODOS, ALARME, ETC)
   ========================================================================== */
.cards {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px;
  text-align: left;
}

.card.active {
  border-color: #ffcc00;
}

h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

/* ALARME */
.sunrise-container {
  position: relative;
  height: 120px;
}

.sunrise {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at 30% 30%, #ff6b35, #f7931e, #ffcc00);
  border-radius: 50%;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 40px rgba(255, 107, 53, 0.6);
  animation: sunrise 3s ease-in-out infinite alternate;
}

@keyframes sunrise {
  0% { transform: translateX(-50%) translateY(20px) scale(0.8); }
  100% { transform: translateX(-50%) translateY(-10px) scale(1); }
}

.alarm-status {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.time-picker {
  width: 100%;
}

.time-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(22, 27, 34, 0.8);
  padding: 16px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

input[type="number"] {
  width: 72px;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.4);
  color: #e2e8f0;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

input[type="number"]:focus {
  outline: none;
  border-color: #ffcc00;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.1);
}

.repeat-options {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.repeat-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #94a3b8;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #ffcc00;
}

/* BOTÕES */
.btn {
  padding: 16px 32px;
  border: none;
  border-radius: 20px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 240px;
}

.btn.primary {
  background: linear-gradient(135deg, #ffcc00, #ff9900);
  color: #1e1b18;
  box-shadow: 0 10px 25px rgba(255, 204, 0, 0.3);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(255, 204, 0, 0.4);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}