@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap");

:root {
  /* Tema escuro (padrão) */
  --bg-gradient-start: #1d498c;
  --bg-gradient-end: #08203f;
  --app-bg: rgba(63, 92, 251, 0.1);
  --accent-color: #f0c025;
  --text-color: #fff;
  --input-bg: rgba(29, 73, 140, 0.2);
  --input-border: rgba(240, 192, 37, 0.3);
}

[data-theme="light"] {
  --bg-gradient-start: #ffffff;
  --bg-gradient-end: #f0f0f0;
  --app-bg: rgba(255, 255, 255, 0.9);
  --accent-color: #1d498c;
  --text-color: #08203f;
  --input-bg: rgba(29, 73, 140, 0.1);
  --input-border: rgba(29, 73, 140, 0.3);
}

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

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(
    135deg,
    var(--bg-gradient-start) 0%,
    var(--bg-gradient-end) 100%
  );
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
}

.container {
  width: 100%;
  max-width: 1200px;
  padding: 2rem;
}

.theme-toggle-wrapper {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 100;
}

.theme-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 64px;
  height: 32px;
  position: relative;
  border-radius: 25px;
  overflow: hidden;
}

.toggle-track {
  background: var(--bg-gradient-end);
  border-radius: 25px;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  position: relative;
  transition: all 0.3s ease;
  border: 2px solid var(--accent-color);
}

.toggle-sun,
.toggle-moon {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.3s ease;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-color);
  transition: transform 0.3s ease;
}

[data-theme="light"] .toggle-thumb {
  transform: translateX(32px);
}

[data-theme="light"] .toggle-sun {
  transform: scale(1.2);
}

[data-theme="dark"] .toggle-moon {
  transform: scale(1.2);
}

.app-content {
  background: var(--app-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 3rem 2rem;
  box-shadow: 0 8px 32px 0 rgba(8, 32, 63, 0.3);
  border: 2px solid var(--input-border);
  display: flex;
  min-height: 600px;
  margin: 0 auto;
  width: 100%;
}

.main-content {
  flex: 1;
  min-width: 300px;
  margin-right: 2rem;
}

.drawn-numbers {
  width: 250px;
  padding-left: 2rem;
  border-left: 2px solid var(--input-border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.numbers-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 400px;
  overflow-y: auto;
  padding-right: 1rem;
}

.numbers-list::-webkit-scrollbar {
  width: 8px;
}

.numbers-list::-webkit-scrollbar-track {
  background: var(--input-bg);
  border-radius: 4px;
}

.numbers-list::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}

.logo-container {
  text-align: center;
  margin-bottom: 3rem;
  width: 100%;
}

.logo {
  width: 100%;
  max-width: 400px;
  height: auto;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.config-panel {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

input[type="number"] {
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 1.2rem;
  width: 150px;
  transition: all 0.3s ease;
}

input[type="number"]:focus {
  outline: none;
  background: var(--input-bg);
  border-color: var(--accent-color);
}

label {
  font-size: 1.1rem;
  font-weight: 600;
}

.action-button {
  padding: 1rem 2rem;
  border: none;
  background: #f0c025;
  color: #08203f;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  height: 51px; /* Mesma altura que os inputs */
}

.action-button:hover {
  transform: translateY(-2px);
  background: #f7cc4a;
  box-shadow: 0 5px 15px rgba(240, 192, 37, 0.4);
}

.action-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  opacity: 0.7;
  box-shadow: none;
}

.action-button:disabled:hover {
  background: #ccc;
  transform: none;
  box-shadow: none;
}

.dice-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.result-container {
  text-align: center;
  margin: 2rem 0;
}

.current-number {
  font-size: 8rem;
  font-weight: 700;
  color: var(--accent-color);
  margin: 1rem 0;
  text-shadow: -1px -1px 0 var(--bg-gradient-end),
    1px -1px 0 var(--bg-gradient-end), -1px 1px 0 var(--bg-gradient-end),
    1px 1px 0 var(--bg-gradient-end), 0 0 20px var(--accent-color);
  -webkit-text-stroke: 2px var(--bg-gradient-end);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: none;
  cursor: default;
}

.drawn-numbers {
  text-align: center;
  margin-top: 0;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.drawn-numbers h2 {
  font-size: 2rem;
  font-weight: 600;
  cursor: default;
  margin: 0;
}

.drawn-number {
  background: var(--input-bg);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 600;
  animation: fadeIn 0.5s ease;
  border: 1px solid var(--input-border);
  color: var(--text-color);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: none;
  width: 100%;
  text-align: center;
}

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

.print-button {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-color);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.print-button:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .drawn-numbers,
  .drawn-numbers * {
    visibility: visible;
  }

  .drawn-numbers {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 2rem;
  }

  .print-button {
    display: none;
  }

  .numbers-list {
    height: auto !important;
    overflow: visible !important;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .current-number {
    font-size: 6rem;
  }

  .app-content {
    padding: 1.5rem;
    flex-direction: column;
  }

  .main-content {
    margin-right: 0;
    margin-bottom: 2rem;
    width: 100%;
  }

  .drawn-numbers {
    width: 100%;
    padding-left: 0;
    border-left: none;
    border-top: 2px solid var(--input-border);
    padding-top: 2rem;
  }

  .logo-container {
    margin-bottom: 1.5rem;
  }

  .logo {
    max-width: 200px;
  }

  .current-number {
    font-size: 5rem;
    margin: 0.5rem 0;
  }

  .config-panel {
    margin-bottom: 2rem;
  }

  .numbers-list {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }

  .app-content {
    padding: 1rem;
    border-radius: 15px;
  }

  .current-number {
    font-size: 4rem;
  }

  .config-panel {
    flex-direction: column;
    gap: 1rem;
  }

  .input-group {
    width: 100%;
  }

  input[type="number"] {
    width: 100%;
  }

  .action-button {
    width: 100%;
    justify-content: center;
  }

  .logo {
    max-width: 180px;
  }

  .numbers-list {
    height: 250px;
  }
}
