/* Filevine Document Viewer - Popup Styles */

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --success: #34a853;
  --warning: #fbbc04;
  --error: #ea4335;
  --gray-100: #f8f9fa;
  --gray-200: #e8eaed;
  --gray-300: #dadce0;
  --gray-500: #9aa0a6;
  --gray-700: #5f6368;
  --gray-900: #202124;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

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

body {
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--gray-900);
  background: white;
  width: 360px;
  min-height: 400px;
  max-height: 600px;
  overflow: hidden;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 600px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-100);
}

.header h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

/* Status Indicator */
.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-700);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-500);
}

.status.connected .status-dot {
  background: var(--success);
}

.status.disconnected .status-dot {
  background: var(--gray-500);
}

.status.error .status-dot {
  background: var(--error);
}

/* Panels */
.panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.panel.hidden {
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.panel-header h2 {
  font-size: 14px;
  font-weight: 600;
}

.panel-content {
  text-align: center;
  padding: 40px 20px;
}

.panel-content .message {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.panel-content .hint {
  font-size: 13px;
  color: var(--gray-700);
}

/* Org Selector */
.selector {
  margin-bottom: 16px;
}

.selector label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.selector select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

/* Browser */
.browser {
  display: flex;
  flex-direction: column;
}

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-bar input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 14px;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

.breadcrumb .separator {
  color: var(--gray-500);
}

.breadcrumb .folder-breadcrumb {
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  border: none;
  background: none;
  font-size: 14px;
}

.breadcrumb .folder-breadcrumb:hover {
  text-decoration: underline;
}

.project-name {
  font-weight: 500;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Lists */
.list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--gray-100);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.list-item:hover {
  background: var(--gray-200);
}

.list-item.selected {
  background: #e8f0fe;
  border: 1px solid var(--primary);
}

.list-item .icon {
  font-size: 18px;
  flex-shrink: 0;
}

.list-item .info {
  flex: 1;
  min-width: 0;
}

.list-item .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item .meta {
  font-size: 12px;
  color: var(--gray-700);
}

.list-item .actions {
  display: flex;
  gap: 4px;
}

.list-item.folder-item {
  cursor: pointer;
}

.list-item.folder-item:hover {
  background: var(--gray-200);
}

.action-btn.secondary {
  background: var(--gray-300);
  color: var(--gray-900);
  padding: 4px 8px;
  font-size: 12px;
}

.action-btn.secondary:hover {
  background: var(--gray-400);
}

.list .loading,
.list .empty {
  text-align: center;
  padding: 20px;
  color: var(--gray-700);
}

/* Download Items */
.download-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--gray-100);
  border-radius: 6px;
}

.download-item .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.download-item .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-item .status {
  font-size: 12px;
  color: var(--gray-700);
}

.download-item .status.complete {
  color: var(--success);
}

.download-item .status.error {
  color: var(--error);
}

.progress-bar {
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

/* Buttons */
.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--gray-100);
}

.text-btn {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}

.text-btn:hover {
  text-decoration: underline;
}

.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.action-btn.primary {
  background: var(--primary);
  color: white;
}

.action-btn.primary:hover {
  background: var(--primary-dark);
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-100);
}

.footer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
}

.footer-btn:hover {
  color: var(--gray-900);
}

.badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
}

.badge.hidden {
  display: none;
}

/* Utility */
.hidden {
  display: none !important;
}

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

.list::-webkit-scrollbar-track {
  background: transparent;
}

.list::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.list::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}
