* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  min-height: 100vh;
  color: #333;
  direction: rtl;
  overflow-x: hidden;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
}

header {
  text-align: center;
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.95);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  width: 100%;
}

h1 {
  font-size: 3rem;
  color: #1e3c72;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

.date-display {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 20px;
}

.hebrew-date,
.gregorian-date {
  background: linear-gradient(45deg, #ffd700, #ffa500);
  color: #1e3c72;
  padding: 15px 25px;
  border-radius: 15px;
  font-size: 1.2rem;
  font-weight: 600;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  min-width: 200px;
}

.debug-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-input {
  padding: 12px 20px;
  border: 2px solid #ddd;
  border-radius: 25px;
  font-size: 1rem;
  text-align: center;
  direction: ltr;
  width: 200px;
  outline: none;
  transition: border-color 0.3s ease;
}

.date-input:focus {
  border-color: #4caf50;
}

.set-date-btn {
  background: linear-gradient(45deg, #4caf50, #45a049);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.set-date-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.chanukah-display {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  text-align: center;
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 600px;
}

.chanukiah-container {
  margin-bottom: 30px;
}

.chanukiah {
  position: relative;
  width: 500px;
  height: 300px;
  margin: 0 auto;
}

/* בסיס החנוכיה */
.base {
  position: absolute;
  bottom: 20px;
  left: 50px;
  width: 400px;
  height: 25px;
  background: #8b4513;
  border-radius: 12px;
}

.center-stand {
  position: absolute;
  bottom: 45px;
  left: 225px;
  width: 50px;
  height: 45px; /* הקטנתי מ-100px ל-45px */
  background: #8b4513;
  border-radius: 5px;
}

/* נרות - תיקון הכיוון */
.candle {
  position: absolute;
  bottom: 45px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.candle-holder {
  width: 15px;
  height: 15px;
  background: #654321;
  border-radius: 2px;
  order: 3; /* הבסיס למטה */
}

.candle-body {
  width: 7px;
  height: 70px;
  border-radius: 1px;
  order: 2; /* הנר באמצע */
  margin-bottom: -5px;
}

.flame {
  width: 8px;
  height: 12px;
  background: radial-gradient(circle, #ffd700 30%, #ff4500 70%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 1.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(255, 69, 0, 0.8));
  order: 1; /* הלהבה למעלה */
  margin-bottom: -2px;
}

/* מיקומי נרות */
.shamash {
  left: 240px; /* הזזתי שמאלה מ-242px ל-237px */
  bottom: 90px;
}

.shamash .candle-body {
  background: #4169e1;
  height: 80px;
  width: 10px;
}

.shamash .candle-holder {
  width: 20px;
  height: 20px;
  background: #654321;
}

.shamash .flame {
  width: 10px;
  height: 15px;
}

.candle-1 {
  left: 380px;
}
.candle-2 {
  left: 350px;
}
.candle-3 {
  left: 320px;
}
.candle-4 {
  left: 290px;
}
.candle-5 {
  left: 180px;
}
.candle-6 {
  left: 150px;
}
.candle-7 {
  left: 120px;
}
.candle-8 {
  left: 90px;
}

/* צבעי נרות */
.candle-1 .candle-body {
  background: #dc143c;
}
.candle-2 .candle-body {
  background: #32cd32;
}
.candle-3 .candle-body {
  background: #ffd700;
}
.candle-4 .candle-body {
  background: #ff69b4;
}
.candle-5 .candle-body {
  background: #00ced1;
}
.candle-6 .candle-body {
  background: #9370db;
}
.candle-7 .candle-body {
  background: #ff8c00;
}
.candle-8 .candle-body {
  background: #20b2aa;
}

@keyframes flicker {
  0% {
    opacity: 0.8;
    transform: scale(1) rotate(-2deg);
  }
  25% {
    opacity: 1;
    transform: scale(1.1) rotate(1deg);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.05) rotate(-1deg);
  }
  75% {
    opacity: 1;
    transform: scale(1.08) rotate(2deg);
  }
  100% {
    opacity: 0.85;
    transform: scale(1.02) rotate(-1deg);
  }
}

.candle-info {
  background: linear-gradient(45deg, #ffd700, #ffa500);
  padding: 20px;
  border-radius: 15px;
  margin-top: 20px;
}

.candle-info p {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e3c72;
}

.not-chanukah {
  background: rgba(255, 255, 255, 0.95);
  padding: 60px 40px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  text-align: center;
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 600px;
}

.not-chanukah h2 {
  font-size: 2.5rem;
  color: #1e3c72;
  margin-bottom: 20px;
}

.not-chanukah p {
  font-size: 1.2rem;
  color: #666;
}

/* רספונסיביות */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  h1 {
    font-size: 2rem;
  }

  .date-display {
    flex-direction: column;
    align-items: center;
  }

  .hebrew-date,
  .gregorian-date {
    min-width: auto;
    width: 100%;
    max-width: 300px;
  }

  .debug-controls {
    flex-direction: column;
  }

  .date-input {
    width: 100%;
    max-width: 250px;
  }

  .chanukah-display {
    padding: 20px;
  }

  .chanukiah {
    width: 300px;
    height: 200px;
    transform: scale(0.8);
  }

  .candle-info p {
    font-size: 1.2rem;
  }

  .not-chanukah h2 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  header {
    padding: 20px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .hebrew-date,
  .gregorian-date {
    font-size: 1rem;
    padding: 12px 20px;
  }

  .chanukiah {
    transform: scale(0.6);
  }
}
