/* Basic scrollable styles compatible with ExtJS */
.responsive-card-grid-scrollable {
  overflow-y: auto \!important;
  padding: 10px \!important;
}

.x-border-layout-ct {
  overflow: visible \!important;
}

.x-panel-body-default {
  overflow: auto \!important;
}

/* Card table layout improvements */
.responsive-card-grid-scrollable .x-table-layout {
  width: 100% \!important;
  border-spacing: 15px \!important;
  border-collapse: separate \!important;
  margin: -15px \!important;
}

/* Make sure scrollbars appear when needed */
.x-panel-body {
  overflow: auto \!important;
}

/* Navigation card styles */
.navigation-card {
  background-color: #f8f9fa \!important;
  border: 1px solid #e9ecef \!important;
  cursor: pointer \!important;
}

.navigation-card .bootstrap-card-title {
  font-size: 1.1rem \!important;
  font-weight: 500 \!important;
  color: #007bff \!important;
  text-align: center \!important;
}

.navigation-card:hover {
  background-color: #e9ecef \!important;
}

/* Fix for ExtJS overflow issues */
.x-border-region-center {
  overflow: auto \!important;
}

/* Project card styles */
.bootstrap-card[filetype="project"] {
  border-left: 4px solid #4f94d2 \!important;
  background-color: #f7fafd \!important;
}

/* Search request card styles */
.search-request-info {
  margin-top: 15px;
  position: relative;
}

.search-request-meta {
  margin-bottom: 8px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.search-request-meta span {
  color: #566573;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.search-request-meta b {
  color: #2c3e50;
  text-align: right;
}

.search-string-container {
  margin-top: 15px;
  border-top: 1px solid #f2f2f2;
  padding-top: 10px;
}

.search-string-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.search-string-view-btn {
  background-color: #eaf2f8;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #2980b9;
  cursor: pointer;
}

.search-string-view-btn:hover {
  background-color: #d4e6f1;
}

.search-request-edit-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #f7f9fa;
  cursor: pointer;
}

.search-request-edit-toggle:hover {
  background-color: #e5e8e8;
}

/* Search request popup styles */
.search-string-popup,
.search-request-form-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.search-string-popup.active,
.search-request-form-popup.active {
  opacity: 1;
  visibility: visible;
}

.search-string-popup-content,
.search-request-form-container {
  width: 80%;
  max-width: 800px;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.search-string-popup.active .search-string-popup-content,
.search-request-form-popup.active .search-request-form-container {
  transform: translateY(0);
}

.search-string-popup-header,
.search-request-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.search-string-popup-header h3,
.search-request-form-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.search-string-popup-close,
.search-request-form-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #7f8c8d;
}

.search-string-popup-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #2c3e50;
  background-color: #f9f9f9;
  border-radius: 3px;
}

/* Related info section styling */
.search-request-related-section {
  margin-top: 15px;
  border-top: 1px solid #f2f2f2;
  padding-top: 10px;
}

/* Attachments section styling */
.card-attachments-section {
  margin-top: 15px;
  border-top: 1px solid #f2f2f2;
  padding-top: 12px;
  position: relative;
}

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

.attachments-header-title {
  font-weight: 500;
  color: #566573;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.attachments-header-title::before {
  content: '\f0c6'; /* FontAwesome paperclip icon */
  font-family: FontAwesome;
  font-size: 0.9rem;
  color: #4f94d2;
}

.attachment-upload-btn {
  display: inline-block;
  background-color: #eaf2f8;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #2980b9;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(41, 128, 185, 0.1);
  /* Match the search-string-view-btn style */
}

.attachment-upload-btn:hover {
  background-color: #d4e6f1;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(41, 128, 185, 0.15);
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Reduced from 8px to match card styling */
}

.attachment-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background-color: #f7fafd;
  /* Match project card background */
  border-radius: 4px;
  border: 1px solid #e9ecef;
  margin-bottom: 5px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}

.attachment-item:hover {
  background-color: #edf2f7;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.attachment-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-size: 1.2rem;
  color: #4f94d2;
  /* Match project card blue */
  width: 28px;
  height: 28px;
}

.attachment-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2c3e50;
  /* Match the metadata text color */
}

.attachment-size {
  color: #7f8c8d;
  font-size: 0.75rem;
  margin-right: 12px;
  white-space: nowrap;
}

.attachment-actions {
  display: flex;
  gap: 6px;
}

.attachment-download, .attachment-delete {
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.attachment-download {
  color: #2980b9;
  background-color: rgba(41, 128, 185, 0.08);
}

.attachment-download:hover {
  background-color: rgba(41, 128, 185, 0.15);
  transform: scale(1.1);
}

.attachment-delete {
  color: #e74c3c;
  background-color: rgba(231, 76, 60, 0.08);
}

.attachment-delete:hover {
  background-color: rgba(231, 76, 60, 0.15);
  transform: scale(1.1);
}

.attachment-empty {
  color: #95a5a6;
  font-style: italic;
  font-size: 0.85rem;
  padding: 10px;
  text-align: center;
  background-color: rgba(247, 250, 253, 0.5);
  border: 1px dashed #e9ecef;
  border-radius: 4px;
  margin: 5px 0;
}

/* Upload modal styles */
.attachment-upload-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.attachment-upload-modal.active {
  opacity: 1;
  visibility: visible;
  z-index: 9999999;
}

.attachment-upload-content {
  width: 500px;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.attachment-upload-modal.active .attachment-upload-content {
  transform: translateY(0);
}

.attachment-upload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.attachment-upload-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.attachment-upload-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #7f8c8d;
}

.attachment-upload-body {
  padding: 20px;
}

.search-request-related-item {
  margin-bottom: 10px;
}

.related-item-header {
  font-weight: 500;
  color: #566573;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 5px;
}

.related-item-content {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.related-tag {
  display: inline-block;
  background-color: #eaf2f8;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #2980b9;
}

.user-tag {
  background-color: #e8f8f5;
  color: #16a085;
}

.tag-item {
  background-color: #fef9e7;
  color: #d35400;
}

.project-links-container {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
}

.project-links-container .card-link {
  display: inline-block;
  margin: 5px;
  padding: 5px 10px;
  background-color: #f1f1f1;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.project-links-container .card-link:hover {
  background-color: #e1e1e1;
}

.card-link-count {
  display: inline-block;
  background: #4f94d2;
  color: white;
  border-radius: 20px;
  padding: 1px 6px;
  font-size: 0.8em;
  margin-left: 5px;
}

/* Search request metadata editing styles */
.metadata-form .x-form-item-label-text {
  font-weight: 500;
  color: #2c3e50;
}

.metadata-form .x-form-text {
  padding: 8px;
  border-radius: 4px;
}

.metadata-form .x-btn-default-small {
  background-color: #3498db;
  border-color: #2980b9;
  padding: 10px 15px;
}

.metadata-form .x-btn-default-small .x-btn-inner {
  color: white;
  font-weight: 500;
}

.metadata-form .x-btn-default-small:hover {
  background-color: #2980b9;
}

/* Animation for the notification */
.notification {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
