/* Custom Harmonious Color Tokens */
:root {
  --bg: #07090e;
  --bg-card: rgba(16, 20, 36, 0.65);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #ff4a40;
  
  --text: #eef2f7;
  --text-muted: #94a3b8;
  
  /* Last.fm brand red gradient */
  --brand-gradient: linear-gradient(135deg, #d51007 0%, #ff4a3b 100%);
  --brand-gradient-hover: linear-gradient(135deg, #ff2a20 0%, #ff6b5e 100%);
  --secondary-gradient: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  --secondary-gradient-hover: linear-gradient(135deg, #334155 0%, #475569 100%);
  
  --ok: #10b981;
  --ok-bg: rgba(16, 185, 129, 0.1);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.1);
  --err: #ef4444;
  --err-bg: rgba(239, 68, 68, 0.1);
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 5rem;
}

/* Background Glow Effects */
.background-glows {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: #ff2a20;
  top: -100px;
  right: -100px;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: #3b82f6;
  bottom: -200px;
  left: -200px;
}

/* App Wrapper */
.wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Header Styling */
header {
  text-align: center;
  margin-bottom: 3.5rem;
  animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-area {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.logo-icon {
  width: 2.25rem;
  height: 2.25rem;
}

header h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
}

.sub strong {
  color: #fff;
}

/* Main Cards layout */
main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 2.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Cascade animations for cards */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.badge {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--brand-gradient);
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.card h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.card-desc a {
  color: #818cf8;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed rgba(129, 140, 248, 0.5);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.card-desc a:hover {
  color: #a5b4fc;
  border-bottom-color: #a5b4fc;
}

/* Forms layout */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 74, 64, 0.25);
}

.input-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrap input {
  padding-right: 3rem;
}

.btn-icon {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.btn-icon:hover {
  color: #fff;
}

.icon-eye {
  width: 1.25rem;
  height: 1.25rem;
}

/* Row controls */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.row.align-center {
  align-items: center;
}

/* Buttons */
button {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.7rem 1.5rem;
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateZ(0);
}

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

button.primary {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(213, 16, 7, 0.3);
}

button.primary:hover:not(:disabled) {
  background: var(--brand-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(213, 16, 7, 0.4);
}

button.secondary {
  background: var(--secondary-gradient);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--text);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

button.secondary:hover:not(:disabled) {
  background: var(--secondary-gradient-hover);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

/* Status Notifications */
.status-msg {
  font-size: 0.9rem;
}

.status-msg.muted {
  color: var(--text-muted);
}

.status-msg.ok {
  color: var(--ok);
  font-weight: 500;
}

.status-msg.err {
  color: var(--err);
  font-weight: 500;
}

/* File Upload Grids */
.grid {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 580px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.file-box-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.25rem 1.5rem;
  background: rgba(15, 23, 42, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 190px;
}

.file-box:hover {
  background: rgba(255, 74, 64, 0.03);
  border-color: var(--border-focus);
}

.file-box-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  transition: color 0.3s ease, transform 0.3s ease;
}

.file-box:hover .file-box-icon {
  color: var(--border-focus);
  transform: scale(1.1);
}

.file-box .label {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.file-box .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 240px;
  line-height: 1.4;
}

.file-box input[type="file"] {
  display: none;
}

/* Uploaded file badge listings */
.file-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.file-badge {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Warnings and Alerts */
.alert-box {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.alert-box.warn {
  background-color: var(--warn-bg);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--warn);
}

.alert-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Progress area styling */
.progress-wrap {
  margin-top: 2rem;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: fadeIn 0.4s ease;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.fill {
  height: 100%;
  width: 0%;
  background: var(--brand-gradient);
  border-radius: 5px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Terminal Log Viewers */
.log {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: #0b0c10;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  color: #94a3b8;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 250px;
  overflow-y: auto;
  line-height: 1.5;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.log.hidden,
.progress-wrap.hidden {
  display: none;
}

.log::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.log::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.log::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.log::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Footer elements */
footer {
  text-align: center;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer p {
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Inline typography tweaks */
code {
  font-family: 'Courier New', Courier, monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: #a5b4fc;
}

/* Utility Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
