/* File: app/static/css/data-panel.css */
/* Styles for the Data Panel slide-out pane */

#data-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 340px;
  background: #1e1e1e;
  color: #ccc;
  flex-direction: column;
  z-index: 1000;
  display: flex;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 16px rgba(0,0,0,0.5);
  overflow-y: auto;
}

#data-panel.visible {
  transform: translateX(0);
}

#data-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #333;
  border-bottom: 1px solid #555;
  flex-shrink: 0;
}

#data-panel-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
#data-panel-close:hover { color: #fff; }

/* Ensure a gap between sections */
#data-body .section {
  margin-bottom: 20px; /* Adds space after each section */
}

/* Ensure the last item inside a section has some bottom padding if it's a message */
#data-body .section .loading,
#data-body .section .empty-share {
  margin-bottom: 10px;
}

#data-body {
  overflow-y: auto;
  flex: 1;
  padding: 10px 12px;
}

/* Force bottom margin on the last item inside any section */
#data-body .section > *:last-child {
  margin-bottom: 20px;
}

/* Ensure the 'Shared With Me' section header has top margin if it's the first child */
#data-body .section-label {
  margin-top: 0;
  margin-bottom: 8px;
}

/* Specific fix for the 'No folders found' or 'No single files found' messages */
#data-body .empty-share,
#data-body .empty-files,
#data-body .loading {
  margin-bottom: 20px !important; /* Force gap after these messages */
  display: block;
  padding: 6px 0;
  color: #888;
  font-style: italic;
}

/* Ensure list items don't collapse margins */
#data-body .folder-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#data-body .folder-list li {
  margin-bottom: 0; /* Individual items don't need margin if section handles it */
}

#data-body button {
  width: 100%;
  padding: 6px;
  background: #3a6ea8;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

#data-body button:hover {
  background: #4a7ec0;
}


/* ── Upload Drop Zone ───────────────────────────────────────────────────── */
#upload-dropzone {
  border: 2px dashed #555;
  border-radius: 6px;
  padding: 20px 12px;
  text-align: center;
  color: #888;
  font-size: 12px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s, background 0.2s;
  cursor: default;
}

#upload-dropzone.dragover {
  border-color: #4a9eff;
  background: #1a2a3a;
  color: #4a9eff;
}

#upload-dropzone-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

#upload-browse-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 14px;
  background: #3a6ea8;
  color: #fff;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

#upload-browse-btn:hover {
  background: #4a7ec0;
}

.share-btn, .open-btn, .copy-btn, .delete-btn, .revoke-btn, .open-gallery-btn {
  background-color: #4caf50; /* Green */
  color: #fff;               /* White text */
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  margin-left: 6px;
  transition: background-color 0.2s;
}

.share-btn:hover, .open-btn:hover, .copy-btn:hover, .delete-btn:hover, .revoke-btn:hover, .open-gallery-btn:hover {
  background-color: #43a047;
}

.dialog-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999; /* Above map and all other elements */
  justify-content: center;
  align-items: center;
}

.dialog-content {
  background: #222;
  color: #eee;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  position: relative;
}

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

.dialog-header h3 {
  margin: 0;
  font-size: 18px;
}

.dialog-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #aaa;
  cursor: pointer;
}

.dialog-close:hover {
  color: #fff;
}

.share-list-section, .share-input-section {
  margin-bottom: 16px;
}

.share-list {
  list-style: none;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
}

.share-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #444;
}

.empty-share {
  color: #888;
  font-style: italic;
}

/* Container for email input and share button */
.share-input-section .input-group {
  display: flex;
  gap: 6px; /* Small gap between input and button */
  width: 100%;
}

.share-input-section input {
  flex: 1; /* Takes remaining space */
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #333;
  color: #fff;
  font-size: 14px;
}

.share-input-section button {
  background-color: #4caf50; /* Green background */
  color: #fff;               /* White text */
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.share-input-section button:hover {
  background-color: #43a047;
}

.loading {
  color: #aaa;
  font-size: 14px;
}

/* Shared With Me Row Layout */
.shared-folder-row {
  display: flex;
  justify-content: space-between; /* Pushes items to opposite ends */
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid #333;
  margin-bottom: 2px; /* Small gap between rows */
}

/* Folder Name: Left aligned, looks like a link */
.shared-folder-name {
  color: #4caf50; /* Your app's green, or use #3498db for standard blue */
  font-weight: 600;
  cursor: pointer;
  text-decoration: none; /* No underline by default */
  transition: color 0.2s, text-decoration 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%; /* Prevents it from taking up full width */
}

.shared-folder-name:hover {
  color: #66bb6a; /* Lighter green on hover */
  text-decoration: underline; /* Underline on hover */
}

/* Owner Email: Right aligned */
.shared-folder-owner {
  color: #888;
  font-size: 12px;
  white-space: nowrap;
  text-align: right;
  margin-left: 10px; /* Small gap between name and owner */
  flex-shrink: 0; /* Prevents shrinking */
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  /* Inline styles in HTML above handle most, but you can override here */
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
