/* Table Column Width Fix - Links Tables Only */
table {
  table-layout: auto;
  width: 100%;
}

/* Links Table - Set specific column widths */
th.original-url,
td.original-url {
  width: 30%;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th.created-at,
td.created-at {
  width: 120px;
  min-width: 120px;
}

th.short-link,
td.short-link {
  width: 180px;
  min-width: 180px;
}

th.views,
td.views {
  width: 60px;
  min-width: 60px;
  text-align: center;
}

/* Admin Users Table - Column Widths */
th.users-id,
td.users-id {
  width: 50px;
  min-width: 50px;
}

th.users-email,
td.users-email {
  width: auto;
  min-width: 250px;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}

th.users-created-at,
td.users-created-at {
  width: 120px;
  min-width: 120px;
  white-space: nowrap;
}

th.users-verified,
td.users-verified {
  width: 80px;
  min-width: 80px;
  text-align: center;
  white-space: nowrap;
}

th.users-role,
td.users-role {
  width: 80px;
  min-width: 80px;
  text-align: center;
  white-space: nowrap;
}

th.users-links-count,
td.users-links-count {
  width: 100px;
  min-width: 100px;
  text-align: center;
  white-space: nowrap;
}

th.users-actions,
td.users-actions {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  white-space: nowrap;
}

/* Admin Domains Table - Column Widths */
th.domains-id,
td.domains-id {
  width: 50px;
  min-width: 50px;
}

th.domains-address,
td.domains-address {
  width: 40%;
  min-width: 200px;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}

th.domains-homepage,
td.domains-homepage {
  width: 40%;
  min-width: 200px;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}

th.domains-created-at,
td.domains-created-at {
  width: 120px;
  min-width: 120px;
  white-space: nowrap;
}

th.domains-links-count,
td.domains-links-count {
  width: 100px;
  min-width: 100px;
  text-align: center;
  white-space: nowrap;
}

th.domains-actions,
td.domains-actions {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  white-space: nowrap;
}

/* QR Code Column Styling */
th.qr-code,
td.qr-code-cell {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  text-align: center;
}

td.qr-code-cell {
  vertical-align: middle;
  padding: 10px;
}

.qr-code-container {
  display: inline-block;
  width: 100px;
  height: 100px;
}

.qr-code-container canvas {
  display: block !important;
  width: 100px !important;
  height: 100px !important;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  padding: 5px;
  background: white;
  box-sizing: border-box;
}

.qr-code-container img {
  display: none !important;
}

th.actions,
td.actions {
  width: 200px;
  min-width: 200px;
}

/* ========================================
   QR Code Generator - Floating Button & Modal
   ======================================== */

/* Floating Action Button */
.qr-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2196F3;
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 999;
}

.qr-fab:hover {
  background: #1976D2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.qr-fab:active {
  background: #1565C0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.qr-fab svg {
  width: 28px;
  height: 28px;
  fill: white;
  flex-shrink: 0;
}

/* Modal Overlay */
.qr-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.qr-modal.show {
  display: flex;
  opacity: 1;
}

/* Modal Content */
.qr-modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal Header */
.qr-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
}

.qr-modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: #333;
}

.qr-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #666;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.qr-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

/* Modal Body */
.qr-modal-body {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .qr-modal-body {
    grid-template-columns: 1fr;
  }
}

/* Input Section */
.qr-input-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qr-input-section label {
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
}

.qr-input-section textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
}

.qr-input-section textarea:focus {
  outline: none;
  border-color: #2196F3;
}

/* Size Options */
.qr-size-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qr-size-buttons {
  display: flex;
  gap: 8px;
}

.qr-size-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.qr-size-btn:hover {
  border-color: #2196F3;
  color: #2196F3;
}

.qr-size-btn.active {
  background: #2196F3;
  color: white;
  border-color: #2196F3;
}

/* Generate Button */
.qr-generate-btn {
  padding: 12px 24px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.qr-generate-btn:hover {
  background: #45a049;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.qr-generate-btn:active {
  transform: scale(0.98);
}

/* Output Section */
.qr-output-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.qr-display-area {
  width: 100%;
  min-height: 300px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
  padding: 20px;
}

.qr-placeholder {
  color: #999;
  font-size: 14px;
  text-align: center;
}

.qr-error {
  color: #f44336;
  font-size: 14px;
  text-align: center;
}

.qr-display-area img {
  max-width: 100%;
  height: auto;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  padding: 8px;
  background: white;
}

/* Download Button */
.qr-download-btn {
  padding: 10px 20px;
  background: #FF9800;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.qr-download-btn:hover {
  background: #F57C00;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.qr-download-btn:active {
  transform: scale(0.98);
}
