/* HyperFind - Discord-style Theme */

:root {
  /* Discord colors */
  --bg-primary: #313338;
  --bg-secondary: #2b2d31;
  --bg-tertiary: #1e1f22;
  --bg-floating: #232428;
  --bg-mod-subtle: #3f4248;

  --text-primary: #f2f3f5;
  --text-secondary: #b5bac1;
  --text-muted: #949ba4;
  --text-link: #00a8fc;

  --accent: #5865f2;
  --accent-hover: #4752c4;
  --accent-active: #3c45a5;

  --green: #23a559;
  --green-hover: #1a7d41;
  --red: #da373c;
  --yellow: #f0b232;

  --border-subtle: #3f4147;
  --border-strong: #4e5058;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 16px 24px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.375;
  font-size: 16px;
}

.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
}

/* Sections */
.section {
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

/* Main Button - Discord style */
.main-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 1rem;
  font-weight: 500;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.17s ease, transform 0.1s ease;
}

.main-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.main-btn:active:not(:disabled) {
  background: var(--accent-active);
  transform: scale(0.98);
}

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

.btn-icon {
  font-size: 1.25rem;
}

/* Secondary Button */
.secondary-btn {
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--bg-mod-subtle);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.17s ease;
}

.secondary-btn:hover {
  background: var(--border-strong);
}

/* Text Button */
.text-btn {
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-link);
  background: none;
  border: none;
  cursor: pointer;
  transition: text-decoration 0.1s ease;
}

.text-btn:hover {
  text-decoration: underline;
}

/* Recording State */
#recording-state {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.pulse-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--red);
  margin: 0 auto 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1.5s ease-in-out infinite;
}

.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 3px solid var(--red);
  animation: ripple 1.5s ease-out infinite;
  opacity: 0.6;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes ripple {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.countdown {
  font-size: 2rem;
  font-weight: 700;
  color: white;
}

#recording-state > p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.875rem;
}

/* Processing State */
#processing-state {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 0.8s linear infinite;
}

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

#processing-state > p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Result Card */
.result-card,
.not-found-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

#result-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.artist {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.score {
  display: inline-block;
  padding: 4px 12px;
  background: var(--green);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.link-btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
  transition: background-color 0.17s ease;
}

.link-btn:hover {
  background: var(--accent-hover);
}

.alternatives {
  text-align: left;
  margin: 16px 0;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
}

.alt-header {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

#alt-list {
  list-style: none;
}

#alt-list li {
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

#alt-list li + li {
  border-top: 1px solid var(--border-subtle);
}

.result-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Not Found */
.not-found-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.not-found-hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

/* Expand Button - Discord style */
.expand-btn {
  width: 100%;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.17s ease;
}

.expand-btn:hover {
  background: var(--bg-mod-subtle);
}

.expand-btn .arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.expand-btn.active .arrow {
  transform: rotate(180deg);
}

/* Form Container */
.form-container {
  background: var(--bg-secondary);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 16px;
  margin-top: 2px;
}

.form-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.form-group input[type="text"],
.form-group input[type="url"] {
  width: 100%;
  padding: 12px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: box-shadow 0.2s ease;
}

.form-group input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

/* Drop Zone - Discord file upload style */
.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  background: var(--bg-tertiary);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(88, 101, 242, 0.1);
}

.drop-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 4px;
}

.browse-link {
  color: var(--text-link);
}

.file-types {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* File Info */
.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-top: 8px;
}

#file-name {
  color: var(--text-primary);
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--red);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.17s ease;
}

.remove-btn:hover {
  background: #a12828;
}

/* Fingerprint Status */
.fingerprint-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(35, 165, 89, 0.1);
  border-radius: var(--radius-md);
  color: var(--green);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.status-icon {
  font-size: 1rem;
}

/* Error & Success Text */
.error-text {
  color: var(--red);
  font-size: 0.875rem;
  margin-top: 12px;
  padding: 12px;
  background: rgba(218, 55, 60, 0.1);
  border-radius: var(--radius-md);
}

.success-text {
  color: var(--green);
  font-size: 0.875rem;
  margin-top: 12px;
  padding: 12px;
  background: rgba(35, 165, 89, 0.1);
  border-radius: var(--radius-md);
}

/* Privacy Notice - Discord info box style */
.privacy-notice {
  margin-top: auto;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
}

.privacy-notice p {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.privacy-notice strong {
  color: var(--text-primary);
}

/* Footer */
footer {
  text-align: center;
  padding: 16px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Responsive */
@media (min-width: 768px) {
  .container {
    padding: 32px 24px;
  }

  header h1 {
    font-size: 2rem;
  }

  .main-btn {
    padding: 14px 28px;
  }
}

/* Discord-like scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-mod-subtle);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}
