/* ============================================================
   ADMIN GALLERY ACTIONS - CSS
   ============================================================ */

/* ACTIONS MENU DROPDOWN */
.actions-menu {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 200px;
}

.actions-menu .action-btn {
  display: block;
  width: 100%;
  padding: 10px 15px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background 0.2s;
}

.actions-menu .action-btn:last-child {
  border-bottom: none;
}

.actions-menu .action-btn:hover {
  background-color: #f5f5f5;
}

.actions-menu .action-btn.delete:hover {
  background-color: #fee;
  color: #c00;
}

/* MODAL BASE */
.modal-qrcode,
.modal-cover,
.modal-download {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  border-radius: 8px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 20px;
  color: #333;
}

/* QR CODE MODAL */
#qrcode-container {
  text-align: center;
  margin: 20px 0;
}

#qrcode-container canvas {
  border: 1px solid #eee;
  padding: 10px;
  border-radius: 4px;
}

.modal-qrcode p {
  font-size: 12px;
  color: #666;
  word-break: break-all;
  background: #f9f9f9;
  padding: 10px;
  border-radius: 4px;
  margin: 15px 0;
}

/* COVER UPLOAD MODAL */
.cover-upload-area {
  border: 2px dashed #ccc;
  border-radius: 6px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #fafafa;
}

.cover-upload-area:hover {
  border-color: #666;
  background: #f0f0f0;
}

.cover-upload-area p {
  color: #666;
  margin: 0 0 15px 0;
  font-size: 14px;
}

.cover-upload-area button {
  background: #333;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.cover-upload-area button:hover {
  background: #555;
}

#cover-preview {
  margin: 20px 0;
  text-align: center;
}

#cover-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid #eee;
}

/* DOWNLOAD MODAL */
.download-info {
  background: #f9f9f9;
  border-left: 4px solid #333;
  padding: 15px;
  border-radius: 4px;
  margin: 15px 0;
  font-size: 14px;
}

.download-info strong {
  display: block;
  margin-bottom: 5px;
}

/* MODAL ACTIONS */
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 25px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.modal-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.modal-actions button:not(.delete) {
  background: #333;
  color: white;
}

.modal-actions button:not(.delete):hover {
  background: #555;
}

.modal-actions button.delete {
  background: #fee;
  color: #c00;
}

.modal-actions button.delete:hover {
  background: #fdd;
}

/* LOADING STATE */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* SUCCESS/ERROR MESSAGES */
.alert {
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* GALLERY CARD ACTIONS BUTTON */
.gallery-card {
  position: relative;
}

.gallery-card .actions-dropdown {
  position: absolute;
  top: 10px;
  right: 10px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  cursor: pointer;
  font-weight: bold;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.gallery-card .actions-dropdown:hover {
  background: #f9f9f9;
  border-color: #999;
}

.gallery-card .actions-dropdown::after {
  content: '⋮';
  font-size: 18px;
  line-height: 1;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    padding: 20px;
  }

  .cover-upload-area {
    padding: 20px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions button {
    width: 100%;
  }

  .actions-menu {
    min-width: 150px;
  }

  .actions-menu .action-btn {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {
  .modal-content {
    background: #2d2d2d;
    color: #e0e0e0;
  }

  .modal-content h2 {
    color: #e0e0e0;
  }

  .actions-menu {
    background: #333;
    border-color: #444;
  }

  .actions-menu .action-btn {
    color: #e0e0e0;
    border-bottom-color: #444;
  }

  .actions-menu .action-btn:hover {
    background-color: #444;
  }

  .cover-upload-area {
    background: #3a3a3a;
    border-color: #555;
  }

  .cover-upload-area p {
    color: #b0b0b0;
  }

  .download-info {
    background: #3a3a3a;
    border-left-color: #e0e0e0;
  }

  .modal-actions button:not(.delete) {
    background: #444;
  }

  .modal-actions button:not(.delete):hover {
    background: #555;
  }
}
