/*
 * style.css - Academic Year 2569 School Action Plan Tracking System Custom Styling
 * Theme: Premium Navy & Gold (Modern educational dashboard)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --primary-dark: #0f172a;
  --primary: #1e3a8a;
  --primary-light: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.15);
  
  --accent: #d97706;
  --accent-light: #fbbf24;
  --accent-glow: rgba(217, 119, 6, 0.1);
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  
  /* Layout */
  --sidebar-width: 280px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-premium: 0 20px 25px -5px rgba(15, 23, 42, 0.04), 0 10px 10px -5px rgba(15, 23, 42, 0.02);
}

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

body {
  font-family: 'Sarabun', 'Inter', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.logo-sub {
  font-size: 11px;
  color: var(--accent-light);
  font-weight: 600;
  margin-top: 2px;
  text-transform: uppercase;
}

.sidebar-menu {
  list-style: none;
  padding: 24px 16px;
  flex-grow: 1;
}

.menu-item {
  margin-bottom: 8px;
}

.menu-link {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.menu-link i {
  margin-right: 12px;
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.menu-link:hover, .menu-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.06);
}

.menu-link.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.2) 0%, rgba(37, 99, 235, 0.05) 100%);
  border-left: 4px solid var(--primary-light);
  padding-left: 12px;
  color: #60a5fa;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header Styling */
.app-header {
  height: var(--header-height);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.header-title-area h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.header-title-area p {
  font-size: 12px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* User Role Switcher Dropdown Styling */
.role-badge-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.role-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.role-select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  outline: none;
}

/* Main Workspace View Content */
.content-body {
  padding: 32px;
  flex-grow: 1;
}

/* Pages Views Setup */
.view-section {
  display: none;
  animation: fadeIn var(--transition-normal) forwards;
}

.view-section.active {
  display: block;
}

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

/* Grid Dashboard widgets */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.02);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.budget {
  background-color: rgba(30, 58, 138, 0.08);
  color: var(--primary);
}

.stat-icon.spent {
  background-color: rgba(217, 119, 6, 0.08);
  color: var(--accent);
}

.stat-icon.remaining {
  background-color: rgba(16, 185, 129, 0.08);
  color: var(--success);
}

.stat-icon.projects-count {
  background-color: rgba(6, 182, 212, 0.08);
  color: var(--info);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  transform: translate(30px, -30px);
}

/* Charts Grid container */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.chart-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0, 0, 0, 0.02);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 12px;
}

.chart-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-wrapper {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* SVG Chart styles */
.donut-svg {
  transform: rotate(-90deg);
}

.donut-segment {
  transition: stroke-dasharray 0.3s ease;
}

.donut-center-text {
  text-align: center;
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-center-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
}

.donut-center-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 20px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Custom SVG Bar Chart */
.bar-chart-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
}

.bar-bg {
  height: 10px;
  background-color: #f1f5f9;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Dashboard Project List Table */
.data-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0, 0, 0, 0.02);
  margin-bottom: 32px;
  overflow: hidden;
}

.card-header {
  padding: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-filter-box {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 13px;
  width: 220px;
  outline: none;
  transition: border var(--transition-fast);
}

.search-input:focus {
  border-color: var(--primary-light);
}

.filter-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  background-color: #fff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* Action Buttons styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-accent {
  background-color: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background-color: #b45309;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.btn-secondary {
  background-color: #e2e8f0;
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Tables styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 16px 24px;
  border-bottom: 1px solid #edf2f7;
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.5px;
}

.table td {
  padding: 16px 24px;
  border-bottom: 1px solid #edf2f7;
  color: var(--text-main);
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
  background-color: rgba(248, 250, 252, 0.6);
}

.project-row-title {
  font-weight: 600;
  color: var(--primary);
  display: block;
}

.project-row-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Badges styling */
.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.not_started {
  background-color: #f1f5f9;
  color: #475569;
}

.badge.in_progress {
  background-color: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.badge.completed {
  background-color: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.badge.delayed {
  background-color: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.group-tag {
  background-color: var(--primary-glow);
  color: var(--primary-light);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Modals & Popups design */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal) ease;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background-color: #fff;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  animation: modalSlideUp var(--transition-normal) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.modal-header {
  padding: 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8fafc;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.btn-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: #f8fafc;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Forms design elements */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  transition: border var(--transition-fast);
  background-color: #fff;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Dynamic Activities Lists */
.activity-item-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

/* File attachments design */
.attachments-wrapper {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: #f1f5f9;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  border: 1px dashed #cbd5e1;
}

.attachment-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attachment-info i {
  color: var(--primary-light);
  font-size: 16px;
}

.btn-remove-file {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--danger);
  font-size: 14px;
}

.upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  background-color: #f8fafc;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.upload-area:hover {
  border-color: var(--primary-light);
  background-color: var(--primary-glow);
}

.upload-area i {
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.upload-area p {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.upload-area input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* View Project Details Modal extra styles */
.project-details-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  border-bottom: 2px solid var(--accent-glow);
  padding-bottom: 4px;
}

.detail-text {
  font-size: 13.5px;
  background-color: #f8fafc;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid #cbd5e1;
}

.detail-meta-card {
  background-color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.meta-row {
  margin-bottom: 12px;
  font-size: 13px;
}

.meta-label {
  font-weight: 600;
  color: var(--text-muted);
  display: block;
}

.meta-value {
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
  word-break: break-all;
}

/* Comments Section style inside project details */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.comment-card {
  background-color: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12.5px;
  border-left: 3px solid var(--accent);
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.comment-date {
  font-weight: 400;
  font-size: 10px;
  color: var(--text-muted);
}

/* Image preview thumbnails */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.preview-thumb {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.preview-thumb:hover {
  transform: scale(1.05);
}

/* Settings View styling */
.settings-container {
  max-width: 600px;
  background-color: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.settings-group {
  margin-bottom: 24px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 20px;
}

.settings-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-group h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-wrapper {
    margin-left: 0;
  }
  
  .app-header {
    padding: 0 16px;
  }
  
  .content-body {
    padding: 16px;
  }
  
  .project-details-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}
