/* Priority List App Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.show-completed-wrapper {
  display: flex;
  align-items: center;
  color: white;
  width: 200px;
  margin-bottom: 1rem;
}

.show-completed-wrapper input {
  flex: 0;
}

.show-completed-wrapper label {
  margin: 0;
}

#show-completed {
  margin-right: 8px;
}

.header p {
  opacity: 0.9;
  font-size: 1.1rem;
}

.content {
  padding: 30px;
}

.create-section {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 30px;
  border: 2px dashed #dee2e6;
}

.create-section h3 {
  margin-bottom: 20px;
  color: #495057;
}

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

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
}

input,
textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
  margin-left: 10px;
}

.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.list-card {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.list-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.list-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #495057;
}

.list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 20px;
}

.item-list {
  margin: 20px 0;
  min-height: 60px;
  position: relative;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  margin: 8px 0;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #667eea;
  cursor: grab;
  transition: all 0.2s ease;
}

.item:hover {
  background: #e9ecef;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.item.completed .item-title {
  text-decoration: line-through;
  color: #aaa;
}

.item.completed {
  display: none;
}

.show-completed .item.completed {
  display: flex;
}

/* Drag and Drop Styles */
.item.dragging {
  opacity: 0.5;
  background: #e9ecef;
}

.item.drag-over {
  border-top: 3px solid #667eea;
  margin-top: 12px;
}

.item-content {
  flex: 1;
}

.item-title {
  font-weight: 600;
  color: #495057;
}

.add-item-form {
  margin-top: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

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

.message {
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
  font-weight: 600;
}

.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.empty-state h3 {
  margin-bottom: 10px;
}

.item-actions {
  display: flex;
  gap: 5px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.btn-icon:hover {
  background: #e9ecef;
}

/* Loading Indicators */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

.spinner-dark {
  border-color: #667eea;
  border-top-color: transparent;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s ease-in-out infinite;
}

.list-card.loading {
  opacity: 0.7;
  pointer-events: none;
}

.list-card.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  margin-top: -12px;
  border: 3px solid #667eea;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s ease-in-out infinite;
  z-index: 10;
}

.item.loading {
  opacity: 0.6;
  pointer-events: none;
}

.global-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.046);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.global-loading .spinner {
  width: 40px;
  height: 40px;
  border-width: 4px;
  border-color: #fff;
  border-top-color: transparent;
}

.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .lists-grid {
    grid-template-columns: 1fr;
  }

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

  .header h1 {
    font-size: 2rem;
  }
}
