:root {
  --primary: #4e54c8;
  --secondary: #8f94fb;
  --bg-color: #f8f9fa;
  --app-bg: rgba(255, 255, 255, 0.9);
  --section-bg: #fdfdfd;
  --text-main: #2c3e50;
  --text-secondary: #6c757d;
  --border-color: #eee;
  --history-item-bg: #fff;
  --ball-1: #fbc400;
  --ball-2: #69c8f2;
  --ball-3: #ff7272;
  --ball-4: #aaa;
  --ball-5: #b0d840;
  --gradient: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
}

[data-theme="dark"] {
  --primary: #8f94fb;
  --secondary: #4e54c8;
  --bg-color: #1a1a2e;
  --app-bg: rgba(22, 22, 40, 0.95);
  --section-bg: #16213e;
  --text-main: #e9ecef;
  --text-secondary: #adb5bd;
  --border-color: #2a2a40;
  --history-item-bg: #0f3460;
  --gradient: linear-gradient(-45deg, #2c3e50, #000000, #4b6cb7, #182848);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gradient);
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-main);
  transition: background 0.5s ease;
  padding: 2rem 0;
}

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.app-container {
  background: var(--app-bg);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 2rem;
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
  width: 95%;
  max-width: 800px;
  text-align: center;
  transition: background 0.3s ease;
}

/* Navigation Styles */
.main-nav {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.main-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.main-nav a:hover {
  color: var(--primary);
}

header {
  margin-bottom: 2rem;
  position: relative;
}

.header-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.theme-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s;
}

header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

header h1 i {
  color: #27ae60;
}

header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.display-section {
  background: var(--section-bg);
  padding: 2.5rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Info Section Styles */
.info-section {
  text-align: left;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(var(--primary), 0.05);
  border-radius: 1.5rem;
}

.info-section h3 {
  margin-bottom: 1.5rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.info-card {
  background: var(--history-item-bg);
  padding: 1.2rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
}

.info-card h4 {
  color: var(--text-main);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.info-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.history-section {
  text-align: left;
  border-top: 2px dashed var(--border-color);
  padding-top: 1.5rem;
  margin-bottom: 2rem;
}

.history-section h3 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-section {
  text-align: left;
  border-top: 2px dashed var(--border-color);
  padding-top: 1.5rem;
  margin-bottom: 2rem;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
}

.contact-section h3 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-section {
  text-align: left;
  border-top: 2px dashed var(--border-color);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.comments-section h3 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border-color);
  background: var(--history-item-bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.3s;
}

.submit-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

footer {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-links {
  margin-top: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 0.3rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Custom Scrollbar */
#history-list::-webkit-scrollbar {
  width: 4px;
}
#history-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

/* Ball Styles preserved */
.numbers-wrapper {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  min-height: 70px;
  align-items: center;
  margin-bottom: 2rem;
}

.ball {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-size: 1.3rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  box-shadow: inset -4px -4px 10px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ball.show {
  opacity: 1;
  transform: translateY(0);
}

.ball-1 { background-color: var(--ball-1); }
.ball-2 { background-color: var(--ball-2); }
.ball-3 { background-color: var(--ball-3); }
.ball-4 { background-color: var(--ball-4); }
.ball-5 { background-color: var(--ball-5); }

.main-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1.2rem 3rem;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 3rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#history-list {
  list-style: none;
  max-height: 150px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--history-item-bg);
  border-radius: 0.8rem;
  margin-bottom: 0.5rem;
  border-left: 4px solid var(--primary);
  font-size: 0.9rem;
  animation: slideIn 0.3s ease-out;
}
