/* DevDex - SB Admin 2 Custom Overrides */

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* DevDex brand color overrides */
.bg-gradient-primary {
  background-color: #4e73df;
  background-image: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
}

/* Sidebar brand logo - responsive */
.sidebar-brand-img {
  max-height: 36px;
  width: auto;
  transition: max-height 0.2s ease;
}

.sidebar.toggled .sidebar-brand-img {
  max-height: 26px;
}

/* Match mobile view (< 768px) to toggled sidebar behavior */
@media (max-width: 767.98px) {
  .sidebar-brand-img {
    max-height: 26px;
  }
}

/* Card enhancements */
.card {
  margin-bottom: 1.5rem;
}

.card .card-header {
  background-color: #f8f9fc;
  border-bottom: 1px solid #e3e6f0;
}

/* Form focus states */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: #858796;
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Vault-specific styles */
.vault-folder-card {
  background-color: #fff;
  border: 1px solid #e3e6f0;
  border-radius: .35rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  height: 100%;
  cursor: pointer;
}

.vault-folder-card:hover {
  border-color: #4e73df;
  transform: translateY(-2px);
  box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15);
}

.vault-folder-icon {
  width: 50px;
  height: 50px;
  background-color: #fff3cd;
  border-radius: .35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  flex-shrink: 0;
}

.vault-folder-icon i {
  font-size: 24px;
  color: #f6c23e;
}

.vault-folder-info {
  flex-grow: 1;
  min-width: 0;
}

.vault-folder-name {
  color: #5a5c69;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-folder-count {
  color: #858796;
  font-size: .85rem;
}

.vault-folder-date {
  color: #b7b9cc;
  font-size: .75rem;
}

.vault-folder-arrow i {
  font-size: 20px;
  color: #d1d3e2;
  transition: transform 0.2s ease;
}

.vault-folder-card:hover .vault-folder-arrow i {
  color: #4e73df;
  transform: translateX(4px);
}

/* Mobile: compact vertical folder cards */
@media (max-width: 575.98px) {
  .vault-folder-card {
    flex-direction: column;
    text-align: center;
    padding: .75rem;
  }

  .vault-folder-icon {
    margin-right: 0;
    margin-bottom: 8px;
    width: 40px;
    height: 40px;
  }

  .vault-folder-icon i {
    font-size: 20px;
  }

  .vault-folder-name {
    font-size: .8rem;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .vault-folder-count {
    font-size: .75rem;
  }

  .vault-folder-date {
    font-size: .65rem;
  }

  .vault-folder-arrow {
    display: none;
  }
}

.folder-card-link {
  text-decoration: none;
  display: block;
}

/* File cards */
.vault-file-card {
  background-color: #fff;
  border: 1px solid #e3e6f0;
  border-radius: .35rem;
  padding: 15px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  height: 100%;
  position: relative;
  padding-left: 40px;
}

.vault-file-card:hover {
  border-color: #4e73df;
  box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15);
}

.vault-file-icon {
  width: 45px;
  height: 45px;
  background-color: #eaecf4;
  border-radius: .35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.vault-file-icon i {
  font-size: 20px;
  color: #4e73df;
}

.vault-file-info {
  flex-grow: 1;
  min-width: 0;
}

.vault-file-name {
  color: #5a5c69;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-file-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.vault-file-type {
  background-color: rgba(78, 115, 223, 0.1);
  color: #4e73df;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: .2rem;
}

.vault-file-size {
  color: #858796;
  font-size: .8rem;
}

.vault-file-date {
  color: #b7b9cc;
  font-size: .75rem;
}

.vault-file-actions {
  margin-left: 10px;
  flex-shrink: 0;
}

/* Image cards */
.vault-image-card {
  background-color: #fff;
  border: 1px solid #e3e6f0;
  border-radius: .35rem;
  overflow: hidden;
  transition: all 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.vault-image-card:hover {
  border-color: #4e73df;
  box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15);
}

.vault-image-thumbnail {
  width: 100%;
  height: 200px;
  background-color: #eaecf4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.vault-image-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.vault-image-card:hover .vault-image-thumbnail img {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(78, 115, 223, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: #fff;
  z-index: 5;
  pointer-events: none;
}

.vault-image-card:hover .image-overlay {
  opacity: 1;
}

.image-overlay i {
  font-size: 32px;
  margin-bottom: 8px;
}

.image-overlay span {
  font-size: .8rem;
  font-weight: 600;
}

.vault-image-card .vault-file-info {
  padding: 12px;
  flex-grow: 1;
}

.vault-image-card .vault-file-actions {
  padding: 0 12px 12px;
  margin: 0;
}

/* File checkbox */
.file-checkbox {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
}

.file-select-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  position: static;
  margin: 0;
}

/* Upload section */
.upload-card {
  background-color: #f8f9fc;
  border: 2px dashed #d1d3e2;
  border-radius: .35rem;
  padding: 20px;
  transition: all 0.2s ease;
}

.upload-card:hover {
  border-color: #4e73df;
  background-color: #eaecf4;
}

.upload-header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e3e6f0;
}

.upload-header h5 {
  color: #5a5c69;
  font-weight: 700;
  margin-bottom: 0;
}

/* Breadcrumb */
.breadcrumb {
  background-color: #f8f9fc;
  border-radius: .35rem;
}

/* Vault stats */
.vault-stats,
.vault-info {
  background-color: #f8f9fc;
  border: 1px solid #e3e6f0;
  border-radius: .35rem;
  padding: 15px;
}

.vault-stat-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eaecf4;
}

.vault-stat-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.vault-stat-label {
  color: #858796;
  font-size: .85rem;
}

.vault-stat-value {
  color: #5a5c69;
  font-weight: 700;
  font-size: .85rem;
}

.vault-security-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.vault-security-list li {
  color: #858796;
  font-size: .85rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}

/* Lightbox */
.lightbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 20px;
  position: relative;
  background: #000;
}

.lightbox-image {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(78, 115, 223, 0.9);
  border: none;
  color: #fff;
  font-size: 28px;
  padding: 12px 16px;
  cursor: pointer;
  border-radius: .35rem;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-nav:hover {
  background-color: #224abe;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-nav.hidden {
  display: none;
}

/* Empty states */
.vault-empty-state {
  max-width: 400px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 575.98px) {
  .vault-file-card {
    flex-direction: column;
    text-align: center;
    padding: .75rem;
    padding-left: .75rem;
  }

  .vault-file-icon {
    width: 38px;
    height: 38px;
    margin-right: 0;
    margin-bottom: 6px;
  }

  .vault-file-icon i {
    font-size: 18px;
  }

  .vault-file-name {
    font-size: .75rem;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .vault-file-size {
    font-size: .7rem;
  }

  .vault-file-meta {
    justify-content: center;
  }

  .vault-file-actions {
    margin-left: 0;
    margin-top: 6px;
  }

  .vault-file-card .file-checkbox {
    left: 6px;
    top: 6px;
  }
}

/* Login/Register page side panels */
.bg-login-image {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  min-height: 300px;
}

.bg-register-image {
  background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%);
  min-height: 300px;
}
