:root {
  --primary-color: #58cc02;
  --secondary-color: #ff4b4b;
  --background-color: #f5f5f5;
  --tile-background: #ffffff;
  --text-color: #333333;
  --border-radius: 12px;
  --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Nunito', 'Segoe UI', sans-serif;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  padding: 20px;
}

header {
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto 20px;
  gap: 15px;
}

.app-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title h1 {
  color: var(--primary-color);
}

.settings-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-bar button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 8px 15px;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.settings-bar button:hover {
  background-color: #4aad00;
}

#settings-panel {
  background-color: var(--tile-background);
  border-radius: var(--border-radius);
  padding: 15px;
  box-shadow: var(--shadow);
  margin-bottom: 15px;
}

#settings-panel.hidden {
  display: none;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.search-container {
  display: flex;
  position: relative;
}

#search-input {
  flex-grow: 1;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: border-color var(--transition-speed);
}

#search-input:focus {
  border-color: var(--primary-color);
  outline: none;
}

#search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #999;
}

#search-clear.hidden {
  display: none;
}

main {
  max-width: 1200px;
  margin: 0 auto;
}

.tiles-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.timer-tile {
  background-color: var(--tile-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  width: 300px;
  padding: 20px;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  position: relative;
}

.timer-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.tile-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tile-icon {
  font-size: 24px;
  margin-right: 10px;
}

.tile-title {
  flex-grow: 1;
  font-size: 18px;
  color: var(--primary-color);
}

.tile-category {
  background-color: #e8f5e9;
  color: var(--primary-color);
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  margin-left: auto;
}

.tile-origin {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  color: #aaa;
}

.tile-description {
  margin-bottom: 15px;
  font-size: 14px;
  color: #666;
}

.tile-timer {
  font-size: 28px;
  text-align: center;
  margin: 15px 0;
  font-family: monospace;
}

.timer-edit-container {
  margin: 10px 0;
}

.timer-edit-container.hidden {
  display: none;
}

.timer-edit-input {
  width: 100%;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 18px;
  text-align: center;
  font-family: monospace;
}

.timer-controls {
  display: flex;
  justify-content: space-between;
  margin: 15px 0;
  gap: 10px;
}

.timer-controls button {
  flex-grow: 1;
  padding: 8px 0;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.timer-start {
  background-color: var(--primary-color);
  color: white;
}

.timer-start:hover {
  background-color: #4aad00;
}

.timer-pause, .timer-reset {
  background-color: #f0f0f0;
}

.timer-pause:hover, .timer-reset:hover {
  background-color: #e0e0e0;
}

.timer-pause:disabled, .timer-reset:disabled {
  background-color: #f0f0f0;
  color: #bbb;
  cursor: not-allowed;
}

.tile-edit {
  background-color: #ff9800;
  color: white;
}

.tile-edit:hover {
  background-color: #f57c00;
}

.tile-edit.editing {
  background-color: #2196f3;
}

.tile-edit.editing:hover {
  background-color: #1976d2;
}

.tile-links-container {
  margin-top: 15px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.tile-links-container h4 {
  margin-bottom: 8px;
  font-size: 16px;
  color: #666;
}

.tile-links-list a {
  display: block;
  margin: 5px 0;
  color: #2196f3;
  text-decoration: none;
  transition: color var(--transition-speed);
}

.tile-links-list a:hover {
  color: #0d47a1;
  text-decoration: underline;
}

.tile-links-edit {
  margin-top: 10px;
}

.tile-links-edit.hidden {
  display: none;
}

.link-edit-template {
  display: flex;
  margin-bottom: 10px;
  gap: 5px;
}

.link-edit-template input {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
}

.link-title {
  flex: 1;
}

.link-url {
  flex: 2;
}

.link-remove {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  width: 30px;
  cursor: pointer;
}

.add-link-btn {
  width: 100%;
  padding: 8px;
  background-color: #e0e0e0;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.add-link-btn:hover {
  background-color: #ccc;
}

/* Animation Classes */
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

.shake-animation {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.highlight {
  background-color: #ffeb3b;
  padding: 0 2px;
  border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tiles-container {
    justify-content: center;
  }
  
  .timer-tile {
    width: 100%;
    max-width: 400px;
  }
}

.no-results {
  text-align: center;
  padding: 20px;
  font-size: 18px;
  color: #999;
  width: 100%;
}