:root {
  --drive-bg: #f8fafd;
  --header-bg: #f8fafd;
  --search-bg: #e9eef6;
  --search-focus-bg: #ffffff;
  --sidebar-bg: #f8fafd;
  --primary-blue: #0b57d0;
  --primary-blue-hover: #0842a0;
  --btn-new-bg: #c2e7ff;
  --btn-new-hover: #b3e1ff;
  --item-bg: #ffffff;
  --item-hover: #f1f5f9;
  --item-active: #c2e7ff;
  --text-main: #1f1f1f;
  --text-sub: #444746;
  --border-color: #e0e3e7;
  --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --shadow-md: 0 4px 8px 0 rgba(0,0,0,0.14), 0 1px 14px 0 rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
  --font-family: 'Google Sans', 'Roboto', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--drive-bg);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* HEADER BAR */
.drive-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  user-select: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}

.icon-btn {
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-sub);
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.drive-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.logo-text {
  font-size: 22px;
  font-weight: 500;
  color: #444746;
}

.header-search {
  flex: 1;
  max-width: 720px;
  padding: 0 16px;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: var(--search-bg);
  height: 48px;
  border-radius: 24px;
  padding: 0 16px;
  gap: 12px;
  transition: background 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  background-color: var(--search-focus-bg);
  box-shadow: var(--shadow-sm);
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-main);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b57d0, #34a853);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* MAIN APP CONTAINER */
.app-container {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* SIDEBAR */
.drive-sidebar {
  width: 256px;
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 16px;
  user-select: none;
  transition: margin-left 0.25s ease;
}

.drive-sidebar.collapsed {
  margin-left: -256px;
}

.new-btn-wrapper {
  position: relative;
}

.btn-new {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--btn-new-bg);
  color: #041e49;
  border: none;
  padding: 16px 24px 16px 20px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-new:hover {
  background-color: var(--btn-new-hover);
  box-shadow: var(--shadow-md);
}

.btn-new .icon-add {
  font-size: 28px;
}

.new-dropdown-menu {
  position: absolute;
  top: 64px;
  left: 0;
  width: 220px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  display: none;
  z-index: 100;
}

.new-dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background-color: var(--item-hover);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 6px 0;
}

/* SIDEBAR NAV */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  color: var(--text-sub);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}

.nav-item:hover {
  background-color: var(--item-hover);
}

.nav-item.active {
  background-color: #c2e7ff;
  color: #001d35;
}

/* STORAGE WIDGET */
.storage-widget {
  margin-top: auto;
  padding: 16px;
  background-color: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.storage-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
}

.storage-bar {
  height: 6px;
  background-color: #e9eef6;
  border-radius: 3px;
  overflow: hidden;
}

.storage-progress {
  height: 100%;
  background: linear-gradient(90deg, #0b57d0, #34a853);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.storage-subtext {
  font-size: 11px;
  color: #64748b;
}

/* WORKSPACE */
.drive-workspace {
  flex: 1;
  background-color: #ffffff;
  margin: 8px 16px 16px 0;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.workspace-toolbar {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  user-select: none;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 500;

}

.breadcrumb-item {
  cursor: pointer;
  color: var(--text-sub);
}

.breadcrumb-item:hover {
  color: var(--primary-blue);
}

.breadcrumb-item.active {
  color: var(--text-main);
  font-weight: 700;
  cursor: default;
}

.filter-pills {
  display: flex;
  gap: 8px;
}

.pill-btn {
  background-color: var(--search-bg);
  border: none;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: background 0.15s;
}

.pill-btn:hover {
  background-color: #dbe4f0;
}

.pill-btn.active {
  background-color: #c2e7ff;
  color: #001d35;
}

/* CONTENT SCROLLABLE AREA */
.content-scrollable {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  position: relative;
}

/* DROPZONE OVERLAY */
.dropzone-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 87, 208, 0.85);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.dropzone-overlay.drag-active {
  display: flex;
}

.dropzone-box {
  background-color: #ffffff;
  padding: 40px 60px;
  border-radius: 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.drop-icon {
  font-size: 64px;
  color: var(--primary-blue);
}

/* GRID & LIST SECTIONS */
.items-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.items-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* DRIVE ITEM CARD */
.drive-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  user-select: none;
}

.drive-card:hover {
  background-color: var(--item-hover);
  border-color: #c0c7d0;
  box-shadow: var(--shadow-sm);
}

.drive-card.selected {
  background-color: #c2e7ff;
  border-color: var(--primary-blue);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-icon {
  font-size: 28px;
  color: var(--primary-blue);
}

.item-icon.folder {
  color: #ffba00;
}

.item-icon.image { color: #ea4335; }
.item-icon.video { color: #e37400; }
.item-icon.audio { color: #a142f4; }
.item-icon.pdf { color: #d93025; }
.item-icon.document { color: #1a73e8; }

.star-icon {
  font-size: 20px;
  color: #cbd5e1;
  cursor: pointer;
}

.star-icon.starred {
  color: #f59e0b;
  font-variation-settings: 'FILL' 1;
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  justify-content: space-between;
}

/* LIST VIEW OVERRIDES */
.items-grid.list-view .drive-card {
  flex-direction: row;
  align-items: center;
  padding: 10px 16px;
  gap: 16px;
}

.items-grid.list-view .card-top {
  width: auto;
}

.items-grid.list-view .card-title {
  flex: 1;
}

.items-grid.list-view .card-meta {
  width: 200px;
  text-align: right;
}

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 320px;
  color: var(--text-sub);
  gap: 12px;
  text-align: center;
}

.empty-illustration span {
  font-size: 72px;
  color: #cbd5e1;
}

/* CONTEXT MENU */
.context-menu {
  position: fixed;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  width: 200px;
  z-index: 1000;
  display: none;
}

.menu-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-main);
}

.menu-option:hover {
  background-color: var(--item-hover);
}

.menu-option.danger {
  color: #d93025;
}

.menu-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.show {
  display: flex;
}

.modal-card {
  background-color: #ffffff;
  border-radius: 20px;
  padding: 24px;
  width: 400px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-title {
  font-size: 20px;
  font-weight: 500;
}

.modal-input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
}

.modal-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(11, 87, 208, 0.2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-flat {
  background: transparent;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-blue);
  cursor: pointer;
}

.btn-flat:hover {
  background-color: rgba(11, 87, 208, 0.08);
}

.btn-primary {
  background-color: var(--primary-blue);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--primary-blue-hover);
}

/* PREVIEW MODAL */
.preview-backdrop {
  flex-direction: column;
  background: rgba(0, 0, 0, 0.9);
}

.preview-header {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  color: white;
}

.preview-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 500;
}

.preview-header-actions {
  display: flex;
  gap: 16px;
}

.icon-btn-white {
  background: transparent;
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.icon-btn-white:hover {
  background: rgba(255, 255, 255, 0.15);
}

.preview-body {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.preview-body img, .preview-body video {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.preview-body audio {
  width: 450px;
}

.preview-body iframe {
  width: 85vw;
  height: 80vh;
  border: none;
  border-radius: 12px;
  background: white;
}

.preview-text-box {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 24px;
  border-radius: 12px;
  width: 80vw;
  max-height: 80vh;
  overflow-y: auto;
  font-family: monospace;
  white-space: pre-wrap;
  font-size: 14px;
}

/* UPLOAD TOAST */
.upload-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #323232;
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: 10px;
  width: 320px;
  z-index: 3000;
}

.upload-toast.show {
  display: flex;
}

.toast-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
}

.toast-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
}

.toast-progress-fill {
  height: 100%;
  background-color: #34a853;
  transition: width 0.2s ease;
}
