@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #ff6b81;
  --primary-hover: #ff4760;
  --secondary: #ffa502;
  --success: #2ed573;
  --danger: #ff4757;
  --background: #fdfaf6;
  --surface: #ffffff;
  --text-main: #2f3542;
  --text-muted: #747d8c;
  --border: #f1f2f6;
  --shadow-sm: 0 2px 8px rgba(255, 107, 129, 0.08);
  --shadow-md: 0 8px 24px rgba(255, 107, 129, 0.12);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-weight: 600;
  color: var(--text-main);
}

h1 {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition);
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2.5rem;
}

.logo i {
  font-size: 1.75rem;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: var(--transition);
}

.nav-item a:hover {
  background: #fff0f3;
  color: var(--primary);
}

.nav-item a.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: var(--shadow-sm);
}

.nav-item i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.main-content {
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header / Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  border-radius: 50px;
  box-shadow: var(--shadow-sm);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(255, 107, 129, 0.1);
}

.btn-success {
  background: var(--success);
  color: white;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-main);
  background: var(--background);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.15);
  background: var(--surface);
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.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;
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Landing Page Specific */
.landing-page {
  background: linear-gradient(135deg, #fff0f3 0%, var(--surface) 100%);
  min-height: 100vh;
}

.hero-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem;
  text-align: center;
}

.hero-title {
  font-size: 4rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* Badge / Tags */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-premium {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: white;
}

.mobile-toggle {
  display: none;
  /* Disembunyikan secara default untuk versi Desktop */
}

/* Responsive */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: 70px;
    position: fixed;
    bottom: 0;
    left: 0;
    top: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    border-right: none;
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    flex-direction: row;
    padding: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  }

  .sidebar.active {
    transform: translateY(0);
  }

  .sidebar-overlay {
    display: none !important;
  }

  .mobile-toggle {
    display: none !important;
  }

  .logo {
    display: none;
  }

  .nav-links {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0.5rem;
    margin: 0;
    width: 100%;
    height: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: 0.25rem;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
  }

  .nav-links::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
  }

  .nav-item {
    flex: 0 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
  }

  .nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    white-space: nowrap;
    height: calc(100% - 10px);
    border-radius: var(--radius-sm);
  }

  .nav-item i {
    font-size: 1.1rem;
    margin: 0;
    width: auto;
  }

  .sidebar>div[style*="margin-top: auto"] {
    display: none !important;
  }

  .main-content {
    padding: 1.5rem 1rem 80px 1rem;
  }

  .topbar {
    flex-direction: row;
    /* Keep header items inline if possible, or adjust based on burger */
    align-items: center;
    gap: 1rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Perbaikan Input API Gemini di Mobile */
  [style*="justify-content: space-between"][style*="margin-bottom: 0.5rem"] {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }

  /* Perapihan Heading Baris Atas di Layar Kecil */
  .topbar>div {
    gap: 0.6rem !important;
  }

  .topbar h2 {
    font-size: 1.15rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0.1rem !important;
  }

  .topbar p.text-muted {
    font-size: 0.8rem !important;
    line-height: 1.25 !important;
    margin: 0 !important;
  }
}

/* --- FORCE INSTALL PWA OVERLAY --- */
#pwa-force-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--surface);
  z-index: 99999;
  /* Absolute top blocker */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  box-sizing: border-box;
}

#pwa-force-overlay .pwa-force-content {
  background: white;
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 400px;
  width: 100%;
  border: 1px solid rgba(255, 107, 129, 0.2);
}

#pwa-force-overlay i.fa-rocket {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

#pwa-force-overlay h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
}

#pwa-force-overlay p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

#pwa-force-overlay .force-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}