:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --secondary-color: #8b5cf6;
  --background-start: #0f172a;
  --background-end: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --card-bg: rgba(30, 41, 59, 0.7);
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.25);
  --glow-color: rgba(99, 102, 241, 0.5);
  --input-bg: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-color: #7c3aed;
  --background-start: #f1f5f9;
  --background-end: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --card-bg: rgba(255, 255, 255, 0.85);
  --border-color: rgba(255, 255, 255, 0.5);
  --shadow-color: rgba(148, 163, 184, 0.4);
  --glow-color: rgba(99, 102, 241, 0.3);
  --input-bg: rgba(255, 255, 255, 0.7);
}

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

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--background-start), var(--background-end));
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  transition: background 0.5s ease, color 0.5s ease;
}

/* Background Texture */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
  z-index: -1;
  pointer-events: none;
}

/* Controls Container */
#controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

/* Common Toggle Button Styles */
#theme-toggle,
#lang-toggle {
  position: static; /* Reset absolute positioning */
  width: 45px;
  height: 45px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  padding: 0; /* Remove default padding for easier centering */
  box-shadow: 0 4px 6px -1px var(--shadow-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.3s;
  font-weight: 700;
  font-size: 0.8rem;
  margin: 0;
}

#theme-toggle:hover,
#lang-toggle:hover {
  transform: scale(1.1);
  background: var(--input-bg);
}

#theme-toggle svg {
  width: 24px;
  height: 24px;
  transition: transform 0.5s ease;
}

/* Remove old absolute positioning from theme toggle if present */
/* (This block overrides the previous specific #theme-toggle selector) */


.container {
  width: 100%;
  max-width: 450px;
  padding: 20px;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 
    0 20px 25px -5px var(--shadow-color),
    0 8px 10px -6px var(--shadow-color);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.5s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 25px 50px -12px var(--shadow-color),
    0 0 20px var(--glow-color);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

header p {
  color: var(--text-muted);
  margin-bottom: 30px;
}

.input-group {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.field {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-left: 4px;
}

select, input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.3s, color 0.3s;
  appearance: none; /* Remove default arrow for consistent styling */
}

/* Custom select arrow */
.field:first-child {
  position: relative;
}
.field:first-child::after {
  content: '▼';
  font-size: 0.8rem;
  color: var(--text-muted);
  position: absolute;
  right: 16px;
  top: 42px;
  pointer-events: none;
}

select:focus, input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

button:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

button:active {
  transform: translateY(0);
}

.result-container {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  animation: fadeIn 0.5s ease-out;
}

.hidden {
  display: none;
}

.icon-wrapper {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 30px var(--glow-color);
  font-size: 4rem; /* Large emoji size */
  line-height: 1;
  text-shadow: 0 0 10px var(--glow-color);
  transition: box-shadow 0.3s ease;
}

[data-theme="light"] .icon-wrapper {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0,0,0,0.1);
}

#zodiac-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text-main);
}

#zodiac-date {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Description Toggle Button */
.desc-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 15px;
  padding: 8px;
  width: auto;
  box-shadow: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: color 0.3s, transform 0.3s;
}

.desc-toggle-btn:hover {
  color: var(--primary-color);
  background: transparent;
  transform: translateY(2px);
  box-shadow: none;
}

.desc-toggle-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.desc-toggle-btn.expanded svg {
  transform: rotate(180deg);
}

.desc-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
  opacity: 0;
  margin-top: 5px;
}

.desc-container.expanded {
  max-height: 200px; /* Arbitrary large height */
  opacity: 1;
}

#zodiac-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.1);
  padding: 15px;
  border-radius: 12px;
  text-align: left;
  margin-top: 10px;
}

[data-theme="light"] #zodiac-desc {
  background: rgba(255, 255, 255, 0.4);
}

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

@media (max-width: 480px) {
  .card {
    padding: 30px 20px;
  }
  
  header h1 {
    font-size: 2rem;
  }
}