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

:root {
  --primary-purple: #8b5cf6;
  --primary-purple-dark: #7c3aed;
  --primary-purple-light: #a78bfa;
  --bg-dark: #0f172a;
  --bg-darker: #0a0f1e;
  --bg-card: #1e293b;
  --bg-card-hover: #293548;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --success-color: #10b981;
  --error-color: #ef4444;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
header {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(10px);
  color: white;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  padding: 1rem 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-purple);
  transition: width 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-purple-light);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Main Content */
main {
  flex: 1;
  padding: 2rem 0;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  font-weight: 800;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.tool-card {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s, border 0.3s;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.tool-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
  border-color: var(--primary-purple);
}

.tool-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

.tool-card h2 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 700;
}

.tool-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
  transform: translateY(-2px);
}

/* Tool Section */
.tool-section {
  max-width: 900px;
  margin: 0 auto;
}

.tool-section h1 {
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
}

.tool-section > p {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* Form Card */
.form-card {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

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

.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.05rem;
}

/* Drag & Drop Upload Area */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(139, 92, 246, 0.05);
  position: relative;
}

.upload-area:hover {
  border-color: var(--primary-purple);
  background: rgba(139, 92, 246, 0.1);
}

.upload-area.drag-over {
  border-color: var(--primary-purple-light);
  background: rgba(139, 92, 246, 0.15);
  border-style: solid;
  transform: scale(1.02);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary-purple-light);
}

.upload-text {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.upload-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.form-group input[type="number"] {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-darker);
  color: var(--text-primary);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input[type="number"]:focus {
  outline: none;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.3s;
  background: var(--bg-darker);
}

.radio-label:hover {
  border-color: var(--primary-purple);
  background: rgba(139, 92, 246, 0.05);
}

.radio-label input[type="radio"] {
  margin-right: 0.75rem;
  cursor: pointer;
  accent-color: var(--primary-purple);
}

.radio-label input[type="radio"]:checked + span {
  font-weight: 600;
  color: var(--primary-purple-light);
}

.radio-label:has(input[type="radio"]:checked) {
  border-color: var(--primary-purple);
  background: rgba(139, 92, 246, 0.1);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* File List */
.file-list {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-darker);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.file-list h3 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 600;
}

.file-list ul {
  list-style: none;
  padding-left: 0;
}

.file-list li {
  padding: 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-list li::before {
  content: '📄';
  font-size: 1.2rem;
}

.file-list li:last-child {
  border-bottom: none;
}

/* Selected Files Display */
.selected-files {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-darker);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.selected-files p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.file-name {
  color: var(--primary-purple-light);
  font-weight: 600;
  font-size: 1rem;
}

/* Results & Alerts */
.result {
  margin-top: 2rem;
}

.alert {
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1px solid;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border-color: var(--success-color);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border-color: var(--error-color);
}

.alert p {
  margin-bottom: 1rem;
}

/* Loading Spinner */
.loading {
  text-align: center;
  padding: 3rem;
}

.spinner {
  border: 4px solid rgba(139, 92, 246, 0.2);
  border-top: 4px solid var(--primary-purple);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Utility Classes */
.hidden {
  display: none;
}

/* Footer */
footer {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(10px);
  color: white;
  text-align: center;
  padding: 1.5rem 0;
  margin-top: auto;
  border-top: 1px solid rgba(139, 92, 246, 0.2);
}

footer p {
  margin: 0;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .upload-area {
    padding: 2rem 1rem;
  }
}
