/*
 * User-Facing Application Styles
 *
 * This file contains all styles for user-facing pages (dashboard, skills, credits, etc.)
 * For admin-specific styles, see admin_only.css
 */

/* ========================================
   Mobile Touch Optimization
   ======================================== */

* {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.overflow-auto,
.overflow-y-auto,
.overflow-x-auto,
.overflow-scroll {
  touch-action: pan-y pan-x;
}

/* ========================================
   Background & Layout
   ======================================== */

/* Note: Background image is set via inline style in layout due to asset pipeline */
html {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

body {
  font-family: "Noto Sans TC", "PingFang TC", "PingFang SC", "Microsoft JhengHei", "Heiti TC", "Open Sans", sans-serif;
  background: transparent;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding-bottom: env(safe-area-inset-bottom);
}

.page-container {
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

/* ========================================
   Soft UI Components
   ======================================== */

.soft-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.2, 0.82, 0.165, 1);
}

.shadow-soft-xl {
  box-shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.05);
}

/* ========================================
   Navigation Components
   ======================================== */

.nav-glass {
  background: white;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========================================
   Icon Containers
   ======================================== */

.icon-container-sm {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.icon-container {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Gradient Utilities
   ======================================== */

.bg-gradient-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.bg-gradient-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.bg-gradient-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.bg-gradient-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.bg-gradient-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.text-gradient-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   Skill Tree Specific
   ======================================== */

[data-skill-tree-target="canvas"] {
  touch-action: none;
}

.locked-skill {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   Credit System Components
   ======================================== */

.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
}

.credit-transaction {
  transition: all 0.2s ease-in-out;
}

.credit-transaction:hover {
  transform: translateX(4px);
}

/* ========================================
   Tab Components
   ======================================== */

.tab-button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
}

.tab-button.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.tab-button:not(.active) {
  background: transparent;
  color: #6b7280;
}

.tab-button:not(.active):hover {
  background: #f3f4f6;
}

/* ========================================
   Mobile Navigation
   ======================================== */

.mobile-nav-overlay {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: rgba(0, 0, 0, 0.2);
}

.mobile-nav-panel {
  height: 100svh;
  height: 100dvh;
  height: -webkit-fill-available;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ========================================
   Shared Form Input Components
   Used in tasks, milestones, and other user-facing forms.
   Admin forms use admin-form-* (admin_only.css).
   Approval forms use approval-form-* (approval_only.css).
   ======================================== */

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #111827;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #9ca3af;
}

.form-select {
  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-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.25em 1.25em;
  padding-right: 2.5rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* datepicker trigger button styled as a form-input */
.datepicker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #111827;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  text-align: left;
}

.datepicker-trigger:hover {
  border-color: #9ca3af;
}

.datepicker-trigger:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ========================================
   Utility Classes
   ======================================== */

.glass-effect {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hover-lift {
  transition: transform 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
}
