:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #6366f1;
  --accent: #8b5cf6;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --background: #f8fafc;
  --background-alt: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --text-light: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --korea-blue: #003478;
  --korea-red: #c60c30;
  --turkey-red: #e30a17;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: var(--background);
  min-height: 100vh;
  display: flex;
  color: var(--text);
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #5661f0;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 0.375rem;
}

.sidebar {
  width: 280px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 100;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sidebar .logo img {
  width: 32px;
  height: 32px;
}

.sidebar .logo span {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.sidebar nav {
  padding: 1.25rem 0;
  flex: 1;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--text-light);
  font-weight: 500;
  gap: 0.75rem;
  transition: background 0.2s ease, color 0.2s ease;
  position: relative;
}

.sidebar nav a i {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
}

.sidebar nav a:hover, .sidebar nav a.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

.sidebar nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
}

.sidebar .contact-dev {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

.sidebar .contact-dev h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-light);
}

.sidebar .contact-dev a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
  padding: 0.5rem 0;
}

.sidebar .contact-dev a:hover {
  color: var(--primary);
}

.main-content {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 3rem;
}

header {
  padding: 1.5rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stats {
  display: flex;
  gap: 1rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
}

.stat-card i {
  font-size: 1.5rem;
  color: var(--primary);
  padding: 0.875rem;
  border-radius: 0.5rem;
  background: rgba(59, 130, 246, 0.1);
}

.stat-info h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.stat-info p {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

section {
  padding: 2rem;
}

section h2 {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
  gap: 0.75rem;
}

section h2 i {
  color: var(--primary);
}

.card {
  background: var(--surface);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  transition: all 0.2s ease;
}

.form-group input:hover, .form-group select:hover, .form-group textarea:hover {
  border-color: var(--primary);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.backlink-card, .source-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.backlink-card:hover, .source-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.backlink-card .card-header, .source-card .card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.backlink-card .card-header h3, .source-card .card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.backlink-card a, .source-card a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  color: var(--primary);
  word-break: break-all;
}

.backlink-card .anchor-text {
  padding: 0 1.5rem;
  color: var(--text-light);
  font-size: 0.875rem;
}

.backlink-card .description {
  padding: 0.75rem 1.5rem;
  color: var(--text);
  font-size: 0.875rem;
  border-top: 1px solid var(--border-light);
}

.backlink-card .card-footer, .source-card .card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

.backlink-card .card-footer span, .source-card .card-footer span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-light);
}

.delete-btn {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  cursor: pointer;
  transition: all 0.2s ease;
}

.delete-btn:hover {
  background: var(--error);
  color: white;
}

.check-js-btn {
  padding: 0.5rem 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  border: none;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.check-js-btn:hover {
  background: var(--primary);
  color: white;
}

.status-badge {
  display: flex;
  align-items: center;
}

.badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.badge.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.badge.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.badge.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.notification {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateX(calc(100% + 1.5rem));
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.notification.success {
  background: var(--success);
  color: white;
}

.notification.error {
  background: var(--error);
  color: white;
}

.notification.warning {
  background: var(--warning);
  color: white;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.code-block {
  background: #1e293b;
  padding: 1.25rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
  position: relative;
  color: #e2e8f0;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.875rem;
  overflow-x: auto;
}

.code-block code {
  white-space: pre;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border: none;
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.integration-guide {
  background: var(--background-alt);
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

.integration-guide h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.source-card.active {
  border-color: rgba(16, 185, 129, 0.3);
}

.source-card.inactive {
  border-color: rgba(239, 68, 68, 0.3);
}

.source-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.source-form .form-group {
  flex: 1;
  min-width: 250px;
}

.source-form button {
  align-self: flex-end;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tabs button {
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  color: var(--text-light);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.tabs button:hover {
  color: var(--primary);
}

.tabs button.active {
  color: var(--primary);
}

.tabs button.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

table th, table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table th {
  background: var(--background-alt);
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
}

table tr:last-child td {
  border-bottom: none;
}

table tr:hover td {
  background: rgba(241, 245, 249, 0.5);
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  gap: 0.5rem;
}

.pagination button {
  padding: 0.5rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover, .pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 3rem;
  height: 1.5rem;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .4s;
  border-radius: 1.5rem;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.125rem;
  width: 1.125rem;
  left: 0.1875rem;
  bottom: 0.1875rem;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(1.5rem);
}

.traffic-logs {
  max-height: 400px;
  overflow-y: auto;
}

.loading {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-container {
  width: 100%;
  background-color: var(--border);
  border-radius: 0.375rem;
  margin: 1rem 0;
}

.progress-bar {
  height: 0.5rem;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border-radius: 0.375rem;
  transition: width 0.3s ease;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 2rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.heart-kr {
  position: relative;
  display: inline-block;
  color: var(--korea-red);
  font-size: 1.5rem;
  margin: 0 0.5rem;
  transform-origin: center;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.heart-kr:before {
  content: '♥';
  position: absolute;
  left: -3px;
  color: var(--korea-blue);
  opacity: 0;
  animation: pulse-blue 3s ease-in-out infinite;
}

.heart-kr:after {
  content: '♥';
  position: absolute;
  left: 3px;
  color: var(--korea-red);
  opacity: 0;
  animation: pulse-red 3s ease-in-out infinite 1s;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  10%, 90% { transform: scale(1.1); }
  30%, 70% { transform: scale(0.9); }
  50% { transform: scale(1.2); }
}

@keyframes pulse-blue {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

@keyframes pulse-red {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

.turkey-flag {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 16px;
  margin: 0 0.75rem;
  background-color: var(--turkey-red);
  border-radius: 2px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.turkey-flag:hover {
  transform: scale(1.2);
}

.turkey-flag:before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
  transform: translateY(-50%);
}

.turkey-flag:after {
  content: '★';
  position: absolute;
  left: 13px;
  top: 50%;
  color: white;
  font-size: 8px;
  transform: translateY(-50%) translateX(-50%);
}

.easter-egg {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

.easter-egg.show {
  opacity: 1;
  pointer-events: auto;
  z-index: 9999;
}

.konami-mode {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #000 0%, #333 100%);
  color: lime;
  font-family: monospace;
  padding: 2rem;
  z-index: 9999;
  display: none;
  overflow: auto;
}

.konami-mode.active {
  display: block;
}

.konami-text {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  white-space: pre-line;
}

.konami-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  color: lime;
  border: 1px solid lime;
  padding: 0.5rem;
  cursor: pointer;
}

.matrix-effect {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 9998;
  transition: opacity 2s ease;
}

.matrix-effect.show {
  opacity: 0.05;
}

.secret-btn {
  position: fixed;
  width: 10px;
  height: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 9997;
}

.secret-btn.top-left {
  top: 0;
  left: 0;
}

.secret-btn.top-right {
  top: 0;
  right: 0;
}

.secret-btn.bottom-left {
  bottom: 0;
  left: 0;
}

.secret-btn.bottom-right {
  bottom: 0;
  right: 0;
}

.cursor-custom {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23e30a17"><path d="M7,2l12,11.2l-5.8,0.5l3.3,7.3l-2.2,1l-3.2-7.4L7,18.5V2"/></svg>') 0 0, auto;
}

@media (max-width: 1024px) {
  .stats {
    flex-direction: column;
  }
  
  .stat-card {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  header {
    padding: 1rem;
  }
  
  section {
    padding: 1rem;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
}

.mobile-menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: var(--background-alt);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-alt);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}