:root {
  --primary-color: #1976d2;
  --primary-light: #42a5f5;
  --primary-dark: #1565c0;
  --secondary-color: #dc004e;
  --secondary-light: #ff5983;
  --secondary-dark: #9a0036;
  --text-primary: rgba(0, 0, 0, 0.87);
  --text-secondary: rgba(0, 0, 0, 0.6);
  --background: #f5f5f5;
  --surface: #ffffff;
  --error: #f44336;
  --warning: #ff9800;
  --info: #2196f3;
  --success: #4caf50;
  --border-radius: 4px;
  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-2: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  --shadow-3: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Roboto", sans-serif;
}

body {
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
}

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

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.box {
  display: flex;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hidden {
  display: none;
}

/* Navigation Components */
.app-bar {
  background-color: var(--primary-color);
  color: white;
  padding: 16px;
  box-shadow: var(--shadow-2);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.drawer {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100%;
  background-color: var(--surface);
  box-shadow: var(--shadow-3);
  transition: left 0.3s ease;
  z-index: 1100;
  padding-top: 80px;
  overflow-y: auto;
}

.drawer.open {
  left: 0;
}

.breadcrumbs {
  display: flex;
  list-style: none;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.tab {
  padding: 12px 16px;
  cursor: pointer;
  position: relative;
  min-width: 160px;
  text-align: center;
}

.tab.active {
  color: var(--primary-color);
}

.tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary-color);
}

.tab-content {
  display: none;
  padding: 16px;
}

.tab-content.active {
  display: block;
}

.pagination {
  display: flex;
  list-style: none;
  gap: 8px;
}

.page-item {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}

.page-item.active {
  background-color: var(--primary-color);
  color: white;
}

.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.step {
  display: flex;
  align-items: center;
  flex: 1;
}

.step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.38);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-right: 8px;
}

.step.active .step-circle {
  background-color: var(--primary-color);
}

.step-line {
  flex: 1;
  height: 1px;
  background-color: rgba(0, 0, 0, 0.12);
  margin: 0 8px;
}

/* Input Components */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s ease;
  text-decoration: none;
}

.button-contained {
  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-1);
}

.button-contained:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-2);
}

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

.button-outlined:hover {
  background-color: rgba(25, 118, 210, 0.04);
}

.button-text {
  background-color: transparent;
  color: var(--primary-color);
}

.button-text:hover {
  background-color: rgba(25, 118, 210, 0.04);
}

.text-field {
  position: relative;
  margin-bottom: 16px;
}

.text-field input,
.text-field textarea,
.text-field select {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.23);
  border-radius: var(--border-radius);
  font-size: 16px;
  background-color: transparent;
  transition: border-color 0.3s ease;
}

.text-field label {
  position: absolute;
  top: 12px;
  left: 12px;
  color: var(--text-secondary);
  pointer-events: none;
  transition: all 0.3s ease;
  background-color: var(--surface);
  padding: 0 4px;
}

.text-field input:focus,
.text-field textarea:focus,
.text-field select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.text-field input:focus + label,
.text-field textarea:focus + label,
.text-field select:focus + label,
.text-field input:not(:placeholder-shown) + label,
.text-field textarea:not(:placeholder-shown) + label {
  top: -8px;
  left: 8px;
  font-size: 12px;
  color: var(--primary-color);
}

.checkbox,
.radio {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
}

.checkbox input,
.radio input {
  margin-right: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider-container {
  padding: 16px 0;
}

.slider-track {
  height: 4px;
  background-color: #e0e0e0;
  position: relative;
  margin: 16px 0;
}

.slider-fill {
  height: 100%;
  background-color: var(--primary-color);
}

.slider-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--primary-color);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  box-shadow: var(--shadow-1);
}

/* Data Display Components */
.typography-h1 {
  font-size: 6rem;
  font-weight: 300;
}

.typography-h2 {
  font-size: 3.75rem;
  font-weight: 300;
}

.typography-h3 {
  font-size: 3rem;
  font-weight: 400;
}

.typography-h4 {
  font-size: 2.125rem;
  font-weight: 400;
}

.typography-h5 {
  font-size: 1.5rem;
  font-weight: 400;
}

.typography-h6 {
  font-size: 1.25rem;
  font-weight: 500;
}

.typography-subtitle1 {
  font-size: 1rem;
  font-weight: 400;
}

.typography-subtitle2 {
  font-size: 0.875rem;
  font-weight: 500;
}

.typography-body1 {
  font-size: 1rem;
  font-weight: 400;
}

.typography-body2 {
  font-size: 0.875rem;
  font-weight: 400;
}

.card {
  background-color: var(--surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-2);
}

.card-header {
  padding: 16px;
}

.card-content {
  padding: 16px;
}

.card-actions {
  padding: 8px;
  display: flex;
  justify-content: flex-end;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--surface);
  box-shadow: var(--shadow-1);
}

.table th,
.table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.table th {
  font-weight: 500;
  color: var(--text-secondary);
}

.list {
  list-style: none;
  background-color: var(--surface);
  box-shadow: var(--shadow-1);
}

.list-item {
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background-color: #e0e0e0;
  border-radius: 16px;
  font-size: 14px;
  margin: 4px;
}

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

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

.badge {
  position: relative;
  display: inline-block;
}

.badge-content {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 10px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  width: 120px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Feedback Components */
.alert {
  padding: 16px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.alert-error {
  background-color: #ffebee;
  color: var(--error);
}

.alert-warning {
  background-color: #fff3e0;
  color: var(--warning);
}

.alert-info {
  background-color: #e3f2fd;
  color: var(--info);
}

.alert-success {
  background-color: #e8f5e9;
  color: var(--success);
}

.snackbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #323232;
  color: white;
  padding: 14px 16px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-3);
  z-index: 1000;
}

.dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.dialog.open {
  visibility: visible;
  opacity: 1;
}

.dialog-content {
  background-color: var(--surface);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-3);
  overflow: hidden;
}

.dialog-header {
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.dialog-body {
  padding: 16px;
}

.dialog-footer {
  padding: 8px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  display: none;
}

.backdrop.open {
  display: block;
}

.progress {
  height: 4px;
  background-color: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.skeleton {
  background-color: #e0e0e0;
  border-radius: var(--border-radius);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

/* Advanced Components */
.date-picker {
  position: relative;
  display: inline-block;
}

.date-picker input {
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.23);
  border-radius: var(--border-radius);
  width: 200px;
}

.calendar {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-2);
  padding: 16px;
  z-index: 100;
  display: none;
}

.calendar.open {
  display: block;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}

.calendar-day:hover {
  background-color: #f5f5f5;
}

.calendar-day.selected {
  background-color: var(--primary-color);
  color: white;
}

.rating {
  display: flex;
  gap: 4px;
}

.rating-star {
  color: #e0e0e0;
  cursor: pointer;
  font-size: 24px;
}

.rating-star.active {
  color: #ffc107;
}

.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #e0e0e0;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary-color);
}

.tree-view {
  list-style: none;
}

.tree-node {
  margin-bottom: 8px;
}

.tree-node-content {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 4px 0;
}

.tree-node-children {
  margin-left: 24px;
  display: none;
}

.tree-node.expanded .tree-node-children {
  display: block;
}

.chart-container {
  height: 300px;
  background-color: var(--surface);
  border-radius: var(--border-radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
}

.chart {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chart-bar {
  flex: 1;
  background-color: var(--primary-color);
  border-radius: 4px 4px 0 0;
  position: relative;
}

.chart-bar-label {
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
}

/* Utility Classes */
.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

.p-1 {
  padding: 8px;
}

.p-2 {
  padding: 16px;
}

.p-3 {
  padding: 24px;
}

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

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

.d-flex {
  display: flex;
}

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

.justify-center {
  justify-content: center;
}

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

.gap-1 {
  gap: 8px;
}

.gap-2 {
  gap: 16px;
}

.gap-3 {
  gap: 24px;
}

.w-100 {
  width: 100%;
}

/* Main Content */
.main-content {
  margin-top: 80px;
  padding: 24px;
}

.section {
  margin-bottom: 48px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--primary-color);
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 8px;
}

.component-group {
  margin-bottom: 32px;
  background-color: var(--surface);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-1);
}

.component-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Component Counter */
.component-counter {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: var(--shadow-2);
  z-index: 1000;
}

/* Responsive */
@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 8px;
  }

  .main-content {
    padding: 16px;
  }

  .component-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-direction: column;
  }

  .tab {
    min-width: auto;
  }
}