/* === RESET & BASE === */
.interlinko-app {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
}
.interlinko-app * {
  box-sizing: border-box;
}

/* === LAYOUT === */
.interlinko-app {
  max-width: 1100px;
  margin: 20px auto 20px 0;
  padding: 0 20px;
}

/* === HEADER === */
.ilk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 30px;
  background: #12063d;
  border-radius: 16px;
  margin-bottom: 25px;
}
.ilk-header-left h1 {
  margin: 0;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ilk-header-left h1 span {
  font-size: 32px;
}
.ilk-header-left p {
  margin: 8px 0 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}
.ilk-header-stats {
  display: flex;
  gap: 20px;
}
.ilk-stat-box {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 12px 20px;
  border-radius: 10px;
  text-align: center;
  min-width: 100px;
}
.ilk-stat-box .number {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}
.ilk-stat-box .label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === NAVIGATION TABS === */
.ilk-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 25px;
  padding-bottom: 0;
}
.ilk-nav-btn {
  padding: 14px 24px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  position: relative;
  bottom: -2px;
  border-bottom: 2px solid transparent;
}
.ilk-nav-btn:hover {
  color: #374151;
  background: #f9fafb;
}
.ilk-nav-btn.active {
  color: #667eea;
  background: #fff;
}
.ilk-nav-btn svg {
  margin-right: 8px;
  vertical-align: -2px;
}

/* === PANELS === */
.ilk-panel {
  display: none;
}
.ilk-panel.active {
  display: block;
}

/* === CARDS === */
.ilk-card {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}
.ilk-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ilk-card-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}
.ilk-card-body {
  padding: 24px;
}

/* === BUTTONS === */
.ilk-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}
.ilk-btn-primary {
  background: #12063d;
  color: #fff;
}
.ilk-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
  color: #fff;
}
.ilk-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}
.ilk-btn-secondary:hover {
  background: #e5e7eb;
  color: #374151;
}
.ilk-btn-danger {
  background: #fef2f2;
  color: #dc2626;
}
.ilk-btn-danger:hover {
  background: #fee2e2;
}
.ilk-btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
.ilk-btn-icon {
  padding: 8px;
}

/* === ALERTS === */
.ilk-alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.ilk-alert-success {
  background: #ecfdf5;
  color: #065f46;
}
.ilk-alert-info {
  background: #eff6ff;
  color: #1e40af;
}

/* === EMPTY STATE === */
.ilk-empty {
  text-align: center;
  padding: 60px 20px;
}
.ilk-empty-icon {
  width: 80px;
  height: 80px;
  background: #f3f4f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 36px;
}
.ilk-empty h3 {
  margin: 0 0 8px 0;
  color: #374151;
  font-size: 18px;
}
.ilk-empty p {
  margin: 0 0 20px 0;
  color: #6b7280;
}

/* === KEYWORD GRID === */
.ilk-keywords-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.ilk-keyword-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}
.ilk-keyword-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}
.ilk-keyword-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.ilk-keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.ilk-keyword-tag {
  background: #12063d;
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.ilk-keyword-url {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
  word-break: break-all;
}
.ilk-keyword-url a {
  color: #667eea;
  text-decoration: none;
}
.ilk-keyword-url a:hover {
  text-decoration: underline;
}
.ilk-keyword-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
  font-size: 12px;
  color: #6b7280;
}
.ilk-keyword-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ilk-keyword-meta .ilk-stat-active {
  color: #059669;
  font-weight: 600;
}
.ilk-keyword-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.ilk-keyword-card:hover .ilk-keyword-actions {
  opacity: 1;
}
.ilk-keyword-actions button,
.ilk-keyword-actions a {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  text-decoration: none;
}
.ilk-keyword-actions .ilk-btn-edit {
  background: #eff6ff;
  color: #2563eb;
}
.ilk-keyword-actions .ilk-btn-edit:hover {
  background: #dbeafe;
}
.ilk-keyword-actions .ilk-btn-delete {
  background: #fef2f2;
  color: #dc2626;
}
.ilk-keyword-actions .ilk-btn-delete:hover {
  background: #fee2e2;
}

/* === MODAL === */
.ilk-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.ilk-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.ilk-modal {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s;
}
.ilk-modal-overlay.active .ilk-modal {
  transform: scale(1);
}
.ilk-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ilk-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}
.ilk-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: #f3f4f6;
  cursor: pointer;
  font-size: 20px;
  color: #6b7280;
  transition: all 0.2s;
}
.ilk-modal-close:hover {
  background: #e5e7eb;
  color: #374151;
}
.ilk-modal-body {
  padding: 24px;
}
.ilk-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* === FORM === */
.ilk-form-group {
  margin-bottom: 20px;
}
.ilk-form-group:last-child {
  margin-bottom: 0;
}
.ilk-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}
.ilk-label .ilk-required {
  color: #dc2626;
}
.ilk-help {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
}
.ilk-input,
.ilk-textarea,
.ilk-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}
.ilk-input:focus,
.ilk-textarea:focus,
.ilk-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.ilk-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}
.ilk-input-sm {
  padding: 8px 12px;
}
.ilk-input-group {
  display: flex;
  gap: 12px;
}
.ilk-input-group .ilk-form-group {
  flex: 1;
  margin-bottom: 0;
}

/* === CHECKBOX/TOGGLE === */
.ilk-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.ilk-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
}

/* === SETTINGS === */
.ilk-settings-section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}
.ilk-settings-header {
  padding: 16px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ilk-settings-header:hover {
  background: #f3f4f6;
}
.ilk-settings-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #374151;
}
.ilk-settings-header .arrow {
  transition: transform 0.2s;
}
.ilk-settings-section.open .ilk-settings-header .arrow {
  transform: rotate(180deg);
}
.ilk-settings-body {
  padding: 20px;
  display: none;
}
.ilk-settings-section.open .ilk-settings-body {
  display: block;
}

/* === TOOLS GRID === */
.ilk-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.ilk-tool-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.ilk-tool-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #111827;
}
.ilk-tool-card p {
  margin: 0 0 16px 0;
  font-size: 13px;
  color: #6b7280;
}
.ilk-tool-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* === PREVIEW === */
.ilk-preview-result {
  margin-top: 20px;
  padding: 20px;
  background: #f9fafb;
  border-radius: 8px;
  display: none;
}
.ilk-preview-result.active {
  display: block;
}
.ilk-preview-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}
.ilk-preview-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  max-height: 400px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
}
.ilk-preview-content a {
  background: #fef3c7;
  padding: 2px 6px;
  border-radius: 4px;
  color: #92400e;
  text-decoration: none;
  border-bottom: 2px solid #f59e0b;
}

/* === TARGET OPTIONS === */
.ilk-target-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.ilk-target-tab {
  padding: 10px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s;
}
.ilk-target-tab:hover {
  border-color: #667eea;
  color: #667eea;
}
.ilk-target-tab.active {
  background: #667eea;
  border-color: #667eea;
  color: #fff;
}
.ilk-target-content {
  display: none;
}
.ilk-target-content.active {
  display: block;
}

/* === CATEGORY GRID === */
.ilk-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding: 4px;
}
.ilk-cat-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.ilk-cat-item:hover {
  border-color: #667eea;
}
.ilk-cat-item input {
  margin-right: 10px;
}
.ilk-cat-item.checked {
  background: #eff6ff;
  border-color: #667eea;
}

/* === SEARCH AUTOCOMPLETE === */
.ilk-search-wrap {
  position: relative;
}
.ilk-search-input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}
.ilk-search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.ilk-search-icon {
  position: absolute;
  left: 14px;
  top: 12px;
  color: #9ca3af;
  pointer-events: none;
  z-index: 1;
}
.ilk-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  margin-top: 4px;
}
.ilk-search-results.active {
  display: block;
}
.ilk-search-result {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  border-bottom: 1px solid #f3f4f6;
}
.ilk-search-result:last-child {
  border-bottom: none;
}
.ilk-search-result:hover {
  background: #f9fafb;
}
.ilk-search-result .type {
  color: #6b7280;
  font-size: 12px;
}
.ilk-search-empty,
.ilk-search-no-results {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}
.ilk-search-loading {
  padding: 15px;
  text-align: center;
  color: #6b7280;
}

/* === SELECTED ITEMS (TAGS) === */
.ilk-selected-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  min-height: 20px;
}
.ilk-selected-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #eff6ff;
  border: 1px solid #667eea;
  border-radius: 20px;
  font-size: 13px;
  color: #374151;
}
.ilk-selected-item .remove {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  transition: background 0.2s;
}
.ilk-selected-item .remove:hover {
  background: #4f46e5;
}
.ilk-hidden-inputs {
  display: none;
}
.ilk-no-selection {
  color: #9ca3af;
  font-size: 13px;
  font-style: italic;
}

/* === UTILITY CLASSES === */
.ilk-padding-sm {
  padding: 8px;
}
.ilk-mt-sm {
  margin-top: 10px;
}
.ilk-mb-sm {
  margin-bottom: 10px;
}
.ilk-mb-md {
  margin-bottom: 16px;
}
.ilk-mt-md {
  margin-top: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 782px) {
  .ilk-header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  .ilk-header-stats {
    justify-content: center;
  }
  .ilk-keywords-grid {
    grid-template-columns: 1fr;
  }
  .ilk-input-group {
    flex-direction: column;
  }
  .ilk-tools-grid {
    grid-template-columns: 1fr;
  }
  .ilk-nav {
    overflow-x: auto;
  }
}
