/* Material Design CSS Framework - Modern Vibrant Edition */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* Vibrant Color Palette */
:root {
  /* Primary Colors */
  --md-primary: #00D9D9;
  /* Cyan */
  --md-primary-dark: #00B8B8;
  --md-primary-light: #33E3E3;

  /* Accent Colors */
  --md-secondary: #FF6B9D;
  /* Pink */
  --md-secondary-dark: #E5528A;
  --md-purple: #9D4EDD;
  /* Purple */
  --md-purple-light: #C77DFF;
  --md-green: #06D6A0;
  /* Green */
  --md-green-light: #2FE0B5;
  --md-orange: #FFB703;
  /* Orange */
  --md-orange-light: #FFC933;
  --md-blue: #4361EE;
  /* Blue */
  --md-blue-light: #6B7FFF;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #00D9D9 0%, #9D4EDD 100%);
  --gradient-cta: linear-gradient(135deg, #FF6B9D 0%, #FFB703 100%);
  --gradient-success: linear-gradient(135deg, #06D6A0 0%, #00D9D9 100%);
  --gradient-info: linear-gradient(135deg, #4361EE 0%, #00D9D9 100%);

  /* Base Colors */
  --md-surface: #FFFFFF;
  --md-background: #F5F7FA;
  --md-error: #E74C3C;
  --md-success: #06D6A0;
  --md-warning: #FFB703;
  --md-info: #4361EE;

  /* Text Colors */
  --md-on-primary: #FFFFFF;
  --md-on-surface: #1A1A1A;
  --md-on-background: #333333;
  --md-border: #E0E0E0;
  --md-shadow: rgba(0, 0, 0, 0.1);

  /* Legacy */
  --md-cyan: #00D9D9;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--md-background);
  color: var(--md-on-background);
  font-weight: 400;
  line-height: 1.6;
}

/* Global Poppins Font for All Elements */
* {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Gradient Background for Mobile */
@media (max-width: 768px) {
  body {
    background: linear-gradient(180deg, var(--md-cyan) 0%, var(--md-purple) 100%);
    background-attachment: fixed;
  }
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

/* Elevation System */
.elevation-1 {
  box-shadow: 0 2px 4px var(--md-shadow);
}

.elevation-2 {
  box-shadow: 0 4px 8px var(--md-shadow);
}

.elevation-3 {
  box-shadow: 0 8px 16px var(--md-shadow);
}

.elevation-4 {
  box-shadow: 0 12px 24px var(--md-shadow);
}

/* Card Component */
.md-card {
  background: var(--md-surface);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.md-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.08);
}

.md-card-header {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--md-on-surface);
}

.md-card-content {
  color: var(--md-on-background);
}

.md-card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--md-border);
}

/* Button Component */
.md-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.md-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.md-btn:hover::before {
  width: 300px;
  height: 300px;
}

.md-btn-primary {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

.md-btn-primary:hover {
  background: var(--md-primary-dark);
}

.md-btn-secondary {
  background: var(--md-secondary);
  color: var(--md-on-primary);
}

.md-btn-secondary:hover {
  background: var(--md-secondary-dark);
}

.md-btn-outline {
  background: transparent;
  border: 2px solid var(--md-primary);
  color: var(--md-primary);
}

.md-btn-outline:hover {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

.md-btn-text {
  background: transparent;
  color: var(--md-primary);
}

.md-btn-text:hover {
  background: rgba(74, 144, 226, 0.1);
}

/* Input Fields */
.md-input-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.md-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--md-border);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--md-surface);
  font-family: 'Poppins', sans-serif;
}

.md-input:focus {
  outline: none;
  border-color: var(--md-primary);
  box-shadow: 0 0 0 4px rgba(0, 217, 217, 0.1);
  transform: translateY(-1px);
}

/* Modern Select/Dropdown Styling */
select.md-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2300D9D9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 20px;
  padding-right: 3rem;
  cursor: pointer;
  font-weight: 500;
}

select.md-input:hover {
  border-color: var(--md-primary);
  background-color: rgba(0, 217, 217, 0.02);
}

select.md-input:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2300D9D9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Select options styling */
select.md-input option {
  padding: 0.75rem;
  background: white;
  color: var(--md-on-surface);
  font-weight: 500;
}

select.md-input option:hover {
  background: rgba(0, 217, 217, 0.1);
}

.md-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--md-on-surface);
}

/* Floating Label */
.md-input-floating {
  position: relative;
}

.md-input-floating input {
  padding-top: 1.5rem;
  padding-bottom: 0.5rem;
}

.md-input-floating label {
  position: absolute;
  top: 1rem;
  left: 1rem;
  transition: all 0.3s ease;
  pointer-events: none;
  color: #999;
}

.md-input-floating input:focus+label,
.md-input-floating input:not(:placeholder-shown)+label {
  top: 0.25rem;
  font-size: 0.75rem;
  color: var(--md-primary);
}

/* Chip Component */
.md-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--md-background);
  border-radius: 16px;
  font-size: 0.875rem;
  margin: 0.25rem;
}

.md-chip-primary {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

/* Badge Component */
.md-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.md-badge-success {
  background: var(--md-success);
  color: white;
}

.md-badge-warning {
  background: var(--md-warning);
  color: white;
}

.md-badge-error {
  background: var(--md-error);
  color: white;
}

.md-badge-info {
  background: var(--md-info);
  color: white;
}

/* Bottom Navigation - Reference Style */
.md-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: none;
  justify-content: space-around;
  align-items: center;
  padding: 12px 0 20px 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  height: auto;
  border-radius: 24px 24px 0 0;
}

.md-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #9CA3AF;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  min-width: 64px;
  position: relative;
  gap: 4px;
}

.md-bottom-nav-item:active {
  transform: scale(0.95);
}

.md-bottom-nav-item.active {
  color: var(--md-primary);
}

.md-bottom-nav-item i {
  font-size: 1.75rem;
  transition: all 0.3s ease;
}

.md-bottom-nav-item.active i {
  transform: scale(1.05);
}

.md-bottom-nav-item span {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Floating Action Button (Center Menu) - Flow-based Positioning */
.md-bottom-nav-fab {
  position: relative;
  top: -24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-primary-dark) 100%);
  box-shadow:
    0 8px 20px rgba(0, 217, 217, 0.4),
    0 4px 12px rgba(0, 184, 184, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 4px solid white;
  z-index: 1001;
  margin: 0 8px;
  /* Add slight spacing from neighbors */
  flex-shrink: 0;
}

.md-bottom-nav-fab:hover {
  transform: scale(1.1);
  /* Removed translateX */
  box-shadow:
    0 12px 28px rgba(0, 217, 217, 0.5),
    0 6px 16px rgba(0, 184, 184, 0.4);
}

.md-bottom-nav-fab:active {
  transform: scale(0.95);
  /* Removed translateX */
}

.md-bottom-nav-fab i {
  color: white;
  font-size: 2rem;
  transition: transform 0.3s ease;
}

.md-bottom-nav-fab:hover i {
  transform: rotate(90deg);
}

/* Pulse Glow Animation */
@keyframes pulse-glow {
  0% {
    transform: translateX(-50%) scale(1);
    box-shadow:
      0 8px 24px rgba(74, 144, 226, 0.6),
      0 4px 12px rgba(118, 75, 162, 0.4),
      inset -8px -8px 0 rgba(0, 0, 0, 0.15);
  }

  50% {
    transform: translateX(-50%) scale(1.05);
    box-shadow:
      0 12px 32px rgba(74, 144, 226, 0.8),
      0 6px 16px rgba(118, 75, 162, 0.6),
      inset -10px -10px 0 rgba(0, 0, 0, 0.2);
  }

  100% {
    transform: translateX(-50%) scale(1);
    box-shadow:
      0 8px 24px rgba(74, 144, 226, 0.6),
      0 4px 12px rgba(118, 75, 162, 0.4),
      inset -8px -8px 0 rgba(0, 0, 0, 0.15);
  }
}


/* Loading Skeleton */
.md-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Toast Notification */
.md-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--md-on-surface);
  color: var(--md-surface);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--md-shadow);
  z-index: 2000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    bottom: -100px;
    opacity: 0;
  }

  to {
    bottom: 2rem;
    opacity: 1;
  }
}

/* Modal Dialog */
.md-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: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.md-modal.active {
  opacity: 1;
  pointer-events: all;
}

.md-modal-content {
  background: var(--md-surface);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.md-modal.active .md-modal-content {
  transform: scale(1);
}

/* Utility Classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

.p-1 {
  padding: 0.5rem;
}

.p-2 {
  padding: 1rem;
}

.p-3 {
  padding: 1.5rem;
}

.p-4 {
  padding: 2rem;
}

.d-flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.justify-center {
  justify-content: center;
}

.align-center {
  align-items: center;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-3 {
  gap: 1.5rem;
}

/* Responsive Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 0.75rem;
  }

  /* Show bottom navigation on mobile */
  .md-bottom-nav {
    display: flex !important;
  }

  /* Add padding to body to prevent content being hidden by bottom nav */
  body {
    padding-bottom: 75px;
  }

  /* Adjust toast position on mobile to avoid bottom nav */
  .md-toast {
    bottom: 85px;
  }
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
  .md-bottom-nav {
    display: none !important;
  }

  body {
    padding-bottom: 0;
  }
}