/* ================================================================
   SHARE LINK STYLES + LOGIN BUTTON FIX
   File: public/css/share-styles.css
   ================================================================ */

/* ================================================================
   FIX: HIỆN #btnLogin Ở DESKTOP
   ================================================================ */
#btnLogin {
  display: flex !important;
}

@media (max-width: 768px) {
  #btnLogin {
    display: none !important;
  }
}

/* ================================================================
   GLOBAL NAV LOGIN LINK
   ================================================================ */
.global-nav-login {
  margin-left: 16px;
  padding: 6px 14px !important;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 6px;
  color: var(--primary, #10b981) !important;
}

.global-nav-login:hover {
  background: rgba(16, 185, 129, 0.25);
}

/* ================================================================
   FLOATING BUTTONS CONTAINER
   ================================================================ */
.floating-buttons-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
}

/* ================================================================
   FLOATING SHARE BUTTON
   ================================================================ */
.floating-share-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary, #10b981);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.floating-share-btn:hover {
  background: var(--primary-dark, #059669);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.floating-share-btn svg {
  width: 24px;
  height: 24px;
}

/* ================================================================
   FLOATING ADMIN BUTTON (cho ADMIN)
   ================================================================ */
.floating-admin-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  text-decoration: none;
}

.floating-admin-btn:hover {
  background: #4f46e5;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.floating-admin-btn svg {
  width: 24px;
  height: 24px;
}

/* ================================================================
   SHARE MODAL
   ================================================================ */
.share-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.share-modal-overlay.show {
  display: flex;
}

.share-modal-content {
  background: var(--card-bg, #1e293b);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border, #334155);
  animation: shareModalIn 0.2s ease;
}

@keyframes shareModalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #334155);
}

.share-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #f1f5f9);
  margin: 0;
}

.share-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.share-modal-close:hover {
  background: var(--card-hover, #334155);
  color: var(--text, #f1f5f9);
}

.share-modal-body {
  padding: 20px;
}

.share-expire-select {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.share-expire-select label {
  font-size: 14px;
  color: var(--text-muted, #94a3b8);
}

.share-expire-select select {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #334155);
  background: var(--bg, #0f172a);
  color: var(--text, #f1f5f9);
  font-size: 14px;
  cursor: pointer;
}

.share-expire-select select:focus {
  outline: none;
  border-color: var(--primary, #10b981);
}

.share-create-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: var(--primary, #10b981);
  color: white;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.share-create-btn:hover {
  background: var(--primary-dark, #059669);
}

.share-result {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #334155);
}

.share-result input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #334155);
  background: var(--bg, #0f172a);
  color: var(--text, #f1f5f9);
  font-size: 13px;
}

.share-result input:focus {
  outline: none;
  border-color: var(--primary, #10b981);
}

.share-copy-btn {
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--card-hover, #334155);
  color: var(--text, #f1f5f9);
  border: none;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.share-copy-btn:hover {
  background: var(--primary, #10b981);
  color: white;
}

/* ================================================================
   SHARE MODE - Chặn click khi xem qua share link
   ================================================================ */
body.share-mode .item-card-body,
body.share-mode .item-card-image {
  cursor: not-allowed !important;
  pointer-events: none !important;
}

body.share-mode .item-card:hover {
  transform: none;
  border-color: var(--border);
}

/* Ẩn nút Chi tiết trong modal khi share mode */
body.share-mode #modalBtnPrimary {
  display: none !important;
}

/* ================================================================
   MOBILE RESPONSIVE
   ================================================================ */
@media (max-width: 480px) {
  .floating-buttons-container {
    bottom: 16px;
    right: 16px;
    gap: 10px;
  }
  
  .floating-share-btn,
  .floating-admin-btn {
    width: 48px;
    height: 48px;
  }
  
  .floating-share-btn svg,
  .floating-admin-btn svg {
    width: 20px;
    height: 20px;
  }
  
  .share-modal-content {
    max-width: 100%;
  }
}
/* ================================================================
   SHARE MODE - Chặn tất cả tương tác
   Thêm vào cuối share-styles.css
   ================================================================ */

/* Share mode: chặn tất cả tương tác */
body.share-mode .item-card-body,
body.share-mode .item-card-image {
  cursor: not-allowed !important;
  pointer-events: none !important;
}

body.share-mode .item-card:hover {
  transform: none;
  border-color: var(--border);
}

body.share-mode #searchInput {
  opacity: 0.5;
}

body.share-mode #sidebar {
  pointer-events: none;
  opacity: 0.5;
}

body.share-mode .pagination,
body.share-mode .pagination-btn,
body.share-mode .page-btn {
  pointer-events: none;
  opacity: 0.5;
}

body.share-mode #sortSelect {
  opacity: 0.5;
}

body.share-mode #btnAddPlant,
body.share-mode #btnAdvancedSearch,
body.share-mode #modalBtnPrimary {
  display: none !important;
}

/* Banner thông báo share mode */
body.share-mode::before {
  content: '🔗 Chế độ xem chia sẻ - Chỉ xem, không tương tác';
  display: block;
  position: fixed;
  top: var(--header-height, 64px);
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  text-align: center;
  z-index: 999;
}

body.share-mode .main-layout {
  padding-top: 36px;
}

/* ================================================================
   DIGITAL LIBRARY — VISIBILITY BADGES & TOGGLE
   ================================================================ */
.vis-badge {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.vis-public { background: rgba(16, 185, 129, 0.85); color: #fff; }
.vis-private { background: rgba(239, 68, 68, 0.8); color: #fff; }

.vis-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  margin-left: 4px;
  opacity: 0.5;
  transition: opacity 0.2s;
  vertical-align: middle;
}
.vis-toggle:hover { opacity: 1; }

.private-card {
  opacity: 0.7;
  border: 1px dashed var(--border, #334155) !important;
}
.private-card:hover { opacity: 1; }

.vis-toggle-btn {
  background: var(--card-hover, #334155);
  border: 1px solid var(--border, #334155);
  color: var(--text, #f1f5f9);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.vis-toggle-btn:hover {
  background: var(--primary, #10b981);
  color: white;
  border-color: var(--primary, #10b981);
}
