/* Rowt Dashboard CSS */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  overflow-x: hidden;
  position: relative;
}

/* Layout */
.screen {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.screen#dashboard {
  padding: 0;
  background-color: #f5f5f5;
}

.screen#login-screen {
  padding: 20px;
}

.hidden {
  display: none !important;
}

/* Loading Screen */
.loading-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #fff;
}

.loader {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  margin: 4px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.disabled:hover {
  background-color: inherit;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Cards */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 16px;
  overflow: hidden;
}

.card-header {
  padding: 16px;
  border-bottom: 1px solid #eee;
  background-color: #f8f9fa;
}

.card-body {
  padding: 16px;
}

.card-actions {
  padding: 8px 16px;
  border-top: 1px solid #eee;
  background-color: #f8f9fa;
  display: flex;
  gap: 8px;
}

/* Messages */
.error {
  background-color: #fee;
  color: #c33;
  padding: 10px;
  border: 1px solid #fcc;
  border-radius: 4px;
  margin: 10px 0;
}

.success {
  background-color: #efe;
  color: #363;
  padding: 10px;
  border: 1px solid #cfc;
  border-radius: 4px;
  margin: 10px 0;
}

.info {
  background-color: #e6f3ff;
  color: #0066cc;
  padding: 10px;
  border: 1px solid #b3d9ff;
  border-radius: 4px;
  margin: 10px 0;
}

/* Configuration Error Screen */
.configuration-error-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f8f9fa;
}

.error-container {
  max-width: 600px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  padding: 32px;
  text-align: center;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.error-title {
  color: #dc3545;
  margin-bottom: 16px;
}

.error-message {
  margin-bottom: 24px;
  color: #666;
}

.error-details {
  text-align: left;
  margin-bottom: 24px;
}

.details-title {
  color: #333;
  margin-bottom: 8px;
}

.missing-list {
  list-style: none;
  padding-left: 0;
}

.missing-item {
  background-color: #f8f9fa;
  padding: 4px 8px;
  margin: 4px 0;
  border-radius: 4px;
  font-family: monospace;
}

.configuration-instructions {
  text-align: left;
  margin-bottom: 24px;
}

.instructions-title {
  color: #333;
  margin-bottom: 16px;
}

.config-method {
  margin-bottom: 20px;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.method-title {
  color: #007bff;
  margin-bottom: 8px;
}

.config-code {
  display: block;
  background-color: #e9ecef;
  padding: 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  margin: 8px 0;
  word-break: break-all;
}

.method-description {
  color: #666;
  font-size: 14px;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Enhanced Modal System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.2s ease-out;
}

.modal {
  background: white;
  border-radius: 16px;
  max-width: 600px;
  width: 95%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafbfc;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.modal-close {
  background: #f3f4f6;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #e5e7eb;
  color: #374151;
  transform: scale(1.05);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

/* Modal Form Styles */
.modal-body .form-group {
  margin-bottom: 20px;
}

.modal-body .form-label {
  display: block;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
  font-size: 14px;
}

.modal-body .form-control,
.modal-body input[type="text"],
.modal-body input[type="url"],
.modal-body input[type="email"],
.modal-body textarea,
.modal-body select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.2s ease;
  background: #fff;
  font-family: inherit;
  box-sizing: border-box;
}

.modal-body .form-control:focus,
.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #fff;
}

.modal-body .form-control::placeholder,
.modal-body input::placeholder,
.modal-body textarea::placeholder {
  color: #9ca3af;
}

.modal-body .form-description,
.modal-body small.form-description {
  display: block;
  color: #6b7280;
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.4;
  font-style: italic;
}

.modal-body .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.modal-body .form-row .form-group {
  margin-bottom: 0;
}

.modal-footer {
  padding: 16px 24px 24px 24px;
  border-top: 1px solid #f0f2f5;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #fafbfc;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Login Screen */
.login-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  max-width: 400px;
  margin: 0 auto;
  padding: 40px 20px;
}

.logo {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-container h1 {
  color: #333;
  margin-bottom: 32px;
  text-align: center;
  font-size: 28px;
  font-weight: 600;
}

.login-container form {
  width: 100%;
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-container .form-group {
  margin-bottom: 20px;
}

.login-container label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.login-container input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-container input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.login-container button[type="submit"] {
  width: 100%;
  padding: 12px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 8px;
}

.login-container button[type="submit"]:hover {
  background-color: #0056b3;
}

.login-container button[type="submit"]:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

/* Dashboard Header */
.header {
  background: white;
  border-bottom: 1px solid #e1e5e9;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  color: #666;
  font-size: 14px;
}

/* Navigation */
.navigation {
  background: white;
  border-bottom: 1px solid #e1e5e9;
  padding: 0 24px;
}

.nav-tabs {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  gap: 0;
}

.nav-tab {
  padding: 16px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  transition: all 0.2s;
}

.nav-tab:hover {
  color: #007bff;
  background-color: #f8f9fa;
}

.nav-tab.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background-color: #f8f9fa;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
}

.stat-card h3 {
  font-size: 14px;
  font-weight: 500;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #333;
}

.stat-number.status-ok {
  color: #10b981;
  text-transform: capitalize;
}

.stat-number.status-error {
  color: #ef4444;
  text-transform: capitalize;
}

/* Welcome Section */
.welcome-section {
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  margin-bottom: 32px;
}

.welcome-section h2 {
  color: #333;
  margin-bottom: 16px;
  font-size: 24px;
}

.welcome-section p {
  color: #666;
  font-size: 16px;
  line-height: 1.6;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

/* Link Creation Form */
.link-form {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 24px;
}

.link-form h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 18px;
  font-weight: 600;
}

.link-form .form-group {
  margin-bottom: 16px;
}

.link-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

.link-form input,
.link-form select,
.link-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e1e5e9;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.link-form input:focus,
.link-form select:focus,
.link-form textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.link-form textarea {
  resize: vertical;
  min-height: 80px;
}

.link-form .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.link-form .form-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.link-form .btn-primary {
  background-color: #007bff;
  color: white;
}

.link-form .btn-primary:hover {
  background-color: #0056b3;
}

.link-form .btn-secondary {
  background-color: #6c757d;
  color: white;
}

.link-form .btn-secondary:hover {
  background-color: #545b62;
}

/* Shortened URL Display */
.shortened-url-display {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
}

.url-display-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.url-display-label {
  font-weight: 600;
  color: #495057;
  font-size: 14px;
  margin: 0;
}

.url-display-input-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.url-display-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: white;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  color: #007bff;
}

.url-display-copy-btn,
.url-display-test-btn {
  padding: 10px 16px;
  border: 1px solid #007bff;
  border-radius: 4px;
  background: white;
  color: #007bff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.url-display-copy-btn:hover,
.url-display-test-btn:hover {
  background: #007bff;
  color: white;
}

.url-display-test-btn {
  border-color: #28a745;
  color: #28a745;
}

.url-display-test-btn:hover {
  background: #28a745;
  color: white;
}

/* Link List Container */
.link-list-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  margin-bottom: 24px;
}

/* Link List Header */
.link-list-header {
  padding: 24px;
  border-bottom: 1px solid #f0f2f5;
  background: #fafbfc;
}

.header-title-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-title-section h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.header-search-section {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

/* Search Input */
.search-group {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 18px;
}

.search-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input::placeholder {
  color: #9ca3af;
}

/* Project Filter */
.project-filter {
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  color: #374151;
  min-width: 160px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-filter:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* View Toggle */
.view-toggle {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 4px;
  gap: 2px;
}

.view-btn {
  padding: 8px 16px !important;
  border: none !important;
  background: transparent !important;
  color: #6b7280 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  cursor: pointer;
}

.view-btn:hover {
  color: #374151 !important;
  background: rgba(255, 255, 255, 0.5) !important;
}

.view-btn.active {
  background: white !important;
  color: #007bff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
  padding: 12px 24px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  display: none;
  align-items: center;
  justify-content: space-between;
}

.bulk-actions-bar.visible {
  display: flex;
}

.bulk-actions-info {
  color: #495057;
  font-size: 14px;
  font-weight: 500;
}

.bulk-actions-buttons {
  display: flex;
  gap: 8px;
}

/* Links Content */
.links-content {
  min-height: 200px;
}

/* Links Table */
.links-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.links-table thead {
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
}

.links-table th {
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e9ecef;
}

.links-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background-color 0.2s ease;
}

.links-table th.sortable:hover {
  background-color: #e9ecef;
}

.links-table th.sortable::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 4px solid #adb5bd;
  opacity: 0.5;
}

.links-table th.sorted.asc::after {
  border-bottom: 4px solid #007bff;
  border-top: none;
  opacity: 1;
}

.links-table th.sorted.desc::after {
  border-top: 4px solid #007bff;
  border-bottom: none;
  opacity: 1;
}

.links-table tbody tr {
  border-bottom: 1px solid #f0f2f5;
  transition: background-color 0.2s ease;
}

.links-table tbody tr:hover {
  background-color: #f8f9fa;
}

.links-table tbody tr.selected {
  background-color: #e3f2fd;
}

.links-table td {
  padding: 16px 20px;
  vertical-align: middle;
  color: #374151;
  font-size: 14px;
}

/* Checkbox Column */
.checkbox-column {
  width: 48px;
  text-align: center;
}

.checkbox-column input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Short Code Column */
.short-code-cell {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  color: #007bff;
  font-weight: 500;
}

.short-code-link {
  color: #007bff;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f0f8ff;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.short-code-link:hover {
  background: #e6f3ff;
  text-decoration: underline;
}

/* URL Column */
.url-cell {
  max-width: 300px;
}

.url-text {
  color: #6b7280;
  font-size: 13px;
  word-break: break-all;
  line-height: 1.4;
}

/* Title Column */
.title-cell {
  font-weight: 500;
  color: #1f2937;
}

/* Project Column */
.project-cell {
  color: #6b7280;
  font-size: 13px;
}

/* Clicks Column */
.clicks-cell {
  text-align: center;
  font-weight: 600;
  color: #059669;
}

/* Actions Column */
.actions-cell {
  width: 120px;
}

.table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.table-actions .btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
}

/* Icon Action Buttons */
.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  padding: 0;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Specific action button colors */
.edit-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #3b82f6;
}

.delete-btn {
  color: #ef4444;
  font-weight: bold;
  font-size: 29px !important;
  padding-top: 2px;
}

.delete-btn:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
  transform: translateY(-1px);
}

.copy-btn:hover {
  background: #f0fdf4;
  border-color: #10b981;
  color: #10b981;
}

.qr-btn:hover {
  background: #f8fafc;
  border-color: #6366f1;
  color: #6366f1;
}

/* QR Code Checkerboard Icon */
.qr-icon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  width: 14px;
  height: 14px;
}

.qr-square {
  background: transparent;
  border-radius: 1px;
}

.qr-square.qr-filled {
  background: currentColor;
}

.qr-btn:hover .qr-square.qr-filled {
  background: #6366f1;
}

.analytics-btn:hover {
  background: #fefbef;
  border-color: #f59e0b;
  color: #f59e0b;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  color: #374151;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Loading State */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f4f6;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Cards View */
.links-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  padding: 24px;
}

.link-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  position: relative;
}

.link-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.link-card.selected {
  border-color: #007bff;
  background: #f8fbff;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.card-checkbox {
  margin-top: 2px;
}

.card-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.card-title {
  flex: 1;
  margin-left: 12px;
}

.card-title h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.card-short-code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  margin-bottom: 8px;
}

.card-short-code .short-link {
  color: #007bff;
  font-weight: 500;
  text-decoration: none;
  padding: 2px 6px;
  background: #f0f8ff;
  border-radius: 4px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.card-short-code .short-link:hover {
  background: #e6f3ff;
  text-decoration: underline;
}

.card-content {
  margin-bottom: 16px;
}

.card-url {
  color: #6b7280;
  font-size: 13px;
  word-break: break-all;
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 16px;
}

.card-project {
  background: #f3f4f6;
  color: #6b7280;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.card-stats {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-stat-value {
  font-weight: 600;
  color: #059669;
}

.card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.card-actions .btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
}

.card-actions .action-btn {
  width: 32px;
  height: 32px;
}

/* Notification Styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 9999;
  animation: slideIn 0.3s ease;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
}

.notification.success {
  background-color: #10b981;
}

.notification.error {
  background-color: #ef4444;
}

.notification.info {
  background-color: #3b82f6;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Projects Tab Container */
.projects-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  margin-bottom: 24px;
}

/* Projects Header */
.projects-header {
  padding: 24px;
  border-bottom: 1px solid #f0f2f5;
  background: #fafbfc;
}

.projects-title-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.projects-title-section h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.projects-stats {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 14px;
  color: #6b7280;
}

.projects-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.projects-stat-value {
  font-weight: 600;
  color: #374151;
}

/* Project List Grid */
.projects-list {
  padding: 24px;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
  margin: 0;
}

/* Modern Project Cards */
.project-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.project-card:hover::before {
  opacity: 1;
}

/* Project Card Header */
.project-header {
  margin-bottom: 20px;
}

.project-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.project-date {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

/* Project Details */
.project-details {
  margin-bottom: 20px;
}

.project-details p {
  margin: 0 0 12px 0;
  font-size: 14px;
  line-height: 1.5;
}

.project-details strong {
  color: #374151;
  font-weight: 600;
}

.project-url {
  font-size: 12px;
  color: #6b7280;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: #f9fafb;
  padding: 6px 10px;
  border-radius: 6px;
  margin: 8px 0;
  word-break: break-all;
  border: 1px solid #f3f4f6;
}

/* API Key Section */
.project-api-key {
  margin-bottom: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.project-api-key label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.api-key-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.api-key-input {
  flex: 1;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  color: #475569;
  cursor: text;
}

.api-key-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.copy-api-key-btn {
  padding: 8px 12px !important;
  font-size: 11px !important;
  border-radius: 6px !important;
  background: #64748b !important;
  color: white !important;
  border: none !important;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.copy-api-key-btn:hover {
  background: #475569 !important;
  transform: translateY(-1px);
}

/* Project Actions */
.project-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.project-actions .btn {
  padding: 10px 16px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
}

.project-actions .btn-primary {
  background: #3b82f6 !important;
  color: white !important;
  border: 1px solid #3b82f6 !important;
}

.project-actions .btn-primary:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.project-actions .btn-secondary {
  background: #f8fafc !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
}

.project-actions .btn-secondary:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
  transform: translateY(-1px);
}

/* Enhanced Project Forms */
.project-form-container {
  max-width: 100%;
  margin: 0;
}

.project-form {
  background: #fff;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.project-form .form-group {
  margin-bottom: 24px;
}

.project-form .form-label {
  display: block;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
  font-size: 14px;
}

.project-form .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.2s ease;
  background: #fff;
  font-family: inherit;
}

.project-form .form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #fff;
}

.project-form .form-control::placeholder {
  color: #9ca3af;
}

.project-form .form-description {
  display: block;
  color: #6b7280;
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.4;
  font-style: italic;
}

/* Project Form Field Groups */
.project-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.project-form .form-row .form-group {
  margin-bottom: 0;
}

/* Project Form Sections */
.project-form .form-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f2f5;
}

.project-form .form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.project-form .form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-form .form-section-description {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Project Form Actions */
.project-form .form-actions,
.project-form .button-group {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.project-form .btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

.project-form .btn-primary {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.project-form .btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.project-form .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.project-form .btn-secondary {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
}

.project-form .btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

/* Project Form Loading State */
.project-form .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.project-form .btn.loading {
  position: relative;
  color: transparent;
}

.project-form .btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  color: inherit;
}

/* Enhanced Project Cards */
.project-card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  border: 1px solid #f3f4f6;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  border-color: #e5e7eb;
}

.project-card:hover::before {
  opacity: 1;
}

.project-name {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
  line-height: 1.3;
}

.project-description {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 13px;
  color: #6b7280;
  padding: 12px 0;
  border-top: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
}

.project-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.project-stat-value {
  font-weight: 600;
  color: #111827;
  font-size: 16px;
}

.project-stat-label {
  font-size: 12px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.project-actions .btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.project-actions .btn-primary {
  background: #3b82f6;
  color: white;
  border: 1px solid #3b82f6;
}

.project-actions .btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.project-actions .btn-secondary {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.project-actions .btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
  transform: translateY(-1px);
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.empty-state h3 {
  color: #333;
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 20px;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.btn-outline-primary {
  background-color: transparent;
  color: #007bff;
  border: 1px solid #007bff;
}

.btn-outline-primary:hover {
  background-color: #007bff;
  color: white;
}

.btn-outline {
  background-color: transparent;
  color: #007bff;
  border: 2px solid #007bff;
}

.btn-outline:hover {
  background-color: #007bff;
  color: white;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-large {
  padding: 12px 24px;
  font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .links-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding: 20px;
  }

  .header-search-section {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-group {
    min-width: auto;
  }

  .view-toggle {
    align-self: flex-start;
  }

  /* Projects Tablet Styles */
  .project-list {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
  }

  .projects-title-section {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .project-actions {
    flex-direction: column;
    gap: 8px;
  }

  .project-actions .btn {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .screen {
    padding: 10px;
  }

  .error-container {
    margin: 20px;
    padding: 20px;
  }

  .config-code {
    font-size: 10px;
  }

  .header-content {
    padding: 0 16px;
  }

  .main-content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .nav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tab {
    white-space: nowrap;
    min-width: 120px;
  }

  .login-container {
    padding: 20px 16px;
  }

  .login-container form {
    padding: 24px;
  }

  .project-list {
    grid-template-columns: 1fr;
  }

  .link-form .form-actions {
    flex-direction: column;
  }

  /* Link List Mobile Styles */
  .link-list-header {
    padding: 20px 16px;
  }

  .header-title-section {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .header-search-section {
    flex-direction: column;
    gap: 12px;
  }

  .search-group {
    min-width: auto;
  }

  .project-filter {
    min-width: auto;
  }

  .view-toggle {
    align-self: flex-start;
  }

  /* Projects Tab Mobile Styles */
  .projects-container {
    margin: 0 -16px;
    border-radius: 0;
  }

  .projects-header {
    padding: 20px 16px;
  }

  .projects-title-section {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .projects-stats {
    justify-content: center;
  }

  .projects-list {
    padding: 16px;
  }

  .project-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project-card {
    padding: 20px 16px;
  }

  .project-actions {
    flex-direction: column;
    gap: 8px;
  }

  .project-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .api-key-container {
    flex-direction: column;
    gap: 8px;
  }

  .copy-api-key-btn {
    width: 100% !important;
  }

  /* Project Form Mobile Styles */
  .project-form-container {
    max-width: 100%;
    padding: 0;
  }

  .project-form .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .project-form .form-row .form-group {
    margin-bottom: 20px;
  }

  .project-form .form-actions,
  .project-form .button-group {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .project-form .btn {
    width: 100%;
    justify-content: center;
  }

  /* Modal Mobile Styles */
  .modal {
    width: 98%;
    max-height: 95vh;
    border-radius: 12px;
  }

  .modal-header {
    padding: 20px 16px 12px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px 20px 16px;
  }

  .project-stat {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
  }

  .project-stat:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
  }

  .project-actions {
    flex-direction: column;
    gap: 8px;
  }

  .project-actions .btn {
    width: 100%;
    justify-content: center;
  }
  }

  /* Table Mobile Styles */
  .links-table {
    font-size: 13px;
  }

  .links-table th,
  .links-table td {
    padding: 12px 8px;
  }

  .url-cell {
    max-width: 200px;
  }

  .table-actions {
    gap: 6px;
    justify-content: center;
  }

  .table-actions .btn {
    font-size: 11px !important;
    padding: 4px 8px !important;
  }

  .table-actions .action-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  /* Cards Mobile Styles */
  .links-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }

  .link-card {
    padding: 16px;
  }

  .card-actions {
    gap: 6px;
    justify-content: center;
  }

  .card-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .card-actions .action-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  /* Bulk Actions Mobile */
  .bulk-actions-bar {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .bulk-actions-buttons {
    justify-content: stretch;
  }

  .bulk-actions-buttons .btn {
    flex: 1;
  }

  /* Notification Mobile */
  .notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .links-table th:nth-child(3),
  .links-table td:nth-child(3),
  .links-table th:nth-child(4),
  .links-table td:nth-child(4) {
    display: none;
  }

  .search-input {
    padding-left: 16px;
    background-image: none;
  }

  .card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .link-form .form-actions button {
    width: 100%;
  }
}

/* Metadata Editor Styles */
.metadata-group {
  margin-bottom: 24px;
}

.metadata-editor, .social-metadata-editor, .enhanced-metadata-editor {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

/* Enhanced Metadata Editor */
.kv-editor-enhanced {
  padding: 16px;
  background: #f8f9fa;
}

.kv-pair-enhanced {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.kv-pair-enhanced .kv-key {
  flex: 0 0 200px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

.kv-value-container {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.kv-pair-enhanced .kv-value {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  resize: none;
  min-height: 32px;
  line-height: 1.4;
}

.format-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
}

.remove-pair-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  border-radius: 4px;
}

.kv-key:focus, .kv-value:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
  outline: none;
}

.add-pair-btn {
  margin-top: 8px;
  font-size: 14px;
  padding: 8px 16px;
}

/* Social Metadata Editor */
.social-fields {
  padding: 16px;
  background: #f8f9fa;
}

.social-field {
  margin-bottom: 16px;
}

.social-field:last-child {
  margin-bottom: 0;
}

.social-field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: #555;
  font-size: 14px;
}

.social-field-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.social-field-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
  outline: none;
}

.advanced-toggle {
  padding: 12px 16px;
  border-top: 1px solid #eee;
  background: #fff;
  text-align: center;
}

.json-editor-section {
  padding: 16px;
  background: #fff;
  border-top: 1px solid #eee;
}

/* Editor Mode Toggle */
.editor-mode-toggle {
  display: flex;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  gap: 8px;
}

.mode-btn {
  flex: 1;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.mode-btn.active {
  font-weight: 600;
}

.json-editor {
  border: none;
  border-bottom: 1px solid #eee;
  border-radius: 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  resize: vertical;
  min-height: 100px;
}

.json-editor:focus {
  box-shadow: none;
  border-color: #eee;
}

.kv-editor {
  padding: 16px;
  background: #f8f9fa;
}

.kv-header {
  font-weight: 600;
  margin-bottom: 12px;
  color: #555;
  font-size: 14px;
}

.kv-container {
  margin-bottom: 12px;
}

.kv-pair {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.kv-key, .kv-value {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.kv-key {
  max-width: 200px;
  font-weight: 500;
}

.kv-key:focus, .kv-value:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
  outline: none;
}

.remove-pair-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  border-radius: 4px;
}

.add-pair-btn {
  font-size: 14px;
  padding: 8px 16px;
}

.form-description {
  display: block;
  margin-top: 4px;
  margin-bottom: 8px;
  color: #666;
  font-size: 13px;
  font-style: italic;
}

/* Validation Feedback */
.validation-feedback {
  padding: 8px 12px;
  margin-top: 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

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

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

/* Template Content */
.template-content {
  padding: 16px;
  background: #f8f9fa;
}

.template-content h4 {
  margin-bottom: 16px;
  color: #333;
  font-size: 16px;
}

.template-content h5 {
  margin-bottom: 8px;
  margin-top: 16px;
  color: #555;
  font-size: 14px;
  font-weight: 600;
}

.template-content h5:first-of-type {
  margin-top: 0;
}

.template-section {
  margin-bottom: 16px;
}

.template-section code {
  display: block;
  background: #fff;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.4;
  color: #333;
}

/* Template Examples */
.template-examples {
  margin-top: 8px;
}

.template-pair {
  display: block;
  padding: 8px 12px;
  margin-bottom: 4px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.4;
}

.template-pair:hover {
  background: #f0f8ff;
  border-color: #007bff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.template-pair:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 123, 255, 0.2);
}

.template-pair strong {
  color: #007bff;
  font-weight: 600;
}

.template-note {
  margin-top: 16px;
  padding: 8px 12px;
  background: #e8f4fd;
  border: 1px solid #bee5eb;
  border-radius: 4px;
  color: #0c5460;
  font-size: 13px;
  font-style: italic;
}

/* Project Form Validation States */
.project-form .form-control.is-valid {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.project-form .form-control.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.project-form .invalid-feedback {
  display: block;
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

.project-form .valid-feedback {
  display: block;
  color: #10b981;
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

/* Custom Shortcode Field Styles */
.custom-shortcode-group {
  position: relative;
}

.custom-shortcode-group .form-control {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.custom-shortcode-group .form-control.is-valid {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.custom-shortcode-group .form-control.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.custom-shortcode-group .validation-feedback {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  display: none;
}

.custom-shortcode-group .validation-feedback.valid-feedback {
  display: block;
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.custom-shortcode-group .validation-feedback.invalid-feedback {
  display: block;
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.custom-shortcode-group .form-text {
  color: #6b7280;
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}

/* Project Card Enhancements */
.project-card .project-url {
  font-size: 12px;
  color: #9ca3af;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: #f9fafb;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
  word-break: break-all;
}

.project-card .project-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #6b7280;
}

.project-card .project-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-card .project-meta-item::before {
  content: '';
  width: 4px;
  height: 4px;
  background: #d1d5db;
  border-radius: 50%;
}

.project-card .project-meta-item:first-child::before {
  display: none;
}

/* Project List Empty State Enhancement */
.empty-state.projects-empty {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  border: 2px dashed #cbd5e1;
}

.empty-state.projects-empty::before {
  content: '📁';
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.empty-state.projects-empty h3 {
  color: #374151;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 600;
}

.empty-state.projects-empty p {
  color: #6b7280;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
}

/* Checkbox group styles */
.checkbox-group {
  margin-bottom: 20px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.checkbox-container input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.checkbox-label {
  margin: 0;
  font-weight: normal;
  color: #666;
  font-size: 14px;
  cursor: pointer;
}

/* Responsive metadata editor */
@media (max-width: 768px) {
  .kv-pair {
    flex-direction: column;
    align-items: stretch;
  }

  .kv-key {
    max-width: none;
  }

  .remove-pair-btn {
    align-self: flex-end;
    margin-top: 8px;
  }
}

/* QR Code Page Styles */
.qr-page-content {
  width: 100%;
  min-height: 100vh;
  background: #f9fafb;
  padding: 24px;
}

.qr-page-header {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.qr-navigation {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qr-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s ease;
}

.qr-back-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
  transform: translateX(-2px);
}

.qr-nav-text {
  font-size: 16px;
  font-weight: 500;
  color: #374151;
}

.qr-title-section {
  flex: 1;
}

.qr-page-title {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
}

.qr-link-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qr-link-title {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
}

.qr-link-url {
  font-size: 16px;
  color: #6b7280;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  word-break: break-all;
  background: #f3f4f6;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.qr-content-area {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 32px;
  align-items: start;
}

.qr-display-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.qr-section-title {
  font-size: 24px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  padding: 32px;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.qr-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

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

.qr-controls-section,
.qr-download-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* URL Parameters panel */
.qr-params-info {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

.qr-params-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qr-param-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}

.qr-param-input {
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
  transition: all 0.2s ease;
  font-family: inherit;
}

.qr-param-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.qr-param-input::placeholder {
  color: #9ca3af;
}

.qr-add-param-btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 2px solid #6366f1;
  background: #6366f1;
  color: white;
  cursor: pointer;
  align-self: flex-start;
}

.qr-add-param-btn:hover {
  background: #5855eb;
  border-color: #5855eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.qr-remove-param-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid #ef4444;
  border-radius: 8px;
  background: #ef4444;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-remove-param-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.qr-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.qr-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qr-control-label {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
}

.qr-range-input,
.qr-select-input {
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
  transition: all 0.2s ease;
}

.qr-range-input:focus,
.qr-select-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.qr-color-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.qr-color-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qr-color-input {
  width: 100%;
  height: 50px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  transition: border-color 0.2s ease;
}

.qr-color-input:hover {
  border-color: #d1d5db;
}

.qr-color-input::-webkit-color-swatch-wrapper {
  padding: 4px;
}

.qr-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.qr-download-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qr-download-btn {
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.qr-download-btn.btn-primary {
  background: #6366f1;
  color: white;
}

.qr-download-btn.btn-primary:hover {
  background: #5855eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.qr-download-btn.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 2px solid #e5e7eb;
}

.qr-download-btn.btn-secondary:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* QR Code Page Responsive Design */
@media (max-width: 1024px) {
  .qr-content-area {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .qr-controls-section,
  .qr-download-section {
    order: 2;
  }

  .qr-display-section {
    order: 1;
  }
}

@media (max-width: 768px) {
  .qr-page-content {
    padding: 16px;
  }

  .qr-page-header {
    padding: 20px;
    gap: 20px;
  }

  .qr-page-title {
    font-size: 28px;
  }

  .qr-display-section,
  .qr-controls-section,
  .qr-download-section {
    padding: 20px;
  }

  .qr-container {
    min-height: 280px;
    padding: 20px;
  }

  .qr-color-controls {
    grid-template-columns: 1fr;
  }

  .qr-download-buttons {
    gap: 12px;
  }
}

/* Well-Known Files Styles */
.well-known-container {
  padding: 20px;
}

.well-known-header {
  margin-bottom: 30px;
}

.well-known-title-section h2 {
  font-size: 28px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.well-known-subtitle {
  color: #666;
  font-size: 16px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.well-known-subtitle code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
}

.well-known-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.well-known-files {
  padding: 20px;
}

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #666;
}

.loading-indicator .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.files-container {
  display: grid;
  gap: 16px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 16px;
  line-height: 1.5;
}

.file-card {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 20px;
  background: #fafafa;
  transition: all 0.2s ease;
}

.file-card:hover {
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.file-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.file-info h4 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.file-url {
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  color: #495057;
  display: inline-block;
  margin-bottom: 8px;
}

.file-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}

.file-type {
  background: #6c757d;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.file-status {
  font-size: 14px;
  font-weight: 500;
}

.file-status.enabled {
  color: #28a745;
}

.file-status.disabled {
  color: #dc3545;
}

.file-actions {
  display: flex;
  gap: 8px;
}

.file-content {
  border-top: 1px solid #e5e5e5;
  padding-top: 16px;
}

.content-preview {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 12px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.4;
  color: #495057;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

/* Well-Known Form Styles */
.well-known-form {
  max-width: 600px;
}

.well-known-form .form-group {
  margin-bottom: 20px;
}

.well-known-form .form-label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.well-known-form .form-input,
.well-known-form .form-select,
.well-known-form .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.well-known-form .form-input:focus,
.well-known-form .form-select:focus,
.well-known-form .form-textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.well-known-form .form-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.well-known-form .form-help {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
  line-height: 1.4;
}

.well-known-form .form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.well-known-form .form-checkbox-label input[type="checkbox"] {
  width: auto;
}

.well-known-form .form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
}

/* Responsive Design for Well-Known */
@media (max-width: 768px) {
  .well-known-container {
    padding: 16px;
  }

  .file-card-header {
    flex-direction: column;
    gap: 16px;
  }

  .file-actions {
    align-self: flex-start;
  }

  .well-known-form .form-actions {
    flex-direction: column;
  }
}
