/*
 * Admin-specific styles
 * Includes folder management, document handling, and admin interface elements
 */

/* Folder actions container layout */
.folder-actions-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

/* Folder create button */
.folder-create-button {
  display: flex;
  align-items: center;
}

.folder-create-button .button {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
  white-space: nowrap;
}

.folder-icon {
  font-size: 1.1rem;
}

/* Dropzone styling */
.dropzone {
  border: 2px dashed var(--prof-border);
  border-radius: var(--prof-border-radius);
  background-color: var(--prof-surface);
  box-shadow: var(--prof-shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
  text-align: center;
  flex-grow: 1;
}

/* Compact dropzone */
.dropzone.compact {
  min-height: 0;
  padding: 0.75rem 1rem;
}

.dropzone-compact-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.dropzone-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Style for the dropzone button */
.dropzone-clickable.outline {
  margin: 0;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.dropzone:hover {
  background-color: var(--prof-primary-light);
  border-color: var(--prof-primary);
  box-shadow: var(--prof-shadow);
}

.dropzone.dz-drag-hover {
  background-color: var(--prof-primary-light);
  border-color: var(--prof-primary);
  box-shadow: var(--prof-shadow-md);
}

.dropzone-message {
  font-weight: 600;
  color: var(--prof-text);
  margin: 0;
  font-size: 1rem;
  white-space: nowrap;
  margin-bottom: 0.5rem;
}

.dropzone-instruction {
  color: var(--prof-text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.dropzone-icon {
  font-size: 2rem;
  color: var(--prof-primary);
  margin-bottom: 1rem;
}

.dz-preview {
  display: none;  /* Hide the default dropzone preview */
}

.file-info {
  background-color: var(--prof-white);
  border: 1px solid var(--prof-border-light);
  border-radius: var(--prof-border-radius);
  box-shadow: var(--prof-shadow-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
}

.file-info:hover {
  box-shadow: var(--prof-shadow);
}

.file-icon {
  font-size: 1.5rem;
  color: var(--prof-primary);
  margin-right: 0.75rem;
}

.file-name {
  font-weight: 600;
  color: var(--prof-text);
  flex-grow: 1;
}

.file-size {
  color: var(--prof-text-muted);
  font-size: 0.875rem;
}

.dz-filename {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.dz-size {
  color: #777;
  font-size: 0.8rem;
}

.dz-progress {
  height: 10px;
  background: #f0f0f0;
  margin: 0.5rem 0;
  border-radius: 4px;
  overflow: hidden;
}

.dz-upload {
  background: #4CAF50;
  height: 100%;
  display: block;
  width: 0;
  transition: width 0.3s;
}

.dz-success-mark, .dz-error-mark {
  text-align: center;
  font-weight: bold;
  display: none;
}

.dz-success .dz-success-mark {
  display: block;
  color: #4CAF50;
}

.dz-error .dz-error-mark {
  display: block;
  color: #f44336;
}

.dz-error-message {
  color: #f44336;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: none;
}

.dz-error .dz-error-message {
  display: block;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.preview-container {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: 8px;
  background: white;
  width: 100%;
}

.preview-container h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.preview-content {
  margin-bottom: 1rem;
}

.file-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 400px;
}

.preview-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Dashboard card styles */
.dashboard-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background-color: var(--prof-surface-elevated);
}

.dashboard-card:nth-child(odd) {
  background-color: var(--prof-surface-elevated);
}

.dashboard-card:nth-child(even) {
  background-color: var(--prof-surface);
}

.dashboard-card:nth-child(3n) {
  background-color: var(--prof-gray-50);
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--prof-shadow-lg);
}

.dashboard-card::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 8px;
  height: 8px;
  background-color: var(--prof-primary);
  border-radius: 50%;
  opacity: 0.6;
}

.unit-breakdown {
  list-style-type: none;
  padding-left: 1rem;
  margin: 0.5rem 0 1rem;
}

.unit-breakdown li {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
}

.unit-breakdown li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--prof-primary);
  margin-right: 8px;
}

/* Document search results styling */
.document-search-results {
  max-height: 300px;
  overflow-y: auto;
}

.search-results {
  position: relative;
}

.selected-document {
  padding: 8px 12px;
  margin: 0;
  border-radius: 0.25rem;
  font-weight: 500;
  background-color: #effaf5;
  border: 1px solid #48c78e;
}

/* Drag and drop styles for sortable agenda items */
.is-dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.drag-before {
  border-top: 2px solid #3273dc;
}

.drag-after {
  border-bottom: 2px solid #3273dc;
}

/* Edge drag indicators for table borders */
.table.drag-edge-top thead th {
  border-bottom-color: #3273dc;
  border-bottom-width: 4px;
}

.table.drag-edge-bottom {
  border-bottom-color: #3273dc;
  border-bottom-width: 4px;
}

/* Hover effect for sortable rows */
[data-sortable-target="item"]:hover {
  background-color: #f5f5f5;
}

/* Grab cursor styling */
[data-sortable-target="item"] {
  transition: all 0.2s ease;
}

[data-sortable-target="item"]:hover {
  background-color: #f8f9fa;
}

/* Navbar Styling */
.navbar {
  background-color: var(--prof-white);
  border-bottom: 1px solid var(--prof-border-light);
  box-shadow: var(--prof-shadow-sm);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand .navbar-item {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--prof-primary);
  letter-spacing: -0.025em;
}

.navbar-item {
  font-weight: 500;
  color: var(--prof-text);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.navbar-item:hover {
  background-color: var(--prof-hover-bg);
  color: var(--prof-text);
}

.navbar-item.is-active {
  color: var(--prof-primary);
  background-color: var(--prof-primary-light);
}

/* Dropdown Styling */
.navbar-dropdown, .dropdown-menu {
  border-radius: var(--prof-border-radius);
  box-shadow: var(--prof-shadow-lg);
  border: 1px solid var(--prof-border-light);
  background-color: var(--prof-white);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.navbar-dropdown .navbar-item,
.dropdown-item {
  padding: 0.75rem 1rem;
  font-weight: 400;
  color: var(--prof-text);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.navbar-dropdown .navbar-item:hover,
.dropdown-item:hover {
  background-color: var(--prof-hover-bg);
  color: var(--prof-text);
}

.navbar-dropdown .navbar-item.is-active,
.dropdown-item.is-active {
  background-color: var(--prof-primary);
  color: white;
}

.navbar-divider,
.dropdown-divider {
  border-top: 1px solid var(--prof-border-light);
  margin: 0.5rem 0;
}

/* Mobile navbar fixes */
@media (max-width: 1023px) {
  /* Ensure navbar has proper z-index */
  nav.navbar {
    position: relative;
    z-index: 40;
  }

  /* Ensure navbar menu is properly positioned */
  .navbar-menu {
    position: relative;
    z-index: 41;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }

  /* Fix dropdown behavior on mobile - disable hover, use click only */
  .navbar-item.has-dropdown:hover .navbar-dropdown {
    display: none;
  }
  
  .navbar-item.has-dropdown.is-active .navbar-dropdown {
    display: block !important;
    position: static !important;
    box-shadow: none;
    border-top: 1px solid #e8e8e8;
    margin-top: 0;
    width: 100%;
    left: auto !important;
    right: auto !important;
    top: auto !important;
  }

  /* Ensure dropdowns are hidden by default on mobile */
  .navbar-item.has-dropdown .navbar-dropdown {
    display: none;
    position: static;
  }

  /* Make navbar items stack vertically on mobile when menu is open */
  .navbar-menu.is-active {
    display: flex;
    flex-direction: column;
  }

  .navbar-menu.is-active .navbar-item.has-dropdown {
    width: 100%;
  }

  .navbar-menu.is-active .navbar-item.has-dropdown.is-active {
    display: flex;
    flex-direction: column;
  }

  /* Fix any full-width layouts conflicting with navbar */
  .folder-page-layout {
    position: relative;
    z-index: 1;
  }
}

/* Desktop hover behavior - only on larger screens */
@media (min-width: 1024px) {
  .navbar-item.has-dropdown:hover .navbar-dropdown {
    display: block;
  }
}

/* Navbar Dropdown Styling */
.navbar-item.has-dropdown {
  position: relative;
}

.navbar-link {
  font-weight: 500;
  position: relative;
  border-bottom: none !important;
  padding-bottom: 0.5rem !important;
  color: var(--prof-text);
}

.navbar-link::after {
  border: 2px solid var(--prof-gray-400);
  border-right: 0;
  border-top: 0;
  content: " ";
  display: block;
  height: 0.4em;
  pointer-events: none;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
  width: 0.4em;
  transition: transform 0.15s ease;
}

.navbar-item.has-dropdown:hover .navbar-link::after {
  transform: translateY(-50%) rotate(135deg);
}

.navbar-dropdown .navbar-subfolder {
  padding-left: 2rem !important;
  font-size: 0.9rem;
  color: var(--prof-text-muted);
  position: relative;
}

.navbar-dropdown .navbar-subfolder:hover {
  background-color: var(--prof-hover-bg) !important;
  color: var(--prof-text);
  padding-left: 2.25rem !important;
}

/* Generic Dropdown Styling */
.dropdown {
  position: relative;
}

.dropdown-trigger .button {
  position: relative;
}

.dropdown-trigger .button::after {
  border: 2px solid var(--prof-gray-400);
  border-right: 0;
  border-top: 0;
  content: " ";
  display: block;
  height: 0.5em;
  pointer-events: none;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
  width: 0.5em;
  transition: transform 0.15s ease;
}

.dropdown.is-active .dropdown-trigger .button::after {
  transform: translateY(-50%) rotate(135deg);
}

.dropdown-trigger .button.is-primary::after,
.dropdown-trigger .button.is-info::after,
.dropdown-trigger .button.is-success::after,
.dropdown-trigger .button.is-danger::after {
  border-color: white;
}

/* Folder Page Layout */
.folder-page-layout {
  display: flex;
  min-height: 100vh;
  position: fixed;
  left: 280px;
  top: 0;
  right: 0;
  bottom: 0;
  width: calc(100vw - 280px);
}

.folder-tree-column {
  width: 180px;
  flex-shrink: 0;
}

.folder-content-column {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* Mobile responsive - hide sidebar completely */
@media (max-width: 768px) {
  .folder-page-layout {
    display: block;
    position: static;
    left: auto;
    right: auto;
    margin-left: 0;
    margin-right: 0;
    width: auto;
    min-height: auto;
  }

  .folder-tree-column {
    display: none !important;
  }

  .folder-content-column {
    max-width: none;
    padding: 1rem;
    width: 100%;
  }
}

/* Tablet responsive - still hide on medium screens */
@media (max-width: 1023px) {
  .folder-tree-column {
    display: none;
  }

  .folder-content-column {
    max-width: none;
    padding: 1rem;
    width: 100%;
  }

  .folder-page-layout {
    display: block;
    position: static;
    left: auto;
    right: auto;
    margin-left: 0;
    margin-right: 0;
    width: auto;
    min-height: auto;
  }
}

.icon-cell {
  text-align: center;
  width: 2rem;
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
}

/* Folder Tree Styling */
.folder-tree-sidebar {
  height: 100vh;
  background-color: #ffffff;
  border-right: 1px solid var(--prof-border);
  overflow-y: auto;
  position: sticky;
  top: 0;
  z-index: 500;
}

.folder-tree-container {
  padding: 0.5rem;
}

.folder-tree-node {
  margin-bottom: 0.1rem;
}

.folder-tree-item {
  border-radius: var(--prof-border-radius-sm);
  transition: all 0.1s ease;
}

.folder-tree-item:hover {
  background-color: #f5f5f5;
}

.folder-tree-item.is-current {
  background-color: #f5f5f5;
  font-weight: 600;
}

.folder-tree-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.folder-link {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  text-decoration: none;
  color: var(--prof-text);
  border-radius: var(--prof-border-radius-sm);
  flex: 1;
  font-weight: 500;
  transition: all 0.1s ease;
  border-bottom: none !important;
}

.folder-link:hover {
  color: var(--prof-text);
  text-decoration: none;
  background-color: var(--prof-hover-bg);
}

.folder-link.is-active {
  color: var(--prof-text);
  background-color: var(--prof-primary-light);
  font-weight: 600;
}

.folder-tree-toggle {
  display: none;
}

.folder-tree-spacer {
  display: none;
}

.folder-tree-children {
  margin-left: 0.5rem;
  margin-top: 0.1rem;
}

.folder-tree-children.is-hidden {
  display: none;
}

.folder-name {
  margin-left: 0.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-tree-item .icon svg {
  color: var(--prof-text-muted);
  width: 0.875rem;
  height: 0.875rem;
}

.folder-tree-item.document {
  margin-left: 0.5rem;
}

.folder-tree-item.document .folder-name {
  font-size: 0.75rem;
  color: var(--prof-text-muted);
}

/* File List Styling */
.file-list-item {
  color: var(--prof-text) !important;
  text-decoration: none;
  transition: color 0.15s ease;
}

.file-list-item:hover {
  color: var(--prof-primary) !important;
  text-decoration: none;
}

.icon-cell .icon svg {
  color: var(--prof-text-muted) !important;
  width: 1rem;
  height: 1rem;
  vertical-align: middle;
}

/* Compact table buttons */
.table .buttons.are-small .button {
  padding: 0.25rem 0.5rem;
  height: auto;
  min-height: 1.75rem;
}

/* Icon Styling */
.fas, .fa, .far, .fab {
  transition: all 0.15s ease;
}

.icon-cell .fas, 
.icon-cell .fa, 
.icon-cell .far, 
.icon-cell .fab, 
.dropzone-icon .fas,
.dropzone-icon .fa {
  font-size: 1.2rem;
  color: var(--prof-primary);
}

.button .fas, .button .fa, .button .far, .button .fab {
  font-size: 1rem;
}

/* Login Form Styling */
.box.login-form {
  border: 1px solid var(--prof-border-light);
  box-shadow: var(--prof-shadow-md);
  border-radius: var(--prof-border-radius);
  padding: 2rem;
  background-color: var(--prof-surface-elevated);
}

.login-form .title {
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  color: var(--prof-text);
}

.login-form .title::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  height: 3px;
  width: 40%;
  background-color: var(--prof-primary);
  border-radius: var(--prof-border-radius-sm);
}

/* Breadcrumb */
.breadcrumb {
  font-weight: 400;
}

.breadcrumb a {
  color: var(--prof-text-muted);
  text-decoration: none;
  border-bottom: none;
}

.breadcrumb a:hover {
  color: var(--prof-primary);
}

.breadcrumb li.is-active a {
  color: var(--prof-text);
  font-weight: 500;
}

/* Breadcrumb Fix */
.breadcrumb li + li {
  margin-top: 0;
}

/* Section Styling */
.section {
  position: relative;
}

.section::after {
  content: "";
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: var(--prof-primary);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.1;
}

/* Utility Class Extensions */
.neo-tilt {
  transform: rotate(-0.5deg);
  transition: transform 0.2s ease;
}

.neo-tilt-reverse {
  transform: rotate(0.5deg);
  transition: transform 0.2s ease;
}