:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --danger: #ef4444;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --border: #e5e7eb;
  --mark: #fef08a;
  --shadow: rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg-secondary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Typography */
h1, h2, h3, h4 {
  margin-top: 0;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.subtitle {
  color: var(--text-light);
  font-size: 1.125rem;
  margin-top: -0.5rem;
  line-height: 1.6;
}

p {
  line-height: 1.6;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 4rem 0 2rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

/* Landing Page - Suchmaschinen-Optik */
.landing-search {
  max-width: 600px;
  margin: 0 auto 4rem;
}

.landing-search .search-box {
  margin-bottom: 1.5rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Cards */
.card {
  background: var(--bg);
  border-radius: 0.5rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px var(--shadow);
}

.success-card {
  border: 2px solid var(--success);
}

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

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group small {
  display: block;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  line-height: 1.5;
}

input[type="text"],
input[type="url"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 1rem;
  font-family: inherit;
}

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

textarea {
  resize: vertical;
}

.points-input {
  width: 100px;
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  cursor: pointer;
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s;
}

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

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

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-secondary);
  border-color: var(--border);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-full {
  width: 100%;
  text-align: center;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.alert-info {
  background: #f9fafb;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
}

/* Divider */
.divider {
  text-align: center;
  margin: 2rem 0;
  color: var(--text-light);
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

/* Info Boxes */
.info-box {
  margin-bottom: 1.5rem;
}

.info-box label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.copy-box {
  display: flex;
  gap: 0.5rem;
}

.copy-box input {
  flex: 1;
}

.warning-box {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
  color: #78350f;
  line-height: 1.6;
}

/* Search Header */
.search-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  box-shadow: 0 2px 8px var(--shadow);
}

.search-icon {
  font-size: 1.5rem;
}

.search-box input {
  flex: 1;
  border: none;
  padding: 0;
  font-size: 1.125rem;
  font-weight: 500;
  background: none;
}

.search-box input:focus {
  outline: none;
  box-shadow: none;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

/* Actions Bar */
.actions-bar {
  margin-bottom: 2rem;
}

/* Results List */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.result-card {
  background: var(--bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px var(--shadow);
}

.result-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.position {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-light);
}

.result-header h3 {
  flex: 1;
  margin: 0;
  font-size: 1.25rem;
}

.result-header h3 a {
  color: var(--primary);
  text-decoration: none;
}

.result-header h3 a:hover {
  text-decoration: underline;
}

.score {
  font-weight: 600;
  color: var(--success);
  font-size: 1rem;
  margin-left: auto;
}

.result-meta {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.result-description {
  margin: 0.75rem 0;
  color: var(--text);
  line-height: 1.6;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Breakdown Panel */
.breakdown-panel {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 0.375rem;
  border: 1px solid var(--border);
}

.breakdown-panel h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.breakdown-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.breakdown-item:last-child {
  border-bottom: none;
}

.breakdown-check {
  font-weight: 600;
  width: 1.5rem;
}

.breakdown-label {
  flex: 1;
}

.breakdown-points {
  font-weight: 500;
  color: var(--success);
}

.breakdown-total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
  text-align: right;
  font-size: 1.125rem;
}

/* Article View */
.article-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.article-actions {
  display: flex;
  gap: 0.5rem;
}

.article-view {
  background: var(--bg);
  border-radius: 0.5rem;
  padding: 2.5rem;
  box-shadow: 0 1px 3px var(--shadow);
}

.article-meta {
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.article-image {
  margin: 2rem 0;
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-secondary);
}

.article-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-credit {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.4;
  border-top-left-radius: 0.375rem;
  backdrop-filter: blur(4px);
}

.image-credit a {
  color: white;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

.image-credit a:hover {
  text-decoration-color: white;
}

.article-body {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.article-body mark {
  background: var(--mark);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

.article-links {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 0.375rem;
}

.article-links h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.article-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-links li {
  margin-bottom: 0.5rem;
}

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

.article-links a:hover {
  text-decoration: underline;
}

.article-footer {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* Article Checkbox List */
.articles-list {
  margin: 1.5rem 0;
}

.article-checkbox-item {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  margin-bottom: 0.75rem;
  background: var(--bg-secondary);
}

.article-checkbox-item label {
  display: flex;
  gap: 1rem;
  cursor: pointer;
  align-items: start;
}

.article-checkbox-item input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.checkbox-content {
  flex: 1;
}

.checkbox-content strong {
  display: block;
  margin-bottom: 0.25rem;
}

.checkbox-content small {
  color: var(--text-light);
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

/* Settings Table */
.settings-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.settings-table th {
  text-align: left;
  padding: 0.75rem;
  background: var(--bg-secondary);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.settings-table td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.settings-table small {
  display: block;
  color: var(--text-light);
  margin-top: 0.25rem;
  font-weight: normal;
  line-height: 1.5;
}

.settings-table input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--bg);
  border-radius: 0.5rem;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-large {
  max-width: 800px;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* Unsplash Grid */
.unsplash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  max-height: 400px;
  overflow-y: auto;
}

.unsplash-item {
  position: relative;
  border-radius: 0.375rem;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
}

.unsplash-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.unsplash-item:hover img {
  transform: scale(1.05);
}

.unsplash-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: white;
  padding: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s;
}

.unsplash-item:hover .unsplash-overlay {
  opacity: 1;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
  line-height: 1.6;
}

.empty-state h2 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* Footer */
.footer {
  margin-top: auto;
  padding: 2rem 0;
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  line-height: 1.5;
}

.footer p {
  margin: 0.25rem 0;
}

.footer a {
  color: inherit;
  text-decoration: none;
}

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

/* Utilities */
.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .search-header {
    flex-direction: column;
  }
  
  .search-box {
    width: 100%;
  }
  
  .result-header {
    flex-wrap: wrap;
  }
  
  .article-view {
    padding: 1.5rem;
  }
  
  .settings-table {
    font-size: 0.875rem;
  }
  
  .settings-table th,
  .settings-table td {
    padding: 0.5rem;
  }
  
  .points-input {
    width: 80px;
  }
  
  .unsplash-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
