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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --background: #f9fafb;
  --surface: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 1.5rem 3rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
}

.header-icon {
  width: 2rem;
  height: 2rem;
}

.subtitle {
  font-size: 0.95rem;
  opacity: 0.9;
}

.container {
  max-width: 95%;
  width: 100%;
  margin: 2rem auto;
  padding: 0 3rem;
  flex: 1;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  min-height: calc(100vh - 250px);
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  position: sticky;
  top: 2rem;
  align-self: flex-start;
}

.left-panel::-webkit-scrollbar {
  width: 8px;
}

.left-panel::-webkit-scrollbar-track {
  background: var(--background);
  border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (max-width: 1400px) {
  .container {
    max-width: 95%;
    padding: 0 2.5rem;
  }
}

@media (max-width: 1400px) {
  .container {
    padding: 0 2rem;
  }
  
  .layout {
    gap: 2.5rem;
  }
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
  
  .left-panel {
    position: relative;
    top: auto;
    max-height: none;
  }
}

.card {
  background: var(--surface);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 0;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}


.card-body {
  padding: 2rem 2.25rem;
}

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

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.2s;
  background: var(--surface);
}

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

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

.password-toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: all 0.2s;
  border-radius: 0.25rem;
}

.password-toggle:hover {
  background: var(--background);
  color: var(--text);
}

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

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.help-text {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.upload-container {
  margin-bottom: 1.5rem;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: 0.75rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--surface);
}

.upload-area:hover {
  border-color: var(--primary);
  background: #faf5ff;
}

.upload-area.active {
  border-color: var(--success);
  background: #f0fdf4;
}

.upload-icon {
  margin-bottom: 0.75rem;
  display: block;
}

.upload-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--primary);
}

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

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

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

.file-info {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--background);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: var(--text);
}

.hidden {
  display: none !important;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  padding: 1.25rem 2rem;
  border-radius: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.3s;
  box-shadow: var(--shadow);
  letter-spacing: 0.5px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.status-card {
  background: var(--surface);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.status-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
}

.status-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.status-text {
  font-size: 1rem;
  font-weight: 500;
}

.status-card.loading {
  background: #eff6ff;
  color: #1e40af;
  border-left: 4px solid #3b82f6;
}

.status-card.success {
  background: #f0fdf4;
  color: #166534;
  border-left: 4px solid var(--success);
}

.status-card.error {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid var(--error);
}

.preview-container {
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
}

.preview-image {
  width: 100%;
  display: block;
  max-height: 800px;
  object-fit: contain;
  background: var(--background);
  border-radius: 0.5rem;
}

.preview-placeholder {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-light);
}

.placeholder-icon {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.placeholder-icon svg {
  width: 4rem;
  height: 4rem;
  color: var(--text-light);
}

.placeholder-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.placeholder-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.placeholder-hint {
  font-size: 0.95rem;
  color: var(--text-light);
  margin: 0;
}

.results-summary {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

.results-count {
  font-size: 2rem;
  font-weight: 700;
  color: var(--success);
  display: block;
}

.results-label {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.names-list {
  list-style: none;
  max-height: 550px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.75rem;
  display: block;
  padding-left: 0;
}

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

.names-list::-webkit-scrollbar-track {
  background: var(--background);
  border-radius: 4px;
}

.names-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.names-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

.names-list li {
  background: var(--background);
  padding: 0.875rem 1.25rem;
  margin-bottom: 0.5rem;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  border-left: 4px solid var(--primary);
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex-shrink: 0;
}

.names-list li:hover {
  transform: translateX(4px);
  background: #f3f4f6;
}

.names-list li::before {
  content: "";
}

.names-list li .star-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: #fbbf24;
}

.footer {
  background: var(--text);
  color: white;
  text-align: center;
  padding: 2rem;
  margin-top: auto;
}

.footer p {
  font-size: 0.9rem;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .header {
    padding: 1.25rem 2rem;
  }

  .header h1 {
    font-size: 1.75rem;
  }

  .header-icon {
    width: 1.75rem;
    height: 1.75rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .container {
    padding: 0 1.5rem;
    margin: 2rem auto;
  }

  .card-header {
    padding: 1.25rem 1.5rem;
  }

  .card-body {
    padding: 1.5rem;
  }

  .preview-container {
    min-height: 350px;
  }

  .placeholder-icon svg {
    width: 3rem;
    height: 3rem;
  }

  .placeholder-title {
    font-size: 1rem;
  }

  .placeholder-hint {
    font-size: 0.85rem;
  }

  .upload-text {
    font-size: 1rem;
  }

  .upload-hint {
    font-size: 0.8rem;
  }

  .layout {
    gap: 2rem;
  }

  .left-panel {
    gap: 2rem;
  }

  .right-panel {
    gap: 2rem;
  }
}

