/* Modern Professional Design */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #7c3aed;
  --accent: #c026d3;
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;
  --background: #f1f5f9;
  --surface: #ffffff;
  --panel: #f8fafc;
  --border: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #64748b;
  --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);
  --radius: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --secondary: #8b5cf6;
  --accent: #d946ef;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --background: #0f172a;
  --surface: #1e293b;
  --panel: #334155;
  --border: #475569;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  background-color: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

/* Panels & Cards */
.panel {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.panel-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

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

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 2rem;
  opacity: 0.9;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  background-color: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.feature-card h3 {
  color: var(--primary);
  margin: 1rem 0;
}

.quicklink-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
  background-color: #6d28d9;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

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

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

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

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* Lists */
.list-group {
  list-style: none;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

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

.list-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.list-item a:hover {
  text-decoration: underline;
}

.quicklink-item {
  flex: 1;
}

.quicklink-item a {
  display: block;
  margin-bottom: 0.25rem;
}

.quicklink-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.quicklink-actions {
  display: flex;
  align-items: center;
}

/* Tables & Data Display */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background-color: var(--panel);
  font-weight: 600;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-secondary);
}

.mb-2 {
  margin-bottom: 1rem;
}

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

.d-flex {
  display: flex;
}

.justify-content-between {
  justify-content: space-between;
}

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

.gap-1 {
  gap: 0.5rem;
}

.hidden {
  display: none;
}

/* Footer */
footer {
  background-color: var(--surface);
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero {
    padding: 2rem 1rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .panel-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .features {
    grid-template-columns: 1fr;
  }
}

/* Modal Styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: var(--surface);
  margin: auto;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  width: 90%;
  max-width: 800px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow: hidden;
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close {
  color: var(--text-secondary);
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

/* Wiki Page Viewer Styles */
#wiki-page-viewer {
  padding: 2rem 1rem;
  min-height: calc(100vh - 4rem);
  display: block;
  overflow: visible;
}

.wiki-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  overflow: visible;
}

.wiki-header h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--text);
}

.wiki-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  display: block;
  overflow: visible;
}

.wiki-content h1, .wiki-content h2, .wiki-content h3 {
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.wiki-content p {
  margin-bottom: 1rem;
}

.wiki-content ul, .wiki-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.wiki-content li {
  margin-bottom: 0.5rem;
}

.wiki-content a {
  color: var(--primary);
  text-decoration: none;
}

.wiki-content a:hover {
  text-decoration: underline;
}

.wiki-content code {
  background-color: var(--panel);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
}

.wiki-content pre {
  background-color: var(--panel);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}