/* 
 * Minecraft DataSync Portal
 * Modernisiertes Design - Haupt-Stylesheet
 * Version 2.0 - August 2025
 */

:root {
  /* Farbpalette */
  --bg-dark: #0b1020;
  --bg-panel: #111836;
  --bg-card: #161f40;
  --bg-card-hover: #1a2550;
  --bg-input: #0f142e;
  
  --border-main: #2a335a;
  --border-light: #374175;
  --border-highlight: #4353a1;
  
  --text-primary: #eef2ff;
  --text-secondary: #c7d2fe;
  --text-muted: #9aa5d1;
  --text-dim: #6b7db8;
  
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;
  --accent-yellow: #f59e0b;
  --accent-purple: #8b5cf6;
  
  /* Abgerundete Ecken */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* Schatten */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
  
  /* Animation */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  
  /* Layout */
  --container-padding: 24px;
  --header-height: 64px;
  --footer-height: 60px;
}

/* Basis-Styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
}

/* Layout */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-wrapper {
  flex: 1;
  padding: var(--container-padding);
}

/* Header */
header {
  height: var(--header-height);
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-main);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--container-padding);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-size: 24px;
}

h1 {
  font-size: 20px;
  font-weight: 600;
}

/* Navigation */
nav {
  display: flex;
  gap: 8px;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
  font-weight: 500;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

nav a.active {
  background-color: var(--accent-blue);
  color: white;
}

/* Container & Cards */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-main);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  gap: 8px;
}

.btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-blue-hover);
  border-color: var(--accent-blue-hover);
}

.btn-success {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

.btn-success:hover {
  background-color: var(--accent-green-hover);
  border-color: var(--accent-green-hover);
}

.btn-danger {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

.btn-danger:hover {
  background-color: var(--accent-red-hover);
  border-color: var(--accent-red-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 10px 20px;
  font-size: 16px;
}

.btn-icon {
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Icons */
.icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 22px;
  height: 22px;
}

/* Formulare */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  transition: border-color var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.form-help {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Tabellen */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 24px;
}

th, td {
  padding: 12px 16px;
  text-align: left;
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-main);
}

tr:first-child th:first-child {
  border-top-left-radius: var(--radius-md);
}

tr:first-child th:last-child {
  border-top-right-radius: var(--radius-md);
}

td {
  border-bottom: 1px solid var(--border-main);
}

tbody tr:hover {
  background-color: var(--bg-card-hover);
}

.table-container {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-main);
  overflow: hidden;
}

/* Status Indicators */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Source-Badges */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}

.source-web {
  background-color: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.source-game {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.source-sync {
  background-color: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-100 { width: 100%; }
.muted { color: var(--text-muted); }

/* Dialoge */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.dialog {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
  animation: dialogFadeIn 0.25s ease;
}

@keyframes dialogFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-main);
}

.dialog-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.dialog-content {
  padding: 20px;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px;
  gap: 12px;
  border-top: 1px solid var(--border-main);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.close-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-main);
  margin-bottom: 20px;
}

.tab-button {
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  transition: color var(--transition-fast);
}

.tab-button:hover {
  color: var(--text-secondary);
}

.tab-button.active {
  color: var(--text-primary);
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent-blue);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Status Messages */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background-color: var(--bg-input);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.status-success {
  background-color: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--accent-green);
}

.status-error {
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--accent-red);
}

.status-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--accent-yellow);
}

.status-info {
  background-color: rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--accent-blue);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-blue);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Minecraft Spezifische Styles */
.head {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  border-radius: var(--radius-sm);
  display: block;
}

.head-sm {
  width: 24px;
  height: 24px;
}

/* Inventory Styles */
.inv-root {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.inv-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 16px;
}

.inv-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.slot {
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.slot img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.slot .amt {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-weight: 700;
  font-size: 11px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
}

.grid-9x3 {
  display: grid;
  grid-template-columns: repeat(9, 40px);
  grid-auto-rows: 40px;
  gap: 4px;
}

.grid-9x1 {
  display: grid;
  grid-template-columns: repeat(9, 40px);
  grid-auto-rows: 40px;
  gap: 4px;
}

/* Ausrüstung */
.equip-grid {
  display: grid;
  grid-template-columns: repeat(5, 40px);
  grid-auto-rows: 40px;
  gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --container-padding: 16px;
  }
  
  .card {
    padding: 16px;
  }
  
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .grid-9x3, .grid-9x1 {
    grid-template-columns: repeat(auto-fill, 40px);
  }
  
  nav {
    gap: 4px;
  }
  
  nav a {
    padding: 6px 10px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  header {
    flex-direction: column;
    height: auto;
    padding: 12px var(--container-padding);
    gap: 12px;
  }
  
  .dialog {
    max-width: 100%;
  }
}
