@import url('https://fonts.googleapis.com/css2?family=Fira+Code&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Oxanium&display=swap');

:root {
  --primary-color: #4a6cf7;
  --secondary-color: #6f42c1;
  --background-color: #f8f9fa;
  --card-background: #ffffff;
  --text-color: #212529;
  --border-color: #e9ecef;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --navbar-width: 250px;
  --transition-speed: 0.3s;
  --icon-shadow: rgba(0, 0, 0, 0.2);
  --s-1: rgba(255, 255, 255, 0);
  --s-2: rgba(0, 0, 0, 0.8);
  --s-3: rgba(255, 255, 255, 0);
}

[data-theme="dark"] {
  --primary-color: #6d7aff;
  --secondary-color: #9e7bfc;
  --background-color: #121212;
  --card-background: #1e1e1e;
  --text-color: #f8f9fa;
  --border-color: #2d2d2d;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --icon-shadow: rgba(255, 255, 255, 0.1);
  --s-1: rgba(255, 255, 255, 0);
  --s-2: rgba(255, 255, 255, 0.8);
  --s-3: rgba(255, 255, 255, 0);
}

pre,
code,
pre *,
code * {
  word-wrap: break-word;
  white-space: pre-wrap;
  max-height: 100vh;
  font-family: 'Fira Code', monospace !important;
  user-select: auto !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

*:not(i) {
  font-family: 'Oxanium', sans-serif;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.sidenav {
  height: 100vh;
  width: var(--navbar-width);
  position: fixed;
  z-index: 100;
  top: 0;
  left: -250px;
  background-color: var(--card-background);
  box-shadow: 2px 0 10px var(--shadow-color);
  overflow-x: hidden;
  transition: left var(--transition-speed);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
}

.sidenav.active {
  left: 0;
}

.sidenav-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.sidenav-brand {
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
}

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

.sidenav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-color);
  background: none;
  border: none;
  transition: transform var(--transition-speed);
  position: absolute;
  right: 20px;
  /* Changed from -16px to -42px to prevent overlap */
  top: 20px;
  /* Added to position it properly */
  background-color: var(--card-background);
  border-radius: 50%;
  box-shadow: 2px 0 5px var(--shadow-color);
  z-index: 90;
  /* Changed from 101 to 90 so it doesn't overlap other elements */
}

.sidenav-toggle.active {
  transform: rotate(180deg);
}

.sidenav-menu {
  padding: 20px;
  flex-grow: 1;
  overflow-y: auto;
}

.sidenav-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 6px;
  margin: 8px 0;
  transition: background-color var(--transition-speed);
}

.sidenav-item:hover {
  background-color: rgba(var(--primary-color-rgb), 0.1);
}

.sidenav-item i {
  margin-right: 12px;
  font-size: 18px;
  width: 20px;
  /* Added fixed width for better alignment */
  text-align: center;
  /* Center the icon */
}

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

.main-content {
  margin-left: 0;
  padding: 20px;
  transition: margin-left var(--transition-speed);
  min-height: calc(100dvh - 50px);
  padding-top: 80px;
}

.main-content.shifted {
  margin-left: var(--navbar-width);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 65px;
  padding: 0 20px;
  background-color: var(--card-background);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px var(--shadow-color);
  z-index: 99;
  transition: left var(--transition-speed);
}

.topbar.shifted {
  left: var(--navbar-width);
}

.left-section {
  display: flex;
  align-items: center;
}

.menu-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-color);
  position: relative;
  overflow: hidden;
  z-index: 102;
  /* Increased z-index to be above sidenav */
}

.menu-toggle .bar {
  position: absolute;
  width: 20px;
  height: 2px;
  background-color: var(--text-color);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.menu-toggle .bar:nth-child(1) {
  transform: translateY(-6px);
}

.menu-toggle .bar:nth-child(3) {
  transform: translateY(6px);
}

.menu-toggle.active .bar:nth-child(1) {
  transform: translateY(0) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
  transform: translateY(0) rotate(-45deg);
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-color);
  margin-left: 15px;
}

.profile-container {
  position: relative;
}

.profile-image {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: transform 0.2s;
}

.profile-image:hover {
  transform: scale(1.05);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: 0 5px 20px var(--shadow-color);
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 100;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.profile-dropdown.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.profile-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.profile-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.profile-email {
  font-size: 13px;
  color: var(--text-color);
  opacity: 0.7;
}

.profile-menu {
  padding: 10px 0;
}

.profile-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.2s;
}

.profile-item:hover {
  background-color: rgba(var(--primary-color-rgb), 0.1);
}

.profile-item i {
  margin-right: 12px;
  font-size: 16px;
}

.toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

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

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

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

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

input:checked+.toggle-slider:before {
  transform: translateX(22px);
}

.card {
  background-color: var(--card-background);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px var(--shadow-color);
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 0.4em;
  align-self: start;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px var(--shadow-color);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.card-title i {
  margin-right: 10px;
  font-size: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  align-items: start !important
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  transition: background-color 0.2s, transform 0.1s;
  text-decoration: none;
}

.btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

.btn i {
  margin-right: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* Additional colors for our theme */
:root {
  --primary-color-rgb: 74, 108, 247;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
}

[data-theme="dark"] {
  --primary-color-rgb: 109, 122, 255;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--background-color);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Animation for sun-moon toggle */
.moon-icon,
.sun-icon {
  position: absolute;
  transition: opacity 0.3s, transform 0.5s;
}

.moon-icon {
  opacity: 0;
  transform: rotate(-90deg);
}

[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: rotate(90deg);
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: rotate(0);
}

/* Waktu Card Styles */
.big-time {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  text-align: center;
  margin: 20px 0;
}

.time-icon {
  font-size: 32px;
  color: var(--primary-color);
  display: block;
  text-align: center;
  margin-bottom: 10px;
}

/* Table styles for API endpoints */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background-color: var(--card-background);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px var(--shadow-color);
}

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

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
  background-color: rgba(var(--primary-color-rgb), 0.05);
}

.btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--success-color);
  color: white;
  border: none;
  border-radius: 50%;
  transition: transform 0.2s, background-color 0.2s;
}

.btn-arrow:hover {
  transform: translateX(2px);
  background-color: #218838;
}

.status-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 500;
}

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

.status-true {
  background-color: #28A745;
  color: white;
}

.status-false {
  background-color: var(--danger-color);
  color: white;
}

/* Content sections */
.content-section {
  display: none;
}

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

.footer {
  display: flex;
  justify-content: center;
  /* Center horizontal */
  align-items: center;
  /* Center vertical */
  height: 50px;
  /* Atur tinggi sesuai kebutuhan */
  background-color: var(--primary-color);
  /* Warna latar opsional */
  color: white;
}

#typewriter::after {
  content: "|";
  animation: blink 0.7s infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .card {
    font-size: initial
  }
  
  .main-content {
    min-height: auto
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .sidenav {
    width: 250px;
    left: -250px;
    height: 100vh;
    top: 0;
    z-index: 999;
    /* Higher than topbar */
  }
  
  .sidenav.active {
    left: 0;
  }
  
  .main-content.shifted {
    margin-left: 0;
  }
  
  #run-url.shifted {
    margin-left: 0 !important;
  }
  
  .topbar.shifted {
    left: 0;
  }
  
  /* Hide sidenav-toggle on mobile */
  .sidenav-toggle {
    display: flex;
  }
  
  .profile-dropdown {
    width: 200px;
  }
  
  .left-section {
    display: flex;
    align-items: center;
  }
  
  .page-title {
    font-size: 18px;
    margin-left: 12px;
  }
}

/* Countdown Styles */
.countdown-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--card-bg-color);
  border-radius: 10px;
  padding: 15px;
  width: 100px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.countdown-item:hover {
  transform: scale(1.05);
}

.countdown-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.countdown-label {
  font-size: 0.9rem;
  color: var(--text-color-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .countdown-container {
    gap: 10px;
  }
  
  .countdown-item {
    width: 80px;
    padding: 10px;
  }
  
  .countdown-number {
    font-size: 2rem;
  }
  
  .countdown-label {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .countdown-container {
    gap: 8px;
  }
  
  .countdown-item {
    width: 70px;
    padding: 8px;
  }
  
  .countdown-number {
    font-size: 1.5rem;
  }
  
  .countdown-label {
    font-size: 0.7rem;
  }
}

#run-url {
  margin-bottom: 50px;
  display: none;
  border-top: 1px solid var(--primary-color);
  border-bottom: 1px solid var(--primary-color);
  overflow-x: auto;
  transition: margin-left var(--transition-speed);
  min-height: auto;
  position: relative;
}

#run-url.shifted {
  margin-left: var(--navbar-width);
}

.cardurl {
  background: var(--card-background);
  padding: 20px;
  box-shadow: 0 4px 10px var(--shadow-color);
}

#run-input {
  display: flex;
  flex-direction: column;
}

#run-input label {
  padding-bottom: 5px;
}

.run-input {
  background: var(--background-color);
  border-radius: 5px;
  height: 20px;
  border: 1px solid var(--primary-color);
  outline: none;
  padding: 15px;
  color: var(--text-color);
  margin-bottom: 15px;
}

.run-btn {
  width: 100px;
  background: var(--primary-color);
  box-shadow: 0 4px 10px var(--shadow-color);
  padding: 10px;
  color: white;
  border: none;
  border-radius: 5px;
  margin-left: auto;
  margin-top: 30px;
  margin-bottom: 30px;
  transition: opacity 0.5s
}

.run-btn:disabled {
  opacity: 0.5;
}

.run-btn i {
  margin-right: 5px;
}

.result-title {
  margin-top: 10px;
  display: none;
  flex-direction: column;
}

.res {
  font-size: 1.7em;
}

.result-title div.time {
  color: var(--success-color);
  font-size: 0.8em
}

.result {
  background: var(--card-background);
  height: auto;
}

#result {
  display: none;
}

.loading {
  text-align: center;
  margin-top: 10px;
  background: var(--success-color);
  border-radius: 5px;
  display: none;
  margin-bottom: 10px;
}

.card-endpoint {
  font-size: 0.8em;
  color: var(--success-color);
  margin-left: auto;
}

.icon {
  background: #42445A30;
  border-radius: 5px;
  padding: 5px;
  color: var(--primary-color);
  margin-right: 3px;
}

.status {
  padding: 4px;
  border-radius: 5px;
  font-size: 1em !important;
  margin-left: auto;
}

#url {
  width: 100%;
}

.success {
  background-color: rgba(40, 167, 69, 0.3);
  color: var(--success-color);
}

.error {
  background-color: rgba(220, 53, 69, 0.3);
  color: var(--danger-color);
}

.warning {
  background-color: rgba(255, 193, 7, 0.3);
  color: var(--warning-color);
}


.lds-ellipsis,
.lds-ellipsis div {
  box-sizing: border-box;
}

.lds-ellipsis {
  display: none;
  flex-direction: column;
  margin: auto;
  position: relative;
  width: 80px;
  height: 80px;
}

.lds-ellipsis div {
  position: absolute;
  top: 33.33333px;
  width: 13.33333px;
  height: 13.33333px;
  border-radius: 50%;
  background: currentColor;
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.lds-ellipsis div:nth-child(1) {
  left: 8px;
  animation: lds-ellipsis1 0.6s infinite;
}

.lds-ellipsis div:nth-child(2) {
  left: 8px;
  animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(3) {
  left: 32px;
  animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(4) {
  left: 56px;
  animation: lds-ellipsis3 0.6s infinite;
}

@keyframes lds-ellipsis1 {
  0% {
    transform: scale(0);
  }
  
  100% {
    transform: scale(1);
  }
}

@keyframes lds-ellipsis3 {
  0% {
    transform: scale(1);
  }
  
  100% {
    transform: scale(0);
  }
}

@keyframes lds-ellipsis2 {
  0% {
    transform: translate(0, 0);
  }
  
  100% {
    transform: translate(24px, 0);
  }
}

.required {
  color: red;
}

.label-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#result-img {
  display: none;
  max-width: 100%;
}

.images {
  width: 100%;
  max-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background-color);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 1s ease-out, visibility 1s ease-out;
  overflow: hidden;
}

.splash-screen .logo {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
  border-radius: 50%;
  box-shadow: 5px 5px 15px var(icon-shadow);
}

.splash-screen h1 {
  color: var(--text-color);
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.shimmer-text {
  display: inline-block;
  position: relative;
  color: var(--text-color);
  background: linear-gradient(90deg,
      var(--s-1) 0%,
      var(--s-2) 50%,
      var(--s-3) 100%);
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2s infinite;
  font-size: 36px;
  font-weight: bold;
  margin: 0;
}

/* Warna primer untuk span di dalam h1 dengan shimmer */
.shimmer-text > span {
  color: var(--primary-color);
  background: linear-gradient(90deg,
      rgba(74, 108, 247, 0) 0%,
      rgba(74, 108, 247, 1) 50%,
      rgba(74, 108, 247, 0) 100%);
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -100% 0;
  }
  
  100% {
    background-position: 100% 0;
  }
}

.run-input-file {
  background: var(--background-color);
  border-radius: 5px;
  height: 40px; /* Tinggi input agar lebih besar untuk kenyamanan */
  border: 1px solid var(--primary-color);
  outline: none;
  padding: 15px;
  color: var(--text-color);
  margin-bottom: 15px;
}

.run-input-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.run-input-wrapper input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  width: 100%;
}

.run-input-wrapper .label {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background-color: var(--primary-color);
  color: var(--background-color);
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 14px;
  margin-bottom: 0;
  height: 100%;
  width: 100%;
}

.run-input-wrapper .label:hover {
  background-color: var(--secondary-color);
}

.file-preview-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  max-width: 100%;
}

.file-preview {
  max-width: 50px; /* Ukuran gambar preview kecil */
  max-height: 50px;
  margin-right: 10px;
  display: none;
}

.file-name {
  flex-grow: 1;
  font-size: 14px;
  color: var(--text-color);
}

.clear-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 18px;
  display: none;
}

.clear-btn:hover {
  color: var(--secondary-color);
}