/* Google Stitch Design Tokens for JT Sayarut Magar */
:root {
  --jt-primary: #046A4D; /* Green */
  --jt-primary-light: #068863;
  --jt-secondary: #664A00; /* Brown */
  --jt-secondary-light: #B38600;
  --jt-surface: #FAF4E8; /* Cream */
  --jt-card-bg: #ffffff;
  --jt-text-dark: #1c1b1f;
  --jt-text-muted: #5b5b66;
  --jt-outline: #c6c5d4;
  --jt-radius: 16px;
  --jt-radius-sm: 10px;
  --jt-shadow-sm: 0 2px 8px rgba(4, 106, 77, 0.06);
  --jt-shadow-md: 0 6px 20px rgba(4, 106, 77, 0.1);
  --jt-font-heading: 'Heebo', -apple-system, sans-serif;
  --jt-font-body: 'Heebo', -apple-system, sans-serif;
  --jt-font-mono: 'Heebo', -apple-system, sans-serif;
}

/* Subfolders Filter Bar */
.jt-subfolders-bar {
  background: #ffffff;
  border: 1px solid var(--jt-outline);
  border-radius: var(--jt-radius-sm);
  padding: 16px 20px;
  margin-bottom: 32px;
  box-shadow: var(--jt-shadow-sm);
}

.jt-subfolders-title {
  font-family: var(--jt-font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--jt-primary);
  margin-bottom: 12px;
}

.jt-subfolders-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.jt-subfolder-btn {
  background: var(--jt-surface);
  border: 1px solid var(--jt-outline);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: var(--jt-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--jt-text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.jt-subfolder-btn:hover, .jt-subfolder-btn.active {
  background: var(--jt-primary-light);
  color: #ffffff;
  border-color: var(--jt-primary-light);
}

.jt-magar-wrapper {
  font-family: var(--jt-font-body);
  color: var(--jt-text-dark);
  background-color: var(--jt-surface);
  border-radius: var(--jt-radius);
  padding: 32px;
  max-width: 1300px;
  margin: 0 auto;
  direction: rtl;
  text-align: right;
  box-sizing: border-box;
  position: relative;
}

/* Background Dotted Pattern */
.jt-magar-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(var(--jt-primary-light) 0.5px, transparent 0.5px);
  background-size: 16px 16px;
  opacity: 0.04;
  pointer-events: none;
  border-radius: var(--jt-radius);
}

.jt-magar-hero {
  background: var(--jt-primary);
  color: #ffffff;
  padding: 40px 32px;
  border-radius: var(--jt-radius);
  box-shadow: var(--jt-shadow-md);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.jt-magar-hero-badge {
  display: inline-block;
  background: rgba(254, 214, 91, 0.2);
  color: #fed65b;
  border: 1px solid rgba(254, 214, 91, 0.4);
  font-family: var(--jt-font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.jt-magar-hero-title {
  font-family: var(--jt-font-heading);
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 12px 0;
  line-height: 1.25;
  color: #ffffff;
}

.jt-magar-hero-subtitle {
  font-size: 17px;
  opacity: 0.9;
  margin: 0 0 28px 0;
  max-width: 700px;
  line-height: 1.5;
}

/* Search Bar */
.jt-magar-search-bar {
  position: relative;
  max-width: 800px;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 12px;
  padding: 6px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.jt-magar-search-icon {
  font-size: 20px;
  margin-left: 12px;
}

.jt-magar-search-bar input {
  width: 100%;
  border: none;
  outline: none;
  font-family: var(--jt-font-body);
  font-size: 16px;
  padding: 12px 0;
  background: transparent;
  color: var(--jt-text-dark);
}

#jt-magar-search-clear {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--jt-text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

/* Stats Bar */
.jt-magar-stats-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 30px;
}

.jt-magar-stat-item {
  flex: 1;
  min-width: 0;
  background: var(--jt-primary);
  border: 1px solid var(--jt-primary-light);
  border-radius: var(--jt-radius-sm);
  padding: 12px 16px;
  text-align: center;
  box-shadow: var(--jt-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.jt-magar-stat-val {
  font-family: var(--jt-font-heading);
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.jt-magar-stat-lbl {
  font-family: var(--jt-font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.jt-magar-divider {
  border: none;
  height: 2px;
  background-color: var(--jt-primary);
  margin: 12px 0 24px 0;
  border-radius: 2px;
  opacity: 0.8;
}

/* Section Title */
.jt-magar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.jt-magar-section-title h2 {
  font-family: var(--jt-font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--jt-secondary);
  margin: 0;
}

.jt-magar-badge {
  background: var(--jt-secondary);
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 12px;
}

/* Bento Grid Categories - Adapted for Sidebar */
.jt-magar-bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.jt-bento-card {
  background: var(--jt-card-bg);
  border: 1px solid var(--jt-outline);
  border-radius: var(--jt-radius-sm);
  padding: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: var(--jt-shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
}

.jt-bento-card-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
}

.jt-bento-subfolders {
  width: 100%;
  display: none; /* JS will toggle this */
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--jt-outline);
  flex-direction: column;
  gap: 6px;
}

.jt-subfolder-item {
  font-size: 14px;
  font-family: var(--jt-font-heading);
  color: #000000;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-bottom: 1px solid #eaeaea;
}

.jt-subfolder-item:last-child {
  border-bottom: none;
}

.jt-subfolder-item:hover {
  background: rgba(0,0,0,0.04);
}

.jt-subfolder-item.active {
  background: var(--jt-primary);
  color: #ffffff;
  font-weight: 700;
  border-radius: 6px;
  border-bottom-color: transparent;
}

.jt-bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--jt-shadow-md);
  border-color: var(--jt-primary);
}

.jt-bento-card.active {
  border: 2px solid var(--jt-primary);
  background: #ffffff;
}

.jt-bento-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.jt-bento-name {
  font-family: var(--jt-font-heading);
  font-weight: 800;
  font-size: 14px;
  color: var(--jt-primary);
}

.jt-bento-meta {
  font-size: 14px;
  color: var(--jt-primary);
  opacity: 0.9;
}

.jt-bento-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jt-bento-arrow {
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--jt-primary);
  border-bottom: 2px solid var(--jt-primary);
  transform: rotate(-45deg);
  transition: transform 0.3s ease;
  margin-left: 8px;
  margin-top: -2px;
}

.jt-bento-card.active .jt-bento-arrow {
  transform: rotate(135deg);
  margin-top: 4px;
}

/* Type Filter Buttons */
.jt-magar-type-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.jt-type-btn {
  background: #ffffff;
  border: 1px solid var(--jt-primary);
  color: var(--jt-primary);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: var(--jt-font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.jt-type-btn svg {
  stroke: var(--jt-primary);
  transition: stroke 0.2s ease;
}

.jt-type-btn:hover {
  background: var(--jt-primary);
  color: #ffffff;
}

.jt-type-btn:hover svg {
  stroke: #ffffff;
}

.jt-type-btn.active {
  background: var(--jt-primary);
  color: #ffffff;
  border-color: var(--jt-primary);
}

.jt-type-btn.active svg {
  stroke: #ffffff;
}

/* Files Grid */
.jt-magar-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.jt-file-card {
  background: var(--jt-card-bg);
  border: 1px solid var(--jt-outline);
  border-radius: var(--jt-radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--jt-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jt-file-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--jt-shadow-md);
}

.jt-file-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.jt-file-icon {
  width: 36px;
  height: 36px;
  background: var(--jt-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.jt-file-icon svg {
  stroke: #ffffff;
}

.jt-file-info {
  flex: 1;
  overflow: hidden;
}

.jt-file-title {
  font-family: var(--jt-font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--jt-primary);
  margin-bottom: 4px;
  word-break: break-word;
  line-height: 1.4;
}

.jt-file-category {
  font-size: 12px;
  color: var(--jt-secondary);
}

.jt-file-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--jt-surface);
  padding-top: 10px;
  margin-top: 10px;
}

.jt-file-size {
  font-family: var(--jt-font-mono);
  font-size: 12px;
  color: var(--jt-text-muted);
}

.jt-file-download-btn {
  background: var(--jt-primary);
  color: #ffffff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
}

.jt-file-download-btn:hover {
  background: var(--jt-primary-light);
  color: #ffffff;
}

/* Primary Button */
.jt-magar-btn-primary {
  background: var(--jt-primary);
  color: #ffffff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: var(--jt-font-heading);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--jt-shadow-sm);
  transition: background 0.2s ease;
}

.jt-magar-btn-primary:hover {
  background: var(--jt-primary-light);
}

.jt-magar-center {
  text-align: center;
}

.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
