/* EasyDoc Frontend Styles */

/* Base Wrapper */
.easydoc-wrapper {
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-xl, 12px);
  border: 1px solid var(--Colors-Border-border-secondary, #e9eaeb);
  background: var(--Colors-Background-bg-primary, #fff);
  box-shadow: 0 1px 2px 0
    var(--Colors-Effects-Shadows-shadow-xs, rgba(10, 13, 18, 0.05));
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Folder Header */

.easydoc-folder-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.easydoc-search-form {
  display: flex;
  gap: 10px;
  max-width: 400px;
  border: 1px solid #eee;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 1px 12px;
  overflow: hidden;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--Colors-Border-border-primary, #d5d7da);
  background: var(--Colors-Background-bg-primary, #fff);
  box-shadow: 0 1px 2px 0
    var(--Colors-Effects-Shadows-shadow-xs, rgba(10, 13, 18, 0.05));
}

.easydoc-search-form .easydoc-search-input {
  flex: 1;
  border-radius: 4px;
  font-size: 14px;
  border: none;
  padding-right: 0px;
  padding-left: 0px;
}

.easydoc-search-form .easydoc-search-input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 1px transparent;
}

.easydoc-search-btn {
  padding: 10px 20px;
  background: #0073aa;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.easydoc-search-btn:hover {
  background: #005a87;
}

.easydoc-download-all-btn {
  padding: 10px 20px;
  background: #00a32a;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
  box-shadow: none;
}

.easydoc-download-all-btn:hover {
  background: #008a20;
}

.easydoc-download-all-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Grid Layout */
.easydoc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
  padding: 0 24px;
  border-top: 1px solid var(--Colors-Border-border-secondary, #e9eaeb);
  padding-top: 20px;
}

.easydoc-grid-item {
  transition: box-shadow 0.2s, transform 0.2s;
  border-radius: var(--radius-xl, 12px);
  border: 1px solid var(--Colors-Border-border-secondary, #e9eaeb);
  background: var(--Colors-Background-bg-primary, #fff);
  box-shadow: 0 1px 2px 0
    var(--Colors-Effects-Shadows-shadow-xs, rgba(10, 13, 18, 0.05));
}

.easydoc-grid-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.easydoc-file-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 15px;
  color: white;
}

.easydoc-file-icon.pdf {
  background: #e74c3c;
}
.easydoc-file-icon.doc,
.easydoc-file-icon.docx {
  background: #3498db;
}
.easydoc-file-icon.xls,
.easydoc-file-icon.xlsx {
  background: #27ae60;
}
.easydoc-file-icon.ppt,
.easydoc-file-icon.pptx {
  background: #e67e22;
}
.easydoc-file-icon.zip,
.easydoc-file-icon.rar {
  background: #9b59b6;
}
.easydoc-file-icon.jpg,
.easydoc-file-icon.jpeg,
.easydoc-file-icon.png,
.easydoc-file-icon.gif {
  background: #f39c12;
}
.easydoc-file-icon.mp4,
.easydoc-file-icon.avi,
.easydoc-file-icon.mov {
  background: #e74c3c;
}
.easydoc-file-icon.mp3,
.easydoc-file-icon.wav {
  background: #9b59b6;
}
.easydoc-file-icon.txt {
  background: #7f8c8d;
}

.easydoc-file-icon img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}

.easydoc-file-name {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 10px 0;
  line-height: 1.4;
  color: #2c3e50;
}

.easydoc-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  color: var(--colors-text-text-tertiary-600, #535862);
  font-family: var(--Font-family-font-family-body, Inter);
  font-size: var(--Font-size-text-sm, 14px);
  font-style: normal;
  font-weight: 400;
  line-height: var(--Line-height-text-sm, 20px); /* 142.857% */
}

.easydoc-file-meta span {
  display: flex;
  align-items: center;
}

.easydoc-file-actions {
  display: flex;
}

.easydoc-view-btn,
.easydoc-download-btn {
  padding: 10px 12px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--colors-text-text-tertiary-600, #535862);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--Colors-Border-border-primary, #e9eaeb);
}

.easydoc-view-btn {
  border-radius: 12px 0 0 12px;
  border-right: 0px solid var(--Colors-Border-border-primary, #e9eaeb);
  background: var(--Colors-Background-bg-primary, #fff);
}

.easydoc-view-btn:hover {
  background: var(--easydoc-primary-color);
  border-color: var(--easydoc-primary-color);
  color: #ffffff;
  text-decoration: none;
}

.easydoc-download-btn {
  border-radius: 0 12px 12px 0;
  border-right: 1px solid var(--Colors-Border-border-primary, #d5d7da);
  background: var(--Colors-Background-bg-primary, #fff);
}

.easydoc-download-btn:hover {
  background: var(--easydoc-primary-color);
  border-color: var(--easydoc-primary-color);
  color: #ffffff;
}

/* Tooltips */
.easydoc-view-btn,
.easydoc-download-btn {
  position: relative;
}

.easydoc-view-btn:hover::after,
.easydoc-download-btn:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  animation: easydoc-tooltip-fade-in 0.2s ease-out;
}

.easydoc-view-btn:hover::before,
.easydoc-download-btn:hover::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  z-index: 1001;
  animation: easydoc-tooltip-fade-in 0.2s ease-out;
}

@keyframes easydoc-tooltip-fade-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Table Layout */
.easydoc-table-wrapper {
  background: white;
}

.easydoc-files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: none;
  margin-block-end: 0px;
}

.easydoc-files-table th {
  padding: 13px 24px;
  text-align: left;
  color: #495057;
  border: none;
  position: relative;
  color: var(--colors-text-text-quaternary-500, #717680);
  font-family: var(--Font-family-font-family-body, Inter);
  font-size: var(--Font-size-text-xs, 12px);
  font-style: normal;
  font-weight: 600;
  line-height: var(--Line-height-text-xs, 18px); /* 150% */
  border-bottom: 1px solid var(--Colors-Border-border-secondary, #e9eaeb);
}

.easydoc-files-table th.easydoc-sortable {
  cursor: pointer;
  user-select: none;
}

.easydoc-files-table th.easydoc-sortable:hover {
  color: #333;
  transition: color 0.2s ease;
}

.easydoc-sort-indicator {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
}

.easydoc-sort-indicator.asc {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid #495057;
}

.easydoc-sort-indicator.desc {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #495057;
}

.easydoc-files-table td {
  padding: 13px 24px;
  border: none;
  background-color: #fff;
  color: var(--colors-text-text-tertiary-600, #535862);
  font-family: var(--Font-family-font-family-body, Inter);
  font-size: var(--Font-size-text-sm, 14px);
  font-style: normal;
  font-weight: 400;
  vertical-align: middle;
  border-bottom: 1px solid var(--Colors-Border-border-secondary, #e9eaeb);
  line-height: var(--Line-height-text-sm, 20px); /* 142.857% */
}

table tbody > tr:nth-child(odd) > td,
table tbody > tr:nth-child(odd) > th {
  background-color: #fff;
}

table thead:first-child tr:first-child th {
  border-block-start: 1px solid var(--Colors-Border-border-secondary, #e9eaeb);
}

.easydoc-file-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

table tbody tr:hover > td,
table tbody tr:hover > th {
  background-color: #f8f9fa;
  transition: background-color 0.2s ease;
}

.easydoc-file-name-cell .easydoc-file-icon {
  width: 32px;
  height: 32px;
  font-size: 10px;
  margin: 0;
  flex-shrink: 0;
  background: none;
  border-radius: 4px;
  overflow: hidden;
}

.easydoc-file-name-cell .easydoc-file-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.easydoc-file-name-cell .easydoc-file-name {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

/* Block Layout */
.easydoc-blocks {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.easydoc-block {
  background: white;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.easydoc-block:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.easydoc-block-header {
  background: #f8f9fa;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid #e1e1e1;
}

.easydoc-block-header .easydoc-file-icon {
  margin: 0;
}

.easydoc-block-header .easydoc-file-name {
  margin: 0;
  font-size: 18px;
}

.easydoc-block-content {
  padding: 20px;
}

.easydoc-meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}

.easydoc-meta-label {
  font-weight: 600;
  color: #495057;
  min-width: 100px;
}

.easydoc-meta-value {
  color: #6c757d;
}

.easydoc-block-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f1f3f4;
}

/* No Files Message */
.easydoc-no-files {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.easydoc-no-files p {
  margin: 0;
  font-size: 16px;
}

/* Pagination */
.easydoc-pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 20px;
}

.easydoc-page-btn {
  padding: 8px 12px;
  background: white;
  border: 1px solid #dee2e6;
  color: #495057;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.easydoc-page-btn:hover {
  background: #e9ecef;
}

.easydoc-page-btn.active {
  background: #0073aa;
  border-color: #0073aa;
  color: white;
}

/* Lightbox */
.easydoc-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.easydoc-lightbox-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.easydoc-lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  z-index: 10000;
}

/* Search Highlighting */
mark {
  background: #fff3cd;
  padding: 0 2px;
  border-radius: 2px;
}

/* Error Messages */
.easydoc-error {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 16px;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin: 10px 0;
  font-size: 14px;
}

/* Loading States */
.easydoc-loading {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.easydoc-loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #0073aa;
  border-radius: 50%;
  animation: easydoc-spin 1s linear infinite;
  margin-left: 10px;
}

.easydoc-folder-header {
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 20px 24px;
  gap: 20px;
}

@media screen and (max-width: 768px) {
  .easydoc-folder-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 4px;
  }
  .easydoc-folder-header__right {
    flex-direction: column;
    width: 100%;
    margin-top: 20px;
  }

  .easydoc-folder-header__right .easydoc-download-all-wrapper,
  .easydoc-folder-header__right .easydoc-download-all-wrapper button {
    width: 100%;
  }
}

.easydoc-folder-header h3 {
  flex: 1;
  padding: 0;
}

.easydoc-folder-header__title {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.easydoc-folder-header__title p.easydoc-folder-description {
  padding: 0;
  margin: 0;
}

.easydoc-folder-header__right {
  display: flex;
  gap: 10px;
}

.easydoc-folder-header__right .easydoc-download-all-btn {
  display: flex;
  padding: 10px 14px;
  justify-content: center;
  align-items: center;
  height: 42px;
  gap: var(--spacing-xs, 4px);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--Colors-Border-border-primary, #e9eaeb);
  background: var(--Colors-Background-bg-primary, #fff);
  color: var(--colors-text-text-secondary-700, #414651);
  font-family: var(--Font-family-font-family-body, Inter);
  font-size: var(--Font-size-text-sm, 14px);
  font-style: normal;
  font-weight: 600;
  line-height: var(--Line-height-text-sm, 20px); /* 142.857% */
  box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
}

.easydoc-folder-header__right .easydoc-download-all-btn:hover {
  background: var(--easydoc-primary-color);
  border-color: var(--easydoc-primary-color);
  color: #ffffff;
}

.easydoc-file-info {
  display: flex;
  padding: 17px 24px;
  justify-content: space-between;
  align-items: center;
}

.easydoc-file-icon-content {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--Colors-Border-border-secondary, #e9eaeb);
}

.easydoc-file-icon-content-icon {
  flex-shrink: 0;
}

.easydoc-file-icon-content-icon img {
  display: block;
  max-width: 100%;
  height: auto;
}

.easydoc-file-icon-content-inner {
  flex: 1;
  min-width: 0;
}

.easydoc-file-icon-content p {
  margin-bottom: 0;
  color: var(--colors-text-text-primary-900, #181d27);
  font-family: var(--Font-family-font-family-body, Inter);
  font-size: var(--Font-size-text-sm, 14px);
  font-style: normal;
  font-weight: 500;
  line-height: var(--Line-height-text-sm, 20px); /* 142.857% */
}

.easydoc-file-icon-content span {
  color: var(--colors-text-text-tertiary-600, #535862);
  font-family: var(--Font-family-font-family-body, Inter);
  font-size: var(--Font-size-text-sm, 14px);
  font-style: normal;
  font-weight: 400;
  line-height: var(--Line-height-text-sm, 20px); /* 142.857% */
}

a.easydoc-lightbox-link {
  text-decoration: none !important;
}

@keyframes easydoc-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .easydoc-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .easydoc-search-form {
    max-width: none;
  }

  .easydoc-files-table {
    font-size: 12px;
  }

  .easydoc-files-table th,
  .easydoc-files-table td {
    padding: 10px 8px;
  }

  .easydoc-view-btn,
  .easydoc-download-btn {
    text-align: center;
    font-size: 12px;
    padding: 6px 12px;
  }

  .easydoc-block-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .easydoc-file-meta {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .easydoc-wrapper {
    padding: 0 10px;
  }

  .easydoc-grid-item,
  .easydoc-block {
    margin: 0 -10px;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  .easydoc-table-wrapper {
    margin: 0 -10px;
    border-radius: 0;
    overflow-x: auto;
  }

  .easydoc-files-table {
    min-width: 500px;
  }
}

/* Pagination Styles */
.easydoc-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 24px 0 16px 0;
  font-family: 'Inter', sans-serif;
}

.easydoc-pagination-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #d5d7da;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  text-decoration: none !important; 
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.easydoc-pagination-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
  text-decoration: none;
}

.easydoc-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.easydoc-pagination-numbers,
.easydoc-page-btn {
  display: flex;
  align-items: center;
  gap: 4px;
}

.easydoc-pagination-number,
.easydoc-page-btn  {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.easydoc-pagination-number:hover,
.easydoc-page-btn:hover {
  background: #f3f4f6;
  color: #374151;
  text-decoration: none;
}

.easydoc-pagination-number.easydoc-pagination-current,
.easydoc-page-btn.active {
  background: var(--easydoc-primary-color);;
  color: #fff;
  border-color: var(--easydoc-primary-color);;
}

.easydoc-pagination-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #9ca3af;
  font-size: 14px;
}

.easydoc-pagination-info {
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 16px;
}

/* Responsive Pagination */
@media (max-width: 768px) {
  .easydoc-pagination {
    flex-wrap: wrap;
    gap: 8px;
  }

  .easydoc-pagination-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .easydoc-pagination-number {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .easydoc-pagination-numbers {
    gap: 2px;
  }

  .easydoc-pagination-number {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .easydoc-pagination-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .easydoc-pagination-btn span {
    display: none;
  }
}

/* Access Denied Styles */
.easydoc-access-denied {
  padding: 40px 20px;
  text-align: center;
  border-radius: var(--radius-lg, 10px);
  border: 1px solid var(--Colors-Border-border-secondary, #e9eaeb);
  background: var(--Colors-Background-bg-secondary, #f9fafb);
  margin: 20px 0;
}

.easydoc-access-denied p {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: var(--Colors-Text-text-tertiary, #717680);
  line-height: 1.5;
}

.easydoc-access-denied p:last-child {
  margin-bottom: 0;
}

.easydoc-access-denied a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md, 8px);
  background: var(--Colors-Brand-brand-primary, var(--easydoc-primary-color));
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

.easydoc-access-denied a:hover {
  background: var(--Colors-Brand-brand-primary-hover, #0039cc);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 72, 254, 0.15);
}

.easydoc-access-denied a:focus {
  outline: 2px solid var(--Colors-Brand-brand-primary, var(--easydoc-primary-color));
  outline-offset: 2px;
}

/* Error message styles (for consistency) */
.easydoc-error {
  padding: 20px;
  text-align: center;
  border-radius: var(--radius-lg, 10px);
  border: 1px solid #fee2e2;
  background: #fef2f2;
  color: #dc2626;
  font-size: 14px;
  margin: 20px 0;
}

.easydoc-folder-row {
  cursor: pointer;
}

.easydoc-folder-row:hover > td,
.easydoc-folder-row:hover > th {
  background-color: #f8f9fa;
  transition: background-color 0.2s ease;
}


.easydoc-folder-toggle{
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    border:none;
    color: #111827;
    padding-left: 0px;
    padding-right: 0px;
    color: var(--colors-text-text-primary-900, #181D27);
    font-family: var(--Font-family-font-family-body, Inter);
    font-size: var(--Font-size-text-sm, 14px);
    font-style: normal;
    font-weight: 500;
    line-height: var(--Line-height-text-sm, 20px); /* 142.857% */
}

.easydoc-folder-toggle:focus,
.easydoc-folder-toggle:hover{
    background-color: transparent;
    color: #111827;
}

.easydoc-folder-toggle-content{
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.easydoc-folder-toggle .icon-folder {
  margin-right: 6px;
}

/* Rotate chevron icon when expanded */
.icon-chevron.rotate {
    transform: rotate(180deg);
    transition: transform 0.2s;
}

.easydoc-all-folders-table-wrapper .easydoc-file-name-cell{
    padding-left: 40px;
}

.easydoc-file-empty-row em{
    padding-left: 40px;
}