/* === Professional GoodNotes / Etsy Style === */
/* PlannerTools.Online - Main Stylesheet */

:root {
  /* Light Theme */
  --primary: #2c3e50;
  --secondary: #e67e22;
  --accent: #3498db;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  
  --bg-main: #fdfbf7;
  --bg-paper: #ffffff;
  --bg-card: #fefefe;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --text-muted: #95a5a6;
  
  --border-light: #ecf0f1;
  --border-medium: #bdc3c7;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
  
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --font-script: 'Pacifico', cursive;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-main: #1a1a2e;
  --bg-paper: #16213e;
  --bg-card: #0f3460;
  --text-primary: #eaeaea;
  --text-secondary: #b8b8b8;
  --text-muted: #888888;
  --border-light: #2d3748;
  --border-medium: #4a5568;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}


* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 20px;
  transition: var(--transition);
}

/* === Header === */
.header {
  max-width: 1400px;
  margin: 0 auto 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;
  background: var(--bg-paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.logo {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo i {
  color: var(--secondary);
}

.header-controls {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.theme-toggle {
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.2rem;
}

.theme-toggle:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2980b9);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border-medium);
  color: var(--text-primary);
}

/* === Main Container === */
.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* === Tab Navigation === */
.tab-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  background: var(--bg-paper);
  padding: 15px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), #2980b9);
  color: white;
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Grid Layouts === */
.planner-grid {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 25px;
  margin-bottom: 30px;
}

@media (max-width: 1200px) {
  .planner-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .planner-grid {
    grid-template-columns: 1fr;
  }
}

/* === Cards === */
.card {
  background: var(--bg-paper);
  border-radius: var(--radius-lg);
  padding: 25px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-light);
}

.card-title i {
  color: var(--secondary);
}

/* === Form Elements === */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="date"],
input[type="week"],
input[type="month"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

/* === Habit Tracker === */
.habit-tracker {
  margin-top: 20px;
}

.habit-item {
  background: var(--bg-card);
  padding: 15px;
  border-radius: var(--radius-md);
  margin-bottom: 15px;
  border: 2px solid var(--border-light);
}

.habit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.habit-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.habit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.habit-day {
  aspect-ratio: 1;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  background: var(--bg-paper);
}

.habit-day:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.habit-day.checked {
  background: linear-gradient(135deg, var(--success), #229954);
  color: white;
  border-color: var(--success);
}

.habit-day.partial {
  background: linear-gradient(135deg, var(--warning), #d68910);
  color: white;
  border-color: var(--warning);
}

.habit-day.missed {
  background: linear-gradient(135deg, var(--danger), #c0392b);
  color: white;
  border-color: var(--danger);
}

.habit-stats {
  display: flex;
  gap: 15px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.habit-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
}

.habit-stat i {
  font-size: 1rem;
}


/* === Weekly Review === */
.review-section {
  margin-bottom: 25px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.review-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent);
}

.review-card h4 {
  font-family: var(--font-heading);
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 1.1rem;
}

/* === Monthly Goals === */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.goal-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.goal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--secondary));
}

.goal-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.goal-progress {
  margin-top: 15px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #27ae60);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* === Task List === */
.task-list {
  margin-top: 15px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  border: 2px solid var(--border-light);
  transition: var(--transition);
}

.task-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.task-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--success);
}

.task-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--text-primary);
  padding: 0;
}

.task-input:focus {
  outline: none;
}

.task-item.completed .task-input {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-delete {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 5px;
  opacity: 0;
  transition: var(--transition);
}

.task-item:hover .task-delete {
  opacity: 1;
}

/* === Stats & Charts === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.stat-card {
  background: linear-gradient(135deg, var(--accent), #2980b9);
  color: white;
  padding: 25px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* === Print Styles === */
@media print {
  body {
    background: white;
    padding: 0;
  }
  
  .header-controls,
  .tab-nav,
  .btn,
  .no-print {
    display: none !important;
  }
  
  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
    margin-bottom: 20px;
  }
  
  .planner-grid {
    grid-template-columns: 1fr;
  }
}

/* === Export Modal === */
.export-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.export-modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-paper);
  padding: 40px;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--primary);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 5px 10px;
}

.export-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.export-option {
  padding: 20px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 15px;
}

.export-option:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.export-icon {
  font-size: 2rem;
  color: var(--accent);
}

.export-info h4 {
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.export-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* === Responsive === */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    text-align: center;
  }
  
  .logo {
    font-size: 1.5rem;
  }
  
  .tab-nav {
    overflow-x: auto;
  }
  
  .habit-grid {
    grid-template-columns: repeat(7, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* === Animations === */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-in {
  animation: slideIn 0.4s ease-out;
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}
