/* 
 * MeshDresden - Modern UI v2.0
 * Modernes, cleanes Design
 */

:root {
  /* Moderne Farbpalette */
  --meshdd-primary: #3b82f6;      /* Modernes Blau */
  --meshdd-primary-dark: #2563eb;
  --meshdd-secondary: #64748b;
  --meshdd-accent: #06b6d4;       /* Cyan Accent */
  --meshdd-success: #10b981;
  --meshdd-danger: #ef4444;
  --meshdd-warning: #f59e0b;
  --meshdd-info: #06b6d4;
  
  /* Hintergrund */
  --meshdd-bg-start: #f1f5f9;     /* Hell Grau-Blau */
  --meshdd-bg-end: #e2e8f0;       /* Grau-Blau */
  
  /* UI-Elemente */
  --meshdd-card-bg: #ffffff;
  --meshdd-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --meshdd-card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --meshdd-border-radius: 0.75rem;
  --meshdd-navbar-height: 64px;
}

/* Layout */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

body {
  background: linear-gradient(135deg, var(--meshdd-bg-start) 0%, var(--meshdd-bg-end) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar - Modern & Flat */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 0.75rem 0;
  min-height: var(--meshdd-navbar-height);
  z-index: 1030;
  border-bottom: 1px solid #e5e7eb;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--meshdd-primary) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand i {
  color: var(--meshdd-accent);
  font-size: 1.75rem;
}

.version-badge {
  font-size: 0.65rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  background: linear-gradient(135deg, var(--meshdd-primary) 0%, var(--meshdd-accent) 100%);
  color: white !important;
  font-weight: 600;
  margin-left: 0.5rem;
}

.navbar-nav .nav-link {
  color: var(--meshdd-secondary) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
  color: var(--meshdd-primary) !important;
  background: #f1f5f9;
}

.navbar-nav .nav-link i {
  margin-right: 0.375rem;
}

/* Main Content */
main.container {
  flex: 1;
  padding-top: calc(var(--meshdd-navbar-height) + 2rem);
  padding-bottom: 2rem;
  max-width: 1200px;
}

/* Cards - Modern Design */
.card {
  background: var(--meshdd-card-bg);
  border: 1px solid #e5e7eb;
  border-radius: var(--meshdd-border-radius);
  box-shadow: var(--meshdd-card-shadow);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

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

.card-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: var(--meshdd-secondary);
}

.card-header h5 {
  margin: 0;
  font-size: 1.125rem;
  color: #1e293b;
}

.card-body {
  padding: 1rem;
}

.card-footer {
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  padding: 1rem 1.5rem;
}

/* Buttons - Modern & Flat */
.btn {
  border-radius: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  font-size: 0.9375rem;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--meshdd-primary) 0%, var(--meshdd-primary-dark) 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--meshdd-primary-dark) 0%, var(--meshdd-primary) 100%);
  color: white;
}

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

.btn-secondary:hover {
  background: #475569;
  color: white;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

/* Forms - Modern Input Design */
.form-control, .form-select {
  border-radius: 0.5rem;
  border: 2px solid #e5e7eb;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--meshdd-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: #94a3b8;
}

.form-label {
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.form-text {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.375rem;
}

/* Tables - Clean & Modern */
.table {
  background: white;
  border-radius: var(--meshdd-border-radius);
  overflow: hidden;
  box-shadow: var(--meshdd-card-shadow);
}

.table th {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  padding: 1rem 0.75rem;
  border: none;
}

.table td {
  padding: 0.875rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

.table tbody tr {
  transition: all 0.15s ease;
}

.table tbody tr:hover {
  background: #f8fafc;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Alerts - Modern Style */
.alert {
  border-radius: 0.75rem;
  border: none;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  box-shadow: var(--meshdd-card-shadow);
}

.alert-info {
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  color: #075985;
  border-left: 4px solid var(--meshdd-info);
}

.alert-success {
  background: linear-gradient(135deg, #d1fae5 0%, #dcfce7 100%);
  color: #065f46;
  border-left: 4px solid var(--meshdd-success);
}

.alert-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
  color: #92400e;
  border-left: 4px solid var(--meshdd-warning);
}

.alert-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-left: 4px solid var(--meshdd-danger);
}

/* Badges */
.badge {
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-weight: 600;
  font-size: 0.8125rem;
}

.badge.bg-secondary {
  background: var(--meshdd-secondary) !important;
}

/* Code Tags */
code {
  background: #f1f5f9;
  color: #1e293b;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
}

/* Pagination - Modern */
.pagination {
  gap: 0.5rem;
}

.page-item .page-link {
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  color: var(--meshdd-secondary);
  padding: 0.5rem 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.page-item.active .page-link {
  background: linear-gradient(135deg, var(--meshdd-primary) 0%, var(--meshdd-primary-dark) 100%);
  border-color: transparent;
  color: white;
}

.page-item .page-link:hover {
  background: #f1f5f9;
  border-color: var(--meshdd-primary);
  color: var(--meshdd-primary);
}

/* Modal - Hell & Modern */
.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.4) !important;
}

.modal-backdrop.show {
  opacity: 1 !important;
}

.modal-content {
  border-radius: var(--meshdd-border-radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: none;
}

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

.modal-title {
  font-weight: 700;
  color: #1e293b;
  font-size: 1.25rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  color: #475569;
  line-height: 1.6;
}

.modal-body strong {
  color: #1e293b;
  font-weight: 600;
}

.modal-body ul {
  padding-left: 1.5rem;
  color: #64748b;
}

.modal-body ul li {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.modal-footer {
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  padding: 1rem 1.5rem;
}

/* Footer - Modern & Clean */
footer {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 0.7rem 0;
  margin-top: auto;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

footer p {
  margin: 0;
  color: #64748b;
  font-size: 0.875rem;
}

footer p:first-child {
  color: #1e293b;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Headings - Modern Typography */
h1 {
  font-weight: 800;
  color: #0f172a;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

h1 i {
  color: var(--meshdd-accent);
  margin-right: 0.5rem;
}

h2, h3, h4, h5 {
  color: #1e293b;
  font-weight: 700;
}

/* Icons */
.bi {
  transition: transform 0.2s ease;
}

.btn:hover .bi,
.nav-link:hover .bi {
  transform: scale(1.1);
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background: rgba(59, 130, 246, 0.2);
  color: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .btn-lg {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.alert {
  animation: fadeIn 0.4s ease-out;
}

/* Loading States */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Focus States - Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 3px solid rgba(59, 130, 246, 0.3);
  outline-offset: 2px;
}

/* Utility Classes */
.text-muted {
  color: #64748b !important;
}

.text-center {
  text-align: center;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
