/* Reset basic margins so it hits the edges of the browser */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #3c4043; /* Medium dark for standard reading */
  line-height: 1.5;
  margin: 0; /* Important: Removes default browser margins */
}

/* App Headers (H1 Level) */
.header-brand, .app-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #202124; /* High contrast black */
  letter-spacing: -0.5px;
}

/* Master Layout: Splits screen left and right */
.app-layout {
  display: flex;          
  height: 100vh;          /* Takes up full screen height */
}

/* The Sidebar Boundary */
.narra-sidebar {
  width: 250px;
  flex-shrink: 0;         /* Prevents sidebar from squishing when dashboard gets full */
  display: flex;
  flex-direction: column; /* Forces the vertical stack */
  border-right: 2px solid #ccc; /* Creates the strict right-bound border */
  padding: 16px;
  box-sizing: border-box;
  background-color: #fcfcfc; /* Very light gray to distinguish the section */
}

/* Section Grouping (Stacks the links vertically) */
.sidebar-section {
  display: flex;
  flex-direction: column; 
  gap: 12px;
  margin-bottom: 24px;
}

/* Subtle section headers */
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #666;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 12px 12px 8px 12px;
}

/* Clean up the links and align icons */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;  /* Removes the default blue underline */
  color: #333;            /* Standard text color */
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.2s, color 0.2s;
}

/* Stops icons from warping and matches text color */
.nav-item svg {
  flex-shrink: 0;         
  stroke: currentColor; 
}

/* Hover Effect */
.nav-item:hover {
  background-color: #ebebeb; 
}

/* Active State Effect */
.nav-item.active {
  background-color: rgba(74, 144, 226, 0.1); /* Subtle blue tint */
  color: #2b70c9;
}

/* Divider Line between sections */
.sidebar-divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 16px 8px; 
}

/* The Dashboard Area */
.dashboard {
  flex-grow: 1;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
}

/* 1. Header Master Layout */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px 15px 24px; /* 16px Top, 24px Right, 24px Bottom, 24px Left */
  border-bottom: 1px solid #e0e0e0;
}

.header-left {
  flex: 1; /* Takes equal space so search stays centered */
}

.breadcrumb {
  font-size: 14px;
  color: #888;
}

.active-project {
  color: #333;
  font-weight: 600;
}

/* 3. Zone 2: Command Hub (Center) */
.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 8px 16px;
  width: 320px;
  gap: 12px;
  border: 1px solid transparent;
  transition: border-color 0.2s, background-color 0.2s;
}

.search-bar:focus-within {
  background-color: #ffffff;
  border-color: #4A90E2; /* Figma blue highlight */
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-bar svg {
  color: #888;
}

.search-bar input {
  border: none;
  background: none;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: #333;
}

.search-bar input::placeholder {
  color: #aaa;
}

/* 4. Zone 3: Collaboration & Actions (Right) */
.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
}

/* Multiplayer Avatars */
.avatar-group {
  display: flex;
  margin-right: 8px;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  border: 2px solid #ffffff; /* Gives them a cutout look when they overlap */
  margin-left: -8px; /* Makes them overlap */
  cursor: pointer;
}

.avatar-group .avatar-circle:first-child {
  margin-left: 0;
}

.color-editor { background-color: #E24A4A; }
.color-viewer { background-color: #4AE29E; }
.color-me { background-color: #4A90E2; margin-left: 0; }

/* Primary Action Button */
.btn-action {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #4A90E2;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-action:hover {
  background-color: #357ABD;
}

/* Clean up the profile button wrapper */
.btn-profile {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
/* The container for a single note */
.note-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid transparent; /* Invisible border to prevent layout shift */
  border-radius: 8px;
  margin-bottom: 12px;
  transition: background-color 0.2s, border-color 0.2s;
}

.note-content p {
  margin: 0;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
}

/* Dashboard container */
.dashboard-content {
  padding: 48px 40px; /* Reduced side padding slightly to maximize card width */
  background-color: #f9f9f9;
  flex-grow: 1;
  box-sizing: border-box; /* Ensures padding doesn't push it off-screen */
}

/* Master Flexbox for the row */
.creation-row {
  display: flex;
  gap: 32px; /* Clean spacing between the wide cards */
  width: 100%; /* Forces the row to span the entire available width */
}

/* Fluid, Rectangular Creation Cards */
.creation-card {
  flex: 1; /* The magic rule: forces all three cards to stretch and fill the row evenly */
  height: 160px; /* Locks the height to enforce a wide rectangular shape */
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Base icon styling */
.card-icon {
  color: #777;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  width: 48px;  
  height: 48px;
}

/* Text label */
.card-label {
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

/* Figma-style Hover States */
.creation-card:hover {
  border-color: #4A90E2;
  background-color: rgba(74, 144, 226, 0.04);
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.1);
  transform: translateY(-2px);
}

.creation-card:hover .card-icon {
  color: #4A90E2;
}

/* The Responsive File Grid */
.recent-grid {
  display: grid;
  /* Slimmed down from 220px to 180px to better suit portrait-shaped cards */
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
  gap: 24px;
}
/* Google Docs Style Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #202124; /* Google Docs dark gray */
}

.header-utilities {
  display: flex;
  gap: 16px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: #5f6368;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.icon-btn:hover {
  background-color: #f1f3f4;
}
/* Individual File Card */
.file-card {
  background-color: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 4px; /* Harder corners like Google Docs */
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.2s ease;
  overflow: hidden; 
}

.file-card:hover {
  border-color: #4A90E2;
}

/* Thumbnail Area */
.file-thumbnail {
  aspect-ratio: 8.5 / 11;
  background-color: #ffffff;
  border-bottom: 1px solid #dadce0;
  padding: 24px;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: hidden;
}
/* Dashboard Section Divider */
.dashboard-divider {
  height: 1px;
  background-color: #dadce0; /* Matches the Google Docs border gray */
  margin: 48px 0; /* Creates 48px of breathing room above and below the line */
  width: 100%;
}

/* Mock Document Content inside Thumbnail */
.mock-doc-lines {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mock-doc-lines .line {
  height: 4px;
  background-color: #f1f3f4;
  border-radius: 2px;
}

.mock-doc-lines .title-line { height: 8px; background-color: #e8eaed; }
.mock-doc-lines .circle-avatar { width: 24px; height: 24px; border-radius: 50%; background-color: #f1f3f4; margin-bottom: 8px; }
.w-100 { width: 100%; }
.w-90 { width: 90%; }
.w-80 { width: 80%; }
.w-60 { width: 60%; }
.w-40 { width: 40%; }
.mt-2 { margin-top: 8px; }

/* Hint to the user that it is editable */
.file-title-input:hover { background-color: #f1f3f4; cursor: text; }

/* Editable Title */
.file-title-input {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px;
  margin-left: -4px;
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
/* Active Editing State */
.file-title-input:focus { border-color: #4A90E2; background-color: #ffffff; outline: none; cursor: text; }
/* File Details Footer */
.file-details {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-footer-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.type-icon-small {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}
.bg-blue { background-color: #4A90E2; }
.bg-purple { background-color: #9B51E0; }
.bg-green { background-color: #27AE60; }

.file-meta {
  font-size: 12px;
  color: #5f6368;
  flex-grow: 1; /* Pushes the 3-dot menu to the far right */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3-Dot Menu Button */
.more-opts-btn {
  background: transparent;
  border: none;
  color: #5f6368;
  padding: 4px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0; /* Hidden by default like Google Docs */
  transition: opacity 0.2s, background-color 0.2s;
}

.file-card:hover .more-opts-btn {
  opacity: 1; /* Appears on card hover */
}

.more-opts-btn:hover {
  background-color: #f1f3f4;
}
/* The Ghost Button (Hidden by default) */
.ghost-action-btn {
  opacity: 0; /* Invisible */
  background: transparent;
  border: none;
  color: #9e9e9e;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, background-color 0.2s, color 0.2s;
}

/* Reveal the button when the mouse hovers over the note container */
.note-block:hover {
  background-color: #f9f9f9;
  border-color: #eee;
}

.note-block:hover .ghost-action-btn {
  opacity: 1; /* Becomes visible */
}

/* Button Hover State */
.ghost-action-btn:hover {
  background-color: rgba(74, 144, 226, 0.1);
  color: #2b70c9; /* Figma blue */
}
/* --- DISABLED CREATION CARDS --- */
.creation-card.disabled-card {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none; /* Prevents any hover effects or click events from triggering */
}
/* --- POPOVER MENUS --- */
.narra-popover {
  background-color: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 6px 0;
  display: none;
  position: absolute;
  z-index: 1000;
  min-width: 180px;
}

.popover-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  font-size: 14px;
  color: #3c4043;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
}

.popover-item:hover {
  background-color: #f1f3f4;
}

.popover-item svg {
  color: #5f6368;
}

.popover-item.delete-opt {
  color: #d93025;
}

.popover-item.delete-opt svg {
  color: #d93025;
}

.popover-divider {
  height: 1px;
  background-color: #e8eaed;
  margin: 4px 0;
}

/* --- LOCKED vs UNLOCKED TITLE INPUT --- */
.file-title-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px;
  font-size: 15px;
  font-weight: 500;
  color: #202124;
  width: 100%;
  outline: none;
  margin-bottom: 8px;
  /* When readonly, ignore clicks so the user clicks the card link instead */
  pointer-events: none; 
}

.file-title-input:not([readonly]) {
  border-color: #4A90E2;
  background: #ffffff;
  pointer-events: auto; /* Re-enable clicks for typing */
  cursor: text;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}
/* --- ANIMATED SIDEBAR BRAND --- */
.brand-link-wrapper {
  text-decoration: none;
  margin: 0 0 24px 12px;
  display: inline-block; /* Forces the container to only be as wide as the text */
}

.sidebar-brand {
  font-size: 26px;
  font-weight: 800;
  
  /* Set up the gradient: Brand Blue on the left half, Dark Gray on the right half */
  background: linear-gradient(to right, #1a73e8 50%, #202124 50%);
  background-size: 200% 100%;
  background-position: 100% 0; /* Start positioned on the dark gray side */
  
  /* Clip the background to the shape of the text */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  
  transition: background-position 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  letter-spacing: -0.5px;
  display: inline-block; /* Hugs the text tightly for hover detection */
}

.sidebar-brand:hover {
  background-position: 0 0; /* Slide the background to the blue side on hover */
}
/* --- DISABLED UI ELEMENTS --- */
.disabled-card {
  opacity: 0.4; /* Matches the 0.4 opacity of the disabled sidebar links */
  cursor: not-allowed !important;
  pointer-events: none; /* Physically prevents hover effects and clicks */
  filter: grayscale(100%); /* Desaturates the green thumbnail icon */
}

/* Ensure the disabled nav links match perfectly */
.disabled-nav {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none;
}

.coming-soon-badge {
  font-size: 10px;
  text-transform: none;
  background-color: #f1f3f4;
  color: #9aa0a6;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 500;
  letter-spacing: normal;
}