/* =====================================================
   CESGlobal DocHub — Brand Style
   Colors from CESGlobal Logo:
   Teal #00A9B5 | Navy #1A3A8C | Red #E53935 | Gold #F5A623
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,600;0,700;0,800;0,900;1,800;1,900&family=Nunito+Sans:wght@400;700;800&display=swap');

/* ===== CSS Variables ===== */
:root {
  /* CESGlobal Brand Colors */
  --cream: #FFFDF5;
  /* Warm cream background */
  --yellow: #F5A623;
  /* logo gold */
  --yellow-d: #E09010;
  --pink: #E53935;
  /* logo red accent */
  --pink-d: #C62828;
  --teal: #00A9B5;
  /* logo teal — primary */
  --teal-d: #007F8C;
  --navy: #1A3A8C;
  /* logo navy blue */
  --blue: #1A3A8C;
  --blue-ce: #00A9B5;
  --white: #FFFFFF;
  --gray: #F5F6FA;
  /* Light warm gray */
  --text: #1A3A8C;

  /* Border & Shadow — navy blue instead of black */
  --bw: 3px;
  --border: 3px solid #1A3A8C;
  --border-2: 2px solid #1A3A8C;
  --shadow: 5px 5px 0 #1A3A8C;
  --shadow-sm: 3px 3px 0 #1A3A8C;
  --shadow-lg: 7px 7px 0 #1A3A8C;

  /* Radius */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-full: 9999px;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--cream);
  color: var(--navy);
  line-height: 1.5;
  overflow-x: hidden;
  /* prevent horizontal scroll / sidebar bleed */
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
}

p {
  color: var(--navy);
  opacity: 0.75;
  line-height: 1.7;
}

/* ===== Layout ===== */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-sm {
  padding: 48px 0;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 68px;
  background: var(--white);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand img {
  height: 36px;
  width: auto;
}

.navbar-brand .brand-tag {
  background: var(--navy);
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--r-full);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--cream);
  border: var(--border);
  border-radius: var(--r-full);
  padding: 4px;
}

.navbar-nav a {
  padding: 7px 18px;
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: var(--navy);
  color: var(--yellow);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-full);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: var(--border);
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}

.btn:hover {
  transform: translate(-2px, -2px);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: none !important;
}

.btn-pink {
  background: var(--pink);
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn-pink:hover {
  box-shadow: var(--shadow-lg);
  background: var(--pink-d);
}

.btn-yellow {
  background: var(--yellow);
  color: var(--navy);
  box-shadow: var(--shadow);
}

.btn-yellow:hover {
  box-shadow: var(--shadow-lg);
}

.btn-navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  box-shadow: 3px 3px 0 var(--yellow);
}

.btn-navy:hover {
  box-shadow: 5px 5px 0 var(--yellow);
}

.btn-teal {
  background: var(--teal);
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn-teal:hover {
  box-shadow: var(--shadow-lg);
}

.btn-white {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow);
}

.btn-white:hover {
  box-shadow: var(--shadow-lg);
  background: var(--cream);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background: var(--cream);
  box-shadow: var(--shadow);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.8rem;
}

/* Google btn special */
.btn-google {
  background: var(--white);
  color: var(--navy);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--r-full);
}

.btn-google:hover {
  box-shadow: var(--shadow-lg);
  transform: translate(-2px, -2px);
}

/* ===== SECTION LABEL (pill) ===== */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.section-label.yellow {
  background: var(--yellow);
  color: var(--navy);
}

.section-label.pink {
  background: var(--pink);
  color: var(--white);
}

.section-label.teal {
  background: var(--teal);
  color: var(--white);
}

/* ===== CARDS (brutalist style) ===== */
.card-brut {
  background: var(--white);
  border: var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  position: relative;
}

.card-brut:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-lg);
}

/* Tape decoration on card top */
.card-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 18px;
  background: var(--pink);
  border: var(--border-2);
  border-radius: 4px;
  z-index: 2;
}

.card-tape.yellow {
  background: var(--yellow);
}

.card-tape.teal {
  background: var(--teal);
}

/* ===== DECORATIVE SHAPES ===== */
.deco {
  position: absolute;
  border: var(--border);
  border-radius: var(--r-sm);
  pointer-events: none;
}

.deco-circle {
  border-radius: 50%;
}

.deco-diamond {
  transform: rotate(45deg);
  border-radius: 6px;
}

.deco.yellow {
  background: var(--yellow);
}

.deco.pink {
  background: var(--pink);
}

.deco.teal {
  background: var(--teal);
}

.deco.navy {
  background: var(--navy);
}

.deco.blue {
  background: var(--blue);
}

.deco.white {
  background: var(--white);
}

/* === DOC CARD === */
.doc-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.doc-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-lg);
}

.doc-card-cover {
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.doc-card-body {
  padding: 14px;
}

.doc-card-category {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--yellow);
  color: var(--navy);
  border: var(--border-2);
  padding: 2px 10px;
  border-radius: var(--r-full);
  display: inline-block;
  margin-bottom: 8px;
}

.doc-card-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 4px;
  line-height: 1.3;
}

.doc-card-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy);
  opacity: 0.6;
  margin-bottom: 10px;
}

.doc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: var(--border-2);
}

.doc-card-price {
  font-size: 1rem;
  font-weight: 900;
  color: var(--pink);
}

.doc-card-price.free {
  color: var(--teal);
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  border: var(--border-2);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-yellow {
  background: var(--yellow);
  color: var(--navy);
}

.badge-pink {
  background: var(--pink);
  color: var(--white);
}

.badge-teal {
  background: var(--teal);
  color: var(--white);
}

.badge-navy {
  background: var(--navy);
  color: var(--yellow);
}

.badge-white {
  background: var(--white);
  color: var(--navy);
}

.badge-green {
  background: #00C853;
  color: var(--white);
}

/* ===== SIDEBAR (app layout) ===== */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: linear-gradient(160deg, #0D2260 0%, #1A3A8C 60%, #0E4D6B 100%);
  border-right: 3px solid #1A3A8C;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header img {
  height: 30px;
  filter: brightness(10);
}

.sidebar-header .s-tag {
  background: var(--yellow);
  color: var(--navy);
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: var(--r-full);
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  font-weight: 700;
  transition: all 0.2s;
  margin-bottom: 3px;
  border: 2px solid transparent;
}

.sidebar-nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar-nav a.active {
  background: var(--teal);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-sm);
}

.sidebar-nav .nav-label {
  font-size: 0.67rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.3);
  padding: 14px 14px 5px;
  display: block;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 2px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: white;
}

.sidebar-user-email {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 1px;
}

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

.app-main {
  margin-left: 260px;
  flex: 1;
  background: var(--cream);
}

.app-topbar {
  height: 62px;
  background: var(--white);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-content {
  padding: 28px 24px;
}

/* ===== AVATAR ===== */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-weight: 900;
  font-size: 0.9rem;
  overflow: hidden;
  border: var(--border);
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== STAT CARD ===== */
.stat-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  border: var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.yellow {
  background: var(--yellow);
}

.stat-icon.pink {
  background: var(--pink);
}

.stat-icon.teal {
  background: var(--teal);
}

.stat-icon.navy {
  background: var(--navy);
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--r-full);
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: var(--r-full);
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--navy);
  opacity: 0.6;
  cursor: pointer;
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.2s;
  white-space: nowrap;
  /* prevent text wrapping inside buttons */
  flex-shrink: 0;
}

.tab-btn.active {
  background: var(--navy);
  color: var(--yellow);
  opacity: 1;
  border-color: var(--navy);
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  min-width: 260px;
  font-size: 0.875rem;
  font-weight: 700;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== SPINNER ===== */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(26, 58, 140, 0.15);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 58, 140, 0.55);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--white);
  border: var(--border);
  border-radius: var(--r-xl);
  padding: 36px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--cream);
}

::-webkit-scrollbar-thumb {
  background: var(--navy);
  border-radius: 4px;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 6px;
  background: var(--cream);
  border: var(--border-2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
}

.empty-state svg {
  width: 80px;
  opacity: 0.25;
  margin-bottom: 20px;
}

.empty-state h3 {
  margin-bottom: 8px;
}

/* ===== FORM ===== */
.form-input {
  width: 100%;
  padding: 11px 16px;
  border: var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--white);
  transition: box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  box-shadow: var(--shadow-sm);
}

/* ===== ANIMATIONS ===== */
@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes float-r {

  0%,
  100% {
    transform: rotate(45deg) translateY(0);
  }

  50% {
    transform: rotate(45deg) translateY(-8px);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anim-fade-up {
  animation: fadeUp 0.5s ease both;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

.delay-4 {
  animation-delay: 0.4s;
}

/* ===== GRID ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* ===== GLOBAL MOBILE NAVBAR FIX ===== */
  .navbar {
    height: 56px;
    padding: 0 12px;
    overflow: hidden;
  }

  .navbar-nav {
    display: none !important;
  }

  .navbar-brand .brand-tag {
    display: none;
  }

  .navbar-brand img {
    height: 30px;
  }

  .navbar-actions {
    gap: 6px;
  }

  .navbar-actions a:first-child {
    display: none !important;
  }

  .navbar-actions a:last-child {
    font-size: 0.72rem !important;
    padding: 7px 12px !important;
    white-space: nowrap;
  }

  /* ===== SIDEBAR (dashboard) ===== */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
  }

  .section {
    padding: 40px 0;
  }

  /* Adjust body top padding for shorter navbar */
  body {
    padding-top: 56px;
  }

  /* ===== MOBILE TABS FIX ===== */
  .tabs {
    width: 100%;
    /* full width on mobile */
    border-radius: 12px;
    /* less round for horizontal scroll look */
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  /* ===== STATS GRID ===== */
  .stat-card {
    padding: 14px 12px;
    gap: 10px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  /* ===== FEATURE CARDS (index.html) ===== */
  .feat-card {
    padding: 20px 16px;
  }

  .feat-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  /* ===== SHOP ===== */
  .shop-body {
    flex-direction: column;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-card {
    min-width: 0;
  }

  /* ===== CONTAINER ===== */
  .container {
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  * {
    max-width: 100%;
    box-sizing: border-box;
  }

  img {
    max-width: 100%;
  }
}