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

:root {
  /* Solarized Light Palette */
  --base03: #002b36;
  --base02: #073642;
  --base01: #586e75;
  --base00: #657b83; /* Main text */
  --base0: #839496;
  --base1: #93a1a1; /* Muted text */
  --base2: #eee8d5; /* Background highlight */
  --base3: #fdf6e3; /* Background */
  --yellow: #b58900;
  --orange: #cb4b16;
  --red: #dc322f;
  --magenta: #d33682;
  --violet: #6c71c4;
  --blue: #268bd2;
  --cyan: #2aa198;
  --green: #859900;

  --primary: var(--blue);
  --primary-hover: var(--cyan);
  --accent: var(--magenta);
}

:root,
:root[data-theme="light"] {
  --bg-color: var(--base3);
  --surface: rgba(253, 246, 227, 0.85);
  --surface-border: rgba(101, 123, 131, 0.15);
  --surface-alt: rgba(238, 232, 213, 0.7);
  --text-main: var(--base00);
  --text-heading: var(--base01);
  --text-muted: var(--base1);
  --bg-gradient: linear-gradient(135deg, var(--base2) 0%, var(--base3) 100%);
  --bg-fallback: var(--base2);
}

:root[data-theme="dark"] {
  --bg-fallback: var(--base02);
  --bg-gradient: linear-gradient(135deg, var(--base02) 0%, var(--base03) 100%);
  --bg-color: var(--base03);
  --surface: rgba(0, 43, 54, 0.85);
  --surface-border: rgba(131, 148, 150, 0.15);
  --surface-alt: rgba(7, 54, 66, 0.7);
  --text-main: var(--base0);
  --text-heading: var(--base1);
  --text-muted: var(--base01);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-fallback: var(--base02);
    --bg-gradient: linear-gradient(
      135deg,
      var(--base02) 0%,
      var(--base03) 100%
    );
    --bg-color: var(--base03);
    --surface: rgba(0, 43, 54, 0.85);
    --surface-border: rgba(131, 148, 150, 0.15);
    --surface-alt: rgba(7, 54, 66, 0.7);
    --text-main: var(--base0);
    --text-heading: var(--base1);
    --text-muted: var(--base01);
  }
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background-color: var(--bg-fallback);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2rem 1rem;
}

#root {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  padding: 3rem;
  max-width: 800px;
  width: 100%;
  margin: auto;
  box-shadow: 0 10px 30px -10px rgba(0, 43, 54, 0.1);
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
}

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

header {
  text-align: center;
  margin-bottom: 3rem;
}

.logo img {
  height: 64px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 6px rgba(0, 43, 54, 0.05));
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

h1 a {
  color: var(--text-heading);
  text-decoration: none;
}

header span em {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-style: normal;
  font-weight: 300;
}

main {
  line-height: 1.7;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-heading);
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.features-list {
  background: var(--surface-alt);
  border-left: 4px solid var(--primary);
  padding: 1.5rem;
  border-radius: 0 12px 12px 0;
  margin: 0 0 2rem 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.features-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.5;
  color: var(--text-main);
  margin: 0;
}

.features-list .emoji {
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

button {
  background: var(--primary);
  color: var(--base3);
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
  box-shadow: 0 4px 14px 0 rgba(38, 139, 210, 0.3);
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42, 161, 152, 0.3);
}

button a {
  color: var(--base3);
  text-decoration: none;
}
button a:hover {
  color: var(--base3);
}

footer {
  margin-top: 4rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

hr {
  border: 0;
  height: 1px;
  background: var(--surface-border);
  margin-bottom: 2rem;
}

/* Forms */
input[type="date"],
input[type="text"] {
  background: var(--bg-color);
  border: 1px solid var(--surface-border);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0, 43, 54, 0.02);
  box-sizing: border-box;
}

input[type="date"]:focus,
input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(38, 139, 210, 0.2);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.grid label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
}

.calendar-selection-controls {
  margin-bottom: 1rem;
}

#calendar-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1.5rem;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 43, 54, 0.02);
}

#calendar-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-color);
  border: none;
  border-bottom: 1px solid var(--surface-border);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
  box-sizing: border-box;
}

#calendar-list label:last-child {
  border-bottom: none;
}

#calendar-list label:hover {
  background: var(--bg-fallback);
}

#calendar-list input[type="checkbox"] {
  accent-color: var(--primary);
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
}

#calendar-list span {
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  text-shadow: none;
  color: #fff !important; /* Force white text on calendar color chips to keep them legible */
}

/* Columns */
.columns-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  #root {
    padding: 1.5rem;
  }
  .columns-container {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .features-list {
    padding: 1rem;
  }
}

.column-group {
  display: flex;
  flex-direction: column;
}

.column-list {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.column-item {
  background: var(--bg-color);
  border: 1px solid var(--surface-border);
  padding: 0.2rem 0.75rem;
  border-radius: 8px;
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
  font-size: 0.95rem;
  box-shadow: 0 1px 3px rgba(0, 43, 54, 0.02);
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.column-item:hover {
  border-color: var(--primary);
}

.column-item:active {
  cursor: grabbing;
}

#deselected-columns .column-item {
  background: transparent;
  border: 1px dashed var(--base1);
  color: var(--base1);
  text-decoration: line-through;
  opacity: 0.7;
  box-shadow: none;
}

#deselected-columns .column-item:hover {
  background: var(--bg-fallback);
  opacity: 0.9;
}

button:disabled,
button.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  background: var(--text-muted);
}
button:disabled:hover {
  transform: none;
  background: var(--text-muted);
}

.info {
  color: var(--green);
}
.warn {
  color: var(--orange);
}

/* Theme Switcher */
.theme-switch {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 0.25rem;
  background: var(--surface-alt);
  padding: 0.25rem;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
}

.theme-btn {
  background: transparent;
  border: none;
  padding: 0.4rem 0.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: none;
  color: var(--text-muted);
  opacity: 0.5;
  transition: all 0.2s ease;
  line-height: 1;
  width: auto;
  height: auto;
}

.theme-btn:hover {
  background: rgba(100, 100, 100, 0.1);
  transform: none;
  box-shadow: none;
  opacity: 0.8;
}

.theme-btn.active {
  background: var(--bg-color);
  opacity: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--surface-border);
}

@media (max-width: 600px) {
  .theme-switch {
    top: 1rem;
    right: 1rem;
    padding: 0.15rem;
  }
  .theme-btn {
    font-size: 1rem;
    padding: 0.3rem 0.4rem;
  }
}
