:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --danger: #ef4444;
  --success: #10b981;
  --dark: #0f172a;
  --dark-800: #1e293b;
  --gray: #64748b;
  --gray-light: #cbd5e1;
  --light: #f8fafc;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: var(--light);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: 1.8rem;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 540px;
  padding: 2.8rem 2.2rem;
  animation: fadeInUp 1s ease-out forwards;
}

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

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}

.logo-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
  font-size: 2rem;
}

.logo-text {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary), #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-text {
  text-align: center;
  margin-bottom: 2.2rem;
}

.header-text h2 {
  font-size: 1.9rem;
  margin-bottom: 0.6rem;
}

.header-text p {
  color: var(--gray);
  font-size: 1rem;
}

.style-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.6rem;
  margin-bottom: 2rem;
}

.style-list::-webkit-scrollbar {
  width: 8px;
}

.style-list::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.style-item {
  padding: 1.2rem 1.4rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  color: var(--light);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.style-item:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  transform: translateX(10px) scale(1.02);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
}

.style-item.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.5);
  transform: translateX(12px) scale(1.04);
}

.style-item i {
  font-size: 1.4rem;
  color: white;
}

.form-group {
  margin-bottom: 2rem;
}

.form-label {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--gray-light);
}

.file-preview {
  padding: 1rem;
  background: rgba(30, 41, 59, 0.7);
  border-radius: 1rem;
  border: 1px solid var(--glass-border);
  color: var(--light);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-preview i {
  font-size: 2rem;
  color: var(--primary);
}

.file-preview span {
  flex: 1;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.button-group {
  display: flex;
  gap: 1.2rem;
}

.btn {
  flex: 1;
  padding: 1.3rem;
  border-radius: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
  background: var(--dark-700);
  color: var(--gray-light);
}

.btn-secondary:hover {
  background: var(--dark);
  color: white;
}

.btn-copy {
  margin-top: 1rem;
  background: rgba(30, 41, 59, 0.8);
  color: var(--light);
  border: 1px solid var(--glass-border);
}

.btn-copy:hover {
  background: var(--primary);
  color: white;
}

.result-box {
  margin-top: 2.5rem;
  padding: 1.6rem;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 1.2rem;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
}

#resultText {
  width: 100%;
  min-height: 180px;
  padding: 1.3rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 0.9rem;
  color: #a5b4fc;
  font-family: 'Courier New', monospace;
  font-size: 0.97rem;
  resize: vertical;
  line-height: 1.6;
}

.footer {
  margin-top: 3rem;
  text-align: center;
  color: var(--gray);
  font-size: 0.95rem;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Loading */
#loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  font-size: 1.3rem;
}

.spinner {
  border: 6px solid rgba(255,255,255,0.15);
  border-top: 6px solid var(--primary);
  border-radius: 50%;
  width: 70px;
  height: 70px;
  animation: spin 1s linear infinite;
  margin-bottom: 1.2rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
  .container { padding: 2rem 1.5rem; }
  .logo-text { font-size: 1.7rem; }
  .button-group { flex-direction: column; gap: 1rem; }
  }
