/* ==========================================================================
   Clean User Dashboard - 8 Divisions Grid System
   ========================================================================== */

/* Main page background */
.min-h-screen.flex.flex-col.bg-slate-50 {
  background: #f8fafc !important;
}

.min-h-screen.flex.flex-col.bg-slate-50 > main {
  min-height: calc(100vh - 68px);
  background: #f8fafc;
}

/* Scope User Dashboard styling ONLY to when the division grid (.space-y-8) exists */
.min-h-screen.flex.flex-col.bg-slate-50 > main > div:has(.space-y-8),
.clean-dashboard-active {
  max-width: 1060px !important;
  margin: 0 auto !important;
  padding: 32px 20px 48px !important;
}

/* Hide default cluttered React controls ONLY on the User Dashboard, NEVER on Register/Login/etc. */
.min-h-screen.flex.flex-col.bg-slate-50 > main > div:has(.space-y-8) > *:not(#clean-dashboard-header):not(.space-y-8):not(.clean-divisions-grid),
.clean-dashboard-active > *:not(#clean-dashboard-header):not(.space-y-8):not(.clean-divisions-grid) {
  display: none !important;
}

/* Top Clean Dashboard Header */
#clean-dashboard-header {
  margin-bottom: 28px;
  animation: fadeInDown 0.35s ease-out;
}

.clean-home-navigation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 12px;
  margin-left: 8px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  vertical-align: middle;
}

.clean-home-navigation svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.clean-home-navigation:hover {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
  transform: translateY(-1px);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.clean-top-wrapper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.clean-title-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clean-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 9999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.clean-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.clean-top-title {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.25;
}

.clean-top-desc {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}

.clean-search-box {
  position: relative;
  min-width: 260px;
}

.clean-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #94a3b8;
  pointer-events: none;
}

.clean-search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.clean-search-input:focus {
  background: #ffffff;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ==========================================================================
   8 Divisions Grid Container
   ========================================================================== */
.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8,
.min-h-screen.flex.flex-col.bg-slate-50 .clean-divisions-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 20px !important;
  margin: 0 !important;
  justify-content: center !important;
  align-items: stretch !important;
}

/* Neutralize Tailwind space-y-8 sibling margin-top that was pushing down cards 2..8 */
.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > *,
.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section,
.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > :not([hidden]) ~ :not([hidden]),
.min-h-screen.flex.flex-col.bg-slate-50 .clean-divisions-grid > *,
.min-h-screen.flex.flex-col.bg-slate-50 .clean-divisions-grid > section,
.min-h-screen.flex.flex-col.bg-slate-50 .clean-divisions-grid > :not([hidden]) ~ :not([hidden]) {
  margin: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  --tw-space-y-reverse: 0 !important;
}

.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section,
.min-h-screen.flex.flex-col.bg-slate-50 .clean-divisions-grid > section {
  width: 100% !important;
  height: 100% !important;
  min-height: 184px !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  margin: 0 !important;
  margin-top: 0 !important;
  border: 0 !important;
  border-radius: 22px !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section > div:first-child {
  width: 100% !important;
  min-height: 184px !important;
  height: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 22px 14px 18px !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 22px !important;
  background: #ffffff !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04), 0 2px 4px -1px rgba(15, 23, 42, 0.02) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  position: relative !important;
  overflow: hidden !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Hover & Active Effects */
.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section > div:first-child:hover {
  transform: translateY(-6px) !important;
  border-color: #10b981 !important;
  box-shadow: 0 20px 32px -6px rgba(16, 185, 129, 0.16), 0 8px 16px -4px rgba(15, 23, 42, 0.06) !important;
}

.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section > div:first-child:active {
  transform: translateY(-2px) scale(0.99) !important;
}

/* Hide unneeded default children inside section */
.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section > div:first-child > div:last-child,
.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section > div:last-child {
  display: none !important;
}

/* ==========================================================================
   Folder Card Elements
   ========================================================================== */
.clean-folder-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section > div:first-child:hover .clean-folder-icon-wrapper {
  transform: scale(1.08);
}

.clean-folder-svg {
  width: 68px;
  height: 50px;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(245, 158, 11, 0.2));
}

.clean-folder-drive-badge {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.clean-drive-svg {
  width: 14px;
  height: 14px;
}

/* Division Name */
.clean-folder-card-name {
  color: #0f172a;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section > div:first-child:hover .clean-folder-card-name {
  color: #059669;
}

/* English subtitle pill */
.clean-folder-card-sub {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section > div:first-child:hover .clean-folder-card-sub {
  background: #ecfdf5;
  color: #047857;
}

/* Action hint pill */
.clean-folder-card-action {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section > div:first-child:hover .clean-folder-card-action {
  opacity: 1;
  transform: translateX(2px);
}

/* ==========================================================================
   Responsive Grid System
   ========================================================================== */
@media (max-width: 960px) {
  .min-h-screen.flex.flex-col.bg-slate-50 .space-y-8,
  .min-h-screen.flex.flex-col.bg-slate-50 .clean-divisions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}

@media (max-width: 768px) {
  .min-h-screen.flex.flex-col.bg-slate-50 > main > div {
    padding: 20px 14px 36px !important;
  }

  .clean-top-wrapper {
    padding: 18px 20px;
    border-radius: 18px;
  }

  .clean-top-title {
    font-size: 19px;
  }

  .clean-search-box {
    width: 100%;
    min-width: 0;
  }

  /* 2 columns on tablet & mobile */
  .min-h-screen.flex.flex-col.bg-slate-50 .space-y-8,
  .min-h-screen.flex.flex-col.bg-slate-50 .clean-divisions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  .min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section,
  .min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section > div:first-child {
    min-height: 164px !important;
    padding: 18px 12px 14px !important;
    border-radius: 18px !important;
  }

  .clean-folder-svg {
    width: 58px;
    height: 42px;
  }

  .clean-folder-card-name {
    font-size: 17px;
  }
}

@media (max-width: 420px) {
  .min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 {
    gap: 10px !important;
  }

  .min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section,
  .min-h-screen.flex.flex-col.bg-slate-50 .space-y-8 > section > div:first-child {
    min-height: 150px !important;
    padding: 14px 8px 12px !important;
    border-radius: 16px !important;
  }

  .clean-folder-svg {
    width: 52px;
    height: 38px;
  }

  .clean-folder-card-name {
    font-size: 16px;
  }

  .clean-folder-card-sub {
    font-size: 10px;
    padding: 2px 7px;
  }
}
