* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #fff;
}

.subtitle {
  color: #888;
  margin-bottom: 2rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #ccc;
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

input[type="text"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #333;
  border-radius: 6px;
  background-color: #0f0f1a;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: #4a90d9;
}

input[type="text"]::placeholder {
  color: #666;
}

button {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

button:focus {
  outline: 2px solid #4a90d9;
  outline-offset: 2px;
}

#extractBtn {
  background-color: #4a90d9;
  color: #fff;
}

#extractBtn:hover {
  background-color: #3a7bc8;
}

#extractBtn:active {
  transform: scale(0.98);
}

#extractBtn:disabled {
  background-color: #444;
  cursor: not-allowed;
}

.loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  color: #888;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #333;
  border-top-color: #4a90d9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: #3d1f1f;
  border: 1px solid #6b2e2e;
  border-radius: 6px;
  color: #ff6b6b;
}

.results {
  margin-top: 2rem;
}

.results h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #fff;
  word-break: break-word;
}

.link-section {
  margin-bottom: 1.5rem;
}

.link-section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 0.75rem;
}

.link-list {
  list-style: none;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #0f0f1a;
  border: 1px solid #333;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.link-item:last-child {
  margin-bottom: 0;
}

.resolution {
  font-weight: 600;
  color: #4a90d9;
  min-width: 60px;
}

.link-url {
  flex: 1;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.8rem;
  color: #aaa;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-btn {
  background-color: #2a2a3e;
  color: #ccc;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.copy-btn:hover {
  background-color: #3a3a4e;
}

.copy-btn.copied {
  background-color: #1e5631;
  color: #4ade80;
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .container {
    padding: 1.5rem 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .input-group {
    flex-direction: column;
  }

  #extractBtn {
    width: 100%;
  }

  .link-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .resolution {
    min-width: auto;
  }

  .copy-btn {
    width: 100%;
    text-align: center;
  }
}
