@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400;1,9..40,500&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

/* ══════════════════════════════════════════
   RENEW BRAND SYSTEM
   ══════════════════════════════════════════ */

:root {
  /* Brand Colors */
  --blue: #3967AF;
  --blue-dark: #2B4F8A;
  --blue-light: #EBF0F8;
  --blue-wash: #F5F8FC;
  --orange: #F38431;
  --orange-dark: #D96E1E;
  --orange-light: #FEF4EB;
  --white: #FFFFFF;
  --offwhite: #FAFBFD;
  --gray-50: #F8F9FA;
  --gray-100: #F1F3F5;
  --gray-200: #E9ECEF;
  --gray-300: #DEE2E6;
  --gray-400: #ADB5BD;
  --gray-500: #6C757D;
  --gray-600: #495057;
  --gray-700: #343A40;
  --gray-800: #212529;
  --gray-900: #0F1419;

  /* Legacy aliases */
  --renew-blue: #3967AF;
  --renew-orange: #F38431;
  --charcoal: #212529;
  --mid-gray: #6C757D;
  --light-gray: #F8F9FA;

  /* Fonts */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --max-width: 1200px;
  --section-padding: clamp(80px, 10vw, 140px);
  --horizontal-padding: clamp(24px, 5vw, 48px);

  /* Cards */
  --card-padding: 32px;
  --card-padding-y: 32px;
  --card-padding-x: 32px;
  --card-border-radius: 12px;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --card-hover-shadow: 0 8px 32px rgba(57, 103, 175, 0.1);

  /* Buttons */
  --button-border-radius: 6px;
  --button-padding-y: 16px;
  --button-padding-x: 32px;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 600;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); letter-spacing: -0.02em; color: var(--gray-900); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); letter-spacing: -0.01em; color: var(--gray-900); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); color: var(--gray-800); }
p { font-size: 1.05rem; color: var(--gray-600); }
small, .caption { font-size: 0.9rem; font-weight: 300; color: var(--gray-500); }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

/* ── LAYOUT ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--horizontal-padding);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--button-padding-y) var(--button-padding-x);
  border-radius: var(--button-border-radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(57, 103, 175, 0.25);
}
.btn-primary:hover {
  background: var(--blue-dark);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(57, 103, 175, 0.35);
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn-secondary:hover {
  background: var(--blue);
  color: var(--white);
  transform: translateY(-1px);
}
.btn-accent {
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(243, 132, 49, 0.25);
}
.btn-accent:hover {
  background: var(--orange-dark);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(243, 132, 49, 0.35);
  transform: translateY(-1px);
}
.btn-sm {
  padding: 10px 20px;
  font-size: 0.88rem;
}
.btn-orange { background: var(--orange); color: var(--white); box-shadow: 0 2px 8px rgba(243,132,49,0.25); }
.btn-orange:hover { background: var(--orange-dark); color: var(--white); box-shadow: 0 4px 16px rgba(243,132,49,0.35); transform: translateY(-1px); }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--card-border-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}
.card:hover {
  box-shadow: var(--card-hover-shadow);
  border-color: var(--blue);
  transform: translateY(-2px);
}

/* ── NAVIGATION ── */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0 var(--horizontal-padding);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}
.navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.navbar-label {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-500);
  padding: 4px 12px;
  background: var(--gray-100);
  border-radius: 100px;
}
.navbar-link {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.navbar-link:hover { color: var(--blue); }

/* ── WORDMARK ── */
.wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.wordmark span { color: var(--orange); }

/* ── SEARCH BAR ── */
.search-bar {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--gray-300);
  border-radius: var(--button-border-radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(57, 103, 175, 0.12);
}
.search-wrapper {
  position: relative;
}
.search-wrapper::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ADB5BD' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* ── BREADCRUMBS ── */
.breadcrumb-nav {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 0;
}
.breadcrumb-nav a {
  text-decoration: none;
  color: var(--blue);
  font-weight: 500;
  transition: color 0.2s;
}
.breadcrumb-nav a:hover { color: var(--blue-dark); }
.breadcrumb-sep {
  margin: 0 4px;
  color: var(--gray-400);
  font-size: 0.85rem;
}

/* ── VIEW TOGGLE ── */
.view-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--gray-300);
  border-radius: var(--button-border-radius);
  overflow: hidden;
}
.view-toggle button {
  padding: 8px 16px;
  border: none;
  background-color: var(--white);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.view-toggle button + button {
  border-left: 1px solid var(--gray-300);
}
.view-toggle button.active {
  background-color: var(--blue);
  color: var(--white);
}
.view-toggle button:hover:not(.active) {
  background-color: var(--gray-50);
}

/* ── FILE BROWSER: GRID ── */
.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.folder-card, .file-card {
  text-decoration: none;
  color: inherit;
  display: block;
}
.folder-card-inner, .file-card-inner {
  width: 100%;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}
.folder-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--blue-light);
  color: var(--blue);
  margin-bottom: 4px;
}
.folder-card-icon svg { width: 24px; height: 24px; }
.file-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--orange-light);
  color: var(--orange);
  margin-bottom: 4px;
}
.file-card-icon svg { width: 24px; height: 24px; }
.folder-card h4, .file-card h4 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
  word-break: break-word;
}
.folder-card p, .file-card p {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin: 0;
}

/* ── FILE BROWSER: LIST ── */
.list-view {
  display: none;
  width: 100%;
  margin-top: 20px;
  border: 1px solid var(--gray-200);
  border-radius: var(--card-border-radius);
  background: var(--white);
  overflow: hidden;
}
.list-view table {
  width: 100%;
  border-collapse: collapse;
}
.list-view th, .list-view td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--gray-700);
}
.list-view th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.list-view tr:last-child td { border-bottom: none; }
.list-view td a {
  text-decoration: none;
  color: var(--blue);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.list-view td a:hover { color: var(--blue-dark); }
.file-icon {
  font-size: 1.1rem;
  color: var(--gray-500);
}

/* ── SORT CONTROLS ── */
.sort-controls select {
  padding: 8px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--button-border-radius);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--gray-600);
  cursor: pointer;
}

/* ── FORMS ── */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--gray-700);
  font-size: 0.92rem;
  font-weight: 500;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--button-border-radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(57, 103, 175, 0.12);
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
  grid-column: 1 / -1;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--gray-100);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 2rem;
}
.empty-state p {
  font-size: 1rem;
  color: var(--gray-500);
}

/* ── FOOTER ── */
.portal-footer {
  background: var(--gray-900);
  color: var(--gray-500);
  padding: 32px var(--horizontal-padding);
  text-align: center;
  font-size: 0.85rem;
  margin-top: auto;
}
.portal-footer .wordmark {
  color: var(--white);
  display: inline-block;
  margin-bottom: 8px;
}
.portal-footer p { color: var(--gray-500); font-size: 0.85rem; }

.footer-internal {
  background: var(--gray-900);
  color: var(--gray-500);
  padding: 32px var(--horizontal-padding);
  text-align: center;
  font-size: 0.85rem;
  margin-top: auto;
}
.footer-internal .wordmark {
  color: var(--white);
  display: inline-block;
  margin-bottom: 8px;
}
.footer-internal p { color: var(--gray-500); font-size: 0.85rem; }

/* ── ANIMATIONS ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── UTILITY CLASSES ── */
.text-center { text-align: center; }
.text-blue { color: var(--blue); }
.text-orange { color: var(--orange); }
.text-muted { color: var(--gray-500); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.w-full { width: 100%; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .navbar {
    height: auto;
    padding: 12px var(--horizontal-padding);
    flex-wrap: wrap;
    gap: 8px;
  }
  .grid-view {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .hide-mobile { display: none; }
}

@media (max-width: 600px) {
  .grid-view {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .folder-card-inner, .file-card-inner {
    padding: 16px 12px;
  }
}
