* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.app-container {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f8fafc;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  padding-bottom: 80px;
  overflow-x: hidden;
}

/* ==================== STATUS BAR OPTIMIZED ==================== */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  padding: 12px 16px;
  font-family: sans-serif;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}

.marquee {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.marquee span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 20s linear infinite;
  font-weight: 500;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* ==================== HERO SECTION OPTIMIZED ==================== */
.hero-section {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  padding: 40px 20px 60px;
  position: relative;
  overflow: hidden;
  margin-bottom: -30px;
}

.hero-bg {
  position: absolute;
  top: -30px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
  opacity: 0.6;
}

/* ==================== CARD STACK OPTIMIZED ==================== */
.card-stack {
  margin: 0 16px;
  position: relative;
  z-index: 10;
}

.action-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08),
    0 1px 0px rgba(255, 255, 255, 0.8) inset;
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  transform: translateY(0);
}

.action-card:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
  border-radius: 20px 20px 0 0;
}

.primary-action {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3),
    0 1px 0px rgba(255, 255, 255, 0.2) inset;
}

/* ==================== FEATURE GRID OPTIMIZED ==================== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px;
  margin-top: 24px;
}

.feature-item {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08),
    0 1px 0px rgba(255, 255, 255, 0.6) inset;
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.feature-item:active {
  transform: scale(0.96);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: white;
}

/* ==================== BOTTOM NAVIGATION OPTIMIZED ==================== */
.bottom-navigation {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 410px;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  padding: 10px 0 max(16px, env(safe-area-inset-bottom));
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  border-radius: 20px 20px 0 0;
  backdrop-filter: blur(5px);
}

.nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 20px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border-radius: 12px;
  transition: all 0.2s ease;
  min-width: 52px;
  position: relative;
  color: #64748b;
}

.nav-item.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  transform: translateY(-2px);
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-item i {
  font-size: 18px;
  margin-bottom: 3px;
  transition: all 0.2s ease;
}

.nav-item.active i {
  transform: translateY(-1px);
}

.nav-item span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.nav-item.active span {
  font-weight: 700;
}

/* ==================== FLOATING BUTTON DIPERBAIKI ==================== */
.floating-button {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4), 0 8px 25px rgba(0, 0, 0, 0.15);
  z-index: 45;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  text-decoration: none;
  /* ANIMASI MENGAMBANG DIPERBAIKI */
  animation: floatButton 3s ease-in-out infinite;
}

.floating-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.5),
    0 12px 30px rgba(0, 0, 0, 0.2);
}

.floating-button:active {
  transform: scale(0.92);
  animation: none; /* Hentikan animasi saat ditekan */
}

/* ANIMASI FLOATING YANG LEMBUT */
@keyframes floatButton {
  0%,
  100% {
    transform: translateY(0px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4),
      0 8px 25px rgba(0, 0, 0, 0.15);
  }
  50% {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.5),
      0 12px 30px rgba(0, 0, 0, 0.2);
  }
}

/* Efek glow ringan */
.floating-button::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #f59e0b, #d97706, #f59e0b);
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.floating-button:hover::after {
  opacity: 0.2;
}

/* ==================== MODAL OPTIMIZED ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
  padding: 24px 24px max(24px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}

/* TOMBOL CLOSE (X) YANG BAGUS */
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.modal-close:hover {
  background: #e5e7eb;
  color: #374151;
  transform: rotate(90deg);
}

.modal-close:active {
  transform: scale(0.9) rotate(90deg);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 0 auto 20px;
}

.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.2s ease;
  background: #f9fafb;
}

.input-field:focus {
  outline: none;
  border-color: #10b981;
  background: white;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.textarea-field {
  resize: none;
  min-height: 120px;
}

.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s ease;
  background: #f9fafb;
}

.upload-area.active {
  border-color: #10b981;
  background: #f0fdf4;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* ==================== STATS & NOTIFICATION ==================== */
.stats-row {
  display: flex;
  justify-content: space-between;
  padding: 0 24px;
  margin-top: 20px;
}

.stat-item {
  text-align: center;
  flex: 1;
}

.stat-number {
  font-size: 24px;
  font-weight: 800;
  color: white;
  display: block;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 2px;
  font-weight: 500;
}

.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: white;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 200;
  max-width: calc(100vw - 40px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
}

.notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.notification.success {
  border-left: 3px solid #10b981;
}

.notification.error {
  border-left: 3px solid #ef4444;
}

/* ==================== PULL TO REFRESH ==================== */
.pull-refresh {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
  font-size: 20px;
  transition: all 0.3s ease;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}

.pull-refresh.active {
  top: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: translateX(-50%) rotate(0deg);
  }
  to {
    transform: translateX(-50%) rotate(360deg);
  }
}

/* ==================== SAFE AREA & RESPONSIVE ==================== */
.app-container {
  padding-top: env(safe-area-inset-top);
}

.hero-section {
  padding-top: max(40px, env(safe-area-inset-top) + 20px);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Enhanced mobile responsiveness */
@media (max-width: 375px) {
  .card-stack {
    margin: 0 12px;
  }

  .feature-grid {
    padding: 0 12px;
    gap: 10px;
  }

  .action-card {
    padding: 16px;
  }

  .feature-item {
    padding: 16px 12px;
  }

  .bottom-navigation {
    padding: 8px 0 max(12px, env(safe-area-inset-bottom));
  }

  .nav-item {
    padding: 5px 8px;
    min-width: 48px;
  }

  .nav-item i {
    font-size: 16px;
  }

  .nav-item span {
    font-size: 8px;
  }

  .floating-button {
    width: 56px;
    height: 56px;
    font-size: 22px;
    bottom: 90px;
    right: 20px;
  }

  .modal-close {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
}

/* Extra small devices */
@media (max-width: 320px) {
  .nav-items {
    padding: 0 12px;
  }

  .nav-item {
    padding: 4px 6px;
    min-width: 44px;
  }

  .nav-item span {
    font-size: 7px;
  }

  .hero-section {
    padding: 30px 16px 50px;
  }

  .floating-button {
    width: 52px;
    height: 52px;
    font-size: 20px;
    bottom: 80px;
    right: 12px;
  }
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
