/* Dream Casa - Dark Mode Styles */

:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --bg-input: #1f2b47;
  --accent-primary: #6c5ce7;
  --accent-secondary: #a29bfe;
  --accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #00cec9 100%);
  --text-primary: #ffffff;
  --text-secondary: #b2bec3;
  --text-muted: #636e72;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #d63031;
  --priority-high: #ff7675;
  --priority-medium: #fdcb6e;
  --priority-low: #55efc4;
  --border-color: #2d3748;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 30px rgba(108, 92, 231, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(108, 92, 231, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 206, 201, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(162, 155, 254, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.app-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}

/* Header */
.app-header {
  text-align: center;
  padding: 30px 0;
  margin-bottom: 20px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 10px rgba(162, 155, 254, 0.5));
}

.logo h1 {
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 300;
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Filters Section */
.filters-section {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  white-space: nowrap;
}

select {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

select:hover {
  border-color: var(--accent-secondary);
}

select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* Add Task Section */
.add-task-section {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.add-task-section h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

#task-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row input,
.form-row select {
  flex: 1;
}

input[type="text"],
input[type="date"],
textarea {
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

.btn-add {
  padding: 14px 24px;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-add:active {
  transform: translateY(0);
}

.btn-add span {
  font-size: 1.3rem;
}

/* Tasks Section */
.tasks-section {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tasks-header h2 {
  font-size: 1.2rem;
}

.task-count {
  background: var(--bg-input);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Task List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease;
}

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

.task-item:hover {
  border-color: var(--accent-secondary);
  box-shadow: var(--shadow);
}

.task-item.completed {
  opacity: 0.7;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent-secondary);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.task-checkbox:hover {
  background: rgba(162, 155, 254, 0.2);
}

.task-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
}

.task-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 4px;
  word-break: break-word;
}

.task-description {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 8px;
  word-break: break-word;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-category {
  padding: 4px 10px;
  background: rgba(108, 92, 231, 0.2);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--accent-secondary);
}

.task-priority {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.task-priority.high {
  background: rgba(255, 118, 117, 0.2);
  color: var(--priority-high);
}

.task-priority.medium {
  background: rgba(253, 203, 110, 0.2);
  color: var(--priority-medium);
}

.task-priority.low {
  background: rgba(85, 239, 196, 0.2);
  color: var(--priority-low);
}

.task-due-date {
  padding: 4px 10px;
  background: rgba(99, 110, 114, 0.2);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.task-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.task-actions button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-edit {
  background: rgba(108, 92, 231, 0.2);
  color: var(--accent-secondary);
}

.btn-edit:hover {
  background: var(--accent-primary);
  color: white;
}

.btn-delete {
  background: rgba(214, 48, 49, 0.2);
  color: var(--danger);
}

.btn-delete:hover {
  background: var(--danger);
  color: white;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

.empty-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-card);
  padding: 28px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  border: 1px solid var(--border-color);
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.3rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.btn-cancel,
.btn-save {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-cancel {
  background: var(--bg-input);
  color: var(--text-secondary);
}

.btn-cancel:hover {
  background: var(--border-color);
}

.btn-save {
  background: var(--accent-gradient);
  color: white;
}

.btn-save:hover {
  box-shadow: var(--shadow-hover);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--success);
  color: var(--success);
  font-weight: 500;
  z-index: 1001;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
  .app-container {
    padding: 12px;
  }

  .logo h1 {
    font-size: 1.6rem;
  }

  .filters-section {
    flex-direction: column;
  }

  .filter-group {
    min-width: 100%;
  }

  .form-row {
    flex-direction: column;
  }

  .task-item {
    flex-wrap: wrap;
  }

  .task-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 12px;
  }

  .modal-content {
    padding: 20px;
  }
}
