/* Pendilium Tasks - Modern UI v2.0 */
:root {
  --pct-primary: #6366f1;
  --pct-primary-hover: #4f46e5;
  --pct-primary-light: #eef2ff;
  --pct-success: #10b981;
  --pct-success-hover: #059669;
  --pct-success-light: #d1fae5;
  --pct-warning: #f59e0b;
  --pct-warning-light: #fef3c7;
  --pct-danger: #ef4444;
  --pct-danger-light: #fee2e2;
  --pct-neutral: #6b7280;
  --pct-neutral-light: #f3f4f6;
  --pct-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --pct-card-bg: rgba(255, 255, 255, 0.95);
  --pct-text: #1f2937;
  --pct-text-muted: #6b7280;
  --pct-border: #e5e7eb;
  --pct-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  --pct-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.15);
  --pct-radius: 16px;
  --pct-radius-sm: 10px;
  --pct-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

.pct-wrap {
  width: 100%;
  min-height: 100vh;
  background: transparent;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 2rem 1rem;
  color: var(--pct-text);
}

/* Header */
.pct-header {
  text-align: center;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.pct-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.pct-logo-icon {
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pct-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.pct-header h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  color: white;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.02em;
}

.pct-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  margin: 0.5rem 0 0;
  font-weight: 500;
}

/* Cards */
.pct-card {
  background: var(--pct-card-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--pct-radius);
  padding: 1.5rem;
  box-shadow: var(--pct-shadow);
  max-width: 900px;
  margin: 0 auto 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--pct-transition);
}

.pct-card:hover {
  box-shadow: var(--pct-shadow-hover);
}

.pct-card-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--pct-border);
}

@media (min-width: 768px) {
  .pct-card-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.pct-card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pct-card-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--pct-text);
}

.pct-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--pct-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pct-icon-add { background: var(--pct-primary-light); color: var(--pct-primary); }
.pct-icon-active { background: #dbeafe; color: #2563eb; }
.pct-icon-archived { background: var(--pct-success-light); color: var(--pct-success); }

/* Badges */
.pct-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
}

.pct-badge-primary { background: var(--pct-primary-light); color: var(--pct-primary); }
.pct-badge-success { background: var(--pct-success-light); color: var(--pct-success); }
.pct-badge-secondary { background: var(--pct-neutral-light); color: var(--pct-neutral); font-weight: 500; }

/* View Switcher */
.pct-view-switcher {
  display: flex;
  background: var(--pct-neutral-light);
  border-radius: var(--pct-radius-sm);
  padding: 4px;
  gap: 4px;
  flex-wrap: wrap;
}

.pct-view-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  color: var(--pct-text-muted);
  transition: var(--pct-transition);
}

.pct-view-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--pct-text);
}

.pct-view-btn-active {
  background: white !important;
  color: var(--pct-primary) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pct-view-btn svg { flex-shrink: 0; }

/* Form */
.pct-form {
  display: grid;
  gap: 1.25rem;
}

.pct-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pct-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pct-text);
}

.pct-label svg { color: var(--pct-text-muted); }

.pct-optional {
  font-weight: 400;
  color: var(--pct-text-muted);
  font-size: 0.8rem;
}

.pct-required { color: var(--pct-danger); }

.pct-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .pct-grid { grid-template-columns: 1fr 1fr; }
}

.pct-input {
  width: 100%;
  min-width: 0;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  border: 2px solid var(--pct-border);
  border-radius: var(--pct-radius-sm);
  background: white;
  color: var(--pct-text);
  transition: var(--pct-transition);
  box-sizing: border-box;
}

.pct-input:focus {
  outline: none;
  border-color: var(--pct-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.pct-input::placeholder { color: #9ca3af; }

.pct-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

/* Buttons */
.pct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--pct-radius-sm);
  cursor: pointer;
  transition: var(--pct-transition);
}

.pct-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pct-btn-primary {
  background: var(--pct-primary);
  color: white;
}

.pct-btn-primary:hover:not(:disabled) {
  background: var(--pct-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.pct-btn-success {
  background: var(--pct-success);
  color: white;
}

.pct-btn-success:hover:not(:disabled) {
  background: var(--pct-success-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

.pct-btn-ghost {
  background: white;
  border: 2px solid var(--pct-border);
  color: var(--pct-text);
}

.pct-btn-ghost:hover:not(:disabled) {
  background: var(--pct-neutral-light);
  border-color: #d1d5db;
}

.pct-btn-submit {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
}

@media (min-width: 640px) {
  .pct-btn-submit { width: auto; }
}

.pct-btn-complete {
  background: var(--pct-success);
  color: white;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.pct-btn-complete:hover {
  background: var(--pct-success-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Task List */
.pct-task-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pct-task-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--pct-border);
  border-radius: var(--pct-radius-sm);
  transition: var(--pct-transition);
}

.pct-task-row:hover {
  border-color: var(--pct-primary);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.12);
  transform: translateY(-2px);
}

@media (min-width: 768px) {
  .pct-task-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

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

.pct-task-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--pct-text);
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: 0.5rem;
}

.pct-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Chips */
.pct-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  white-space: nowrap;
}

.pct-chip svg { flex-shrink: 0; }

.pct-chip-info { background: #dbeafe; color: #1d4ed8; }
.pct-chip-warning { background: var(--pct-warning-light); color: #b45309; }
.pct-chip-danger { background: var(--pct-danger-light); color: #b91c1c; }
.pct-chip-neutral { background: var(--pct-neutral-light); color: var(--pct-neutral); }
.pct-chip-subtle { background: transparent; color: var(--pct-text-muted); font-weight: 500; }

/* Archived Grid */
.pct-archived-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .pct-archived-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .pct-archived-grid { grid-template-columns: repeat(3, 1fr); }
}

.pct-archived-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  border-radius: var(--pct-radius-sm);
  padding: 1rem;
  transition: var(--pct-transition);
}

.pct-archived-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

.pct-archived-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--pct-text);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.pct-archived-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.pct-archived-by,
.pct-archived-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--pct-success);
  font-weight: 500;
}

/* Empty State */
.pct-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--pct-text-muted);
}

.pct-empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.pct-empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--pct-text);
}

.pct-empty-state p {
  margin: 0;
  font-size: 0.9rem;
}

/* Modal */
.pct-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pct-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.pct-modal-content {
  position: relative;
  background: white;
  padding: 2rem;
  border-radius: var(--pct-radius);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 400px;
  animation: modalIn 0.3s ease;
}

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

.pct-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pct-modal-icon {
  width: 48px;
  height: 48px;
  background: var(--pct-success-light);
  color: var(--pct-success);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pct-modal-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--pct-text);
}

.pct-modal-content p {
  color: var(--pct-text-muted);
  margin: 0 0 1rem;
}

.pct-modal-content .pct-input {
  margin-bottom: 1.25rem;
}

.pct-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Error */
.pct-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--pct-danger-light);
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--pct-radius-sm);
  padding: 1rem;
  margin-top: 1rem;
  font-weight: 500;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Loading */
.pct-loading {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--pct-radius);
  color: var(--pct-primary);
  font-weight: 600;
}

.pct-spin {
  height: 40px;
  width: 40px;
  animation: spin 1s linear infinite;
}

.pct-c1 {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-dasharray: 60;
  stroke-dashoffset: 20;
}

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

/* Footer */
.pct-footer {
  text-align: center;
  padding: 2rem 1rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.pct-footer p { margin: 0; }

/* Hidden */
.pct-hidden { display: none !important; }

/* Scrollbar */
.pct-wrap::-webkit-scrollbar { width: 8px; }
.pct-wrap::-webkit-scrollbar-track { background: transparent; }
.pct-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }

/* Focus visible */
.pct-btn:focus-visible,
.pct-input:focus-visible,
.pct-view-btn:focus-visible {
  outline: 2px solid var(--pct-primary);
  outline-offset: 2px;
}

/* Priority Styles */
.pct-priority-low { border-left: 4px solid #10b981 !important; }
.pct-priority-medium { border-left: 4px solid #f59e0b !important; }
.pct-priority-high { border-left: 4px solid #ef4444 !important; }

.pct-priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.pct-priority-badge.pct-priority-low {
  background: #d1fae5;
  color: #059669;
  border-left: none !important;
}

.pct-priority-badge.pct-priority-medium {
  background: #fef3c7;
  color: #d97706;
  border-left: none !important;
}

.pct-priority-badge.pct-priority-high {
  background: #fee2e2;
  color: #dc2626;
  border-left: none !important;
}

/* Priority Selector - Interactive buttons */
.pct-priority-selector {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pct-priority-btn {
  width: 32px;
  height: 32px;
  border: 2px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--pct-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
}

.pct-priority-btn:hover {
  transform: scale(1.15);
  opacity: 0.85;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pct-priority-btn.active {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.pct-priority-btn[data-priority="low"].active {
  background: #d1fae5;
  border-color: #10b981;
}

.pct-priority-btn[data-priority="medium"].active {
  background: #fef3c7;
  border-color: #f59e0b;
}

.pct-priority-btn[data-priority="high"].active {
  background: #fee2e2;
  border-color: #ef4444;
}

.pct-task-header {
  margin-bottom: 0.5rem;
}

/* Select styling */
.pct-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* Grid 3 columns */
.pct-grid-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.pct-grid-3 > * {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 768px) {
  .pct-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile specific fixes */
@media (max-width: 480px) {
  .pct-card {
    padding: 1rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    border-radius: var(--pct-radius-sm);
  }
  
  .pct-wrap {
    padding: 1rem 0.5rem;
  }
  
  .pct-input {
    padding: 0.75rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .pct-grid-3 {
    gap: 0.75rem;
  }
}
