:root {
  --clock-color: #ffffff;
  --date-color: rgba(255,255,255,0.7);
  --text-color: #ffffff;
  --fav-icon-color: #64b5f6;
  --widget-title-color: rgba(255,255,255,0.7);
  --bg-overlay: rgba(0, 0, 0, 0.4);
  --input-bg: rgba(255, 255, 255, 0.15);
  --input-border: rgba(255, 255, 255, 0.3);
  --accent: #64b5f6;
  --menu-bg: rgba(0, 0, 0, 0.85);
  --card-bg: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Robo, sans-serif;
  background: #1a1a2e no-repeat center center/cover;
  background-size: cover;
  min-height: 100vh;
  color: var(--text-color);
  overflow-x: hidden;
}

.bg-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  display: none;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  z-index: -1;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  position: relative;
}

.greeting {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.clock {
  font-size: 4rem;
  font-weight: 300;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
  color: var(--clock-color);
}

.date {
  font-size: 1.2rem;
  color: var(--date-color);
  margin-bottom: 1rem;
}

.weather {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.weather-icon {
  font-size: 2rem;
}

.weather-temp {
  font-weight: 300;
}

.weather-desc {
  font-size: 1rem;
  color: var(--date-color);
}

.search-container {
  width: 100%;
  max-width: 600px;
  position: relative;
  margin-bottom: 3rem;
}

.search-bar {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 50px;
  color: var(--text-color);
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search-bar:focus {
  background: rgba(255, 255, 255, 0.25);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(100, 181, 246, 0.3);
}

.search-bar::placeholder {
  color: var(--date-color);
}

.search-engine-select {
  position: absolute;
  right: 3.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.3rem;
}

.search-engine-select option[value="duckduckgo"] {
  background: var(--menu-bg);
}
.search-engine-select option[value="google"] {
  background: var(--menu-bg);
}
.search-engine-select option[value="bing"] {
  background: var(--menu-bg);
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--menu-bg);
  border-radius: 12px;
  margin-top: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.suggestions.active {
  display: block;
}

.suggestion-item {
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s;
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.suggestion-item:first-child {
  border-radius: 12px 12px 0 0;
}

.suggestion-item:last-child {
  border-radius: 0 0 12px 12px;
}

.favorites-section {
  width: 100%;
  max-width: 800px;
}

.favorites-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

.favorites-title {
  font-size: 0.9rem;
  color: var(--date-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--date-color);
  cursor: pointer;
  padding: 0.3rem;
  font-size: 1rem;
  transition: color 0.2s;
}

.view-btn.active, .view-btn:hover {
  color: var(--accent);
}

.favorites {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
  gap: 1rem;
}

.favorites.list-view {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.favorite-item {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: block;
  color: var(--text-color);
}

.favorite-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.list-view .favorite-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  text-align: left;
  padding: 0.8rem 1rem;
}

.favorite-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--fav-icon-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  color: #000;
  flex-shrink: 0;
}

.favorite-name {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-view .favorite-name {
  margin-top: 0;
}

.hamburger {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: var(--input-bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 200;
  transition: background 0.2s;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.25);
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s;
}

.menu {
  position: fixed;
  top: 0;
  right: -350px;
  width: 350px;
  max-width: 100vw;
  height: 100vh;
  background: var(--menu-bg);
  backdrop-filter: blur(20px);
  z-index: 300;
  transition: right 0.3s ease;
  padding: 5rem 2rem 2rem;
  overflow-y: auto;
}

.menu.active {
  right: 0;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.menu-section {
  margin-bottom: 2rem;
}

.menu-section h3 {
  font-size: 0.8rem;
  color: var(--date-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: color 0.2s;
  gap: 0.5rem;
}

.menu-item:hover {
  color: var(--accent);
}

.menu-item label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.menu-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.menu-item select {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-color);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
}

.menu-item select option {
  background: #1a1a2e;
}

.menu-item input[type="color"] {
  width: 40px;
  height: 30px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

.menu-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.menu-btn {
  padding: 0.6rem 1.2rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: var(--accent);
}

.add-favorite-form {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin-top: 1rem;
}

.add-favorite-form.active {
  display: flex;
}

.add-favorite-form input {
  padding: 0.6rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.9rem;
  width: 100%;
}

.add-favorite-form input::placeholder {
  color: var(--date-color);
}

.wallpaper-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.wallpaper-source {
  padding: 0.4rem 0.8rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.wallpaper-source:hover, .wallpaper-source.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.add-fav-row {
  display: flex;
  gap: 0.5rem;
}

.add-fav-row button {
  flex: 1;
}

.custom-url-input {
  padding: 0.4rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: #fff;
  width: 150px;
  font-size: 0.85rem;
}

.color-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.color-inputs .menu-item {
  padding: 0.5rem 0;
  border: none;
}

.color-inputs label {
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .clock {
    font-size: 3rem;
  }
  .date {
    font-size: 1rem;
  }
  .menu {
    width: 100vw;
    right: -100vw;
  }
  .widget-row {
    flex-direction: column;
  }
}

.widget-row {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.widget {
  flex: 1;
  min-width: 200px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 16px;
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.widget-header span {
  font-size: 0.85rem;
  color: var(--widget-title-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.widget-btn {
  padding: 0.3rem 0.6rem;
  background: var(--input-bg);
  border: none;
  border-radius: 6px;
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.8rem;
}

.widget-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.notes-textarea {
  width: 100%;
  min-height: 150px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text-color);
  padding: 0.8rem;
  resize: vertical;
  font-family: inherit;
  font-size: 0.9rem;
}

.notes-textarea::placeholder {
  color: var(--date-color);
}

.tasks-list {
  max-height: 180px;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.task-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.task-item.completed .task-text {
  text-decoration: line-through;
  opacity: 0.5;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.task-text {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-color);
}

.task-delete {
  background: none;
  border: none;
  color: var(--date-color);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.task-item:hover .task-delete {
  opacity: 1;
}

.task-delete:hover {
  color: #ff5555;
}

.task-input {
  width: 100%;
  padding: 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.task-input::placeholder {
  color: var(--date-color);
}