@tailwind base;
@tailwind components;
@tailwind utilities;

* {
  font-family: "Poppins", sans-serif;
}

/* Custom Size Classes */
.w-100 {
  width: 30rem;
}
.h-100 {
  height: 30rem;
}

/* Toast Animations */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

.animate-slide-in {
  animation: slideInRight 0.3s ease-out;
}

.animate-slide-out {
  animation: slideOutRight 0.3s ease-in;
}

/* Hilangkan ikon bawaan browser (Chrome, Edge, Safari) */
input::-ms-reveal,
input::-ms-clear,
input::-webkit-credentials-auto-fill-button,
input::-webkit-clear-button,
input::-webkit-textfield-decoration-container,
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
  display: none !important;
}

/* Untuk Safari & Chrome */
input[type="password"]::-webkit-textfield-decoration-container {
  display: none !important;
}

/* Search Icon Positioning Fix */
.search-icon {
  position: absolute !important;
  left: 0.75rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
}
.search-input{
  background-color: rgb(243, 244, 246,1)
}

@media (min-width: 1024px) {
  .sidebar {
    flex: 0 0 16rem;
    width: 16rem;
    overflow: visible;
    background: #ffffff;
    transition: width 0.2s ease, flex-basis 0.2s ease, border-color 0.2s ease;
  }

  .sidebar-content {
    min-width: 16rem;
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }

  .sidebar.sidebar-collapsed {
    flex-basis: 0;
    width: 0;
    border-color: transparent;
  }

  .sidebar.sidebar-collapsed .sidebar-content {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .sidebar.sidebar-collapsed .desktop-sidebar-toggle {
    position: fixed;
    top: 20%;
    right: auto;
    left: 0.5rem;
    transform: translateY(-50%);
    z-index: 50;
  }

  .desktop-sidebar-toggle {
    position: absolute;
    top: 1.25rem;
    right: -1.125rem;
    z-index: 20;
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    background: #ffffff;
    color: #475569;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .desktop-sidebar-toggle:hover {
    background: #eff6ff;
    color: #2563eb;
  }
}

@media (max-width: 1023px) {
  .desktop-sidebar-toggle {
    display: none;
  }
}



@media (max-width: 1023px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 40;
    height: 100vh !important;
    max-width: 85vw;
    background: #ffffff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-backdrop.sidebar-open {
    display: block !important;
  }

  .sidebar-toggle {
    display: inline-flex !important;
    flex-shrink: 0;
  }

  header {
    padding: 0.75rem 1rem !important;
  }

  .navbar-search-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }

  .navbar-search-wrap input {
    width: clamp(10rem, 42vw, 20rem) !important;
  }

  #profileBtn .text-right {
    display: none;
  }
}

@media (max-width: 479px) {
  header {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  header > div {
    gap: 0.5rem;
  }

  .navbar-search-wrap input {
    width: clamp(8rem, 48vw, 12rem) !important;
    padding-left: 0.75rem !important;
    padding-right: 2.25rem !important;
    font-size: 0.75rem !important;
  }

  #profileBtn {
    padding-right: 0.25rem !important;
  }

  #profileBtn img {
    width: 2.25rem !important;
    height: 2.25rem !important;
  }

  .profile-dropdown {
    position: fixed !important;
    top: 4rem !important;
    right: 0.75rem !important;
    margin-top: 0 !important;
    max-width: calc(100vw - 1.5rem);
  }
}

/* Menu Item Styling */
.menu-item {
  position: relative;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  background: transparent;
}

/* Notification Dropdown Fix */
[data-notif-dropdown] {
  max-width: 16rem;
  min-width: 16rem;
}

/* Prevent dropdown from causing layout issues */
.relative.inline-block {
  overflow: visible;
}

/* Avatar Dropdown Styling */
[data-avatar-dropdown] {
  max-width: 12rem;
  min-width: 12rem;
}

/* Ensure proper z-index for dropdowns */
[data-avatar-dropdown],
[data-notif-dropdown] {
  z-index: 9999 !important;
}

.menu-item.active {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.menu-item.active .menu-text {
  color: #ffffff !important;
  font-weight: 600;
}

.menu-item.active .menu-icon {
  filter: brightness(0) invert(1);
  /* White icon */
}

.menu-item:not(.active) .menu-icon {
  color: #ffcd29;
}

.menu-item:not(.active):hover {
  background: transparent !important;
  border: 1px solid #ffcd29 !important;
  border-radius: 8px;
}

/* .menu-item:not(.active):hover .menu-icon {
  filter: brightness(0) invert(1);
  /* White icon on hover */


#statusLogContent {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f7fafc;
}

#statusLogContent::-webkit-scrollbar {
  width: 6px;
}

#statusLogContent::-webkit-scrollbar-track {
  background: #f7fafc;
  border-radius: 10px;
}

#statusLogContent::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 10px;
}

#statusLogContent::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

  #hseConfirmModal {
    background-color: rgba(0, 0, 0, 0.6) !important;
  }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes revealUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.animate-reveal-up {
  animation: revealUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out both;
}

/* Staggered Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

@keyframes titleGlitch {
  0% {
    opacity: 0;
    transform: translateY(20px) translateX(-2px);
    text-shadow: 2px 0px 0px rgba(34, 211, 238, 0.6), -2px 0px 0px rgba(232, 121, 249, 0.6);
    filter: blur(2px);
  }
  40% {
    opacity: 1;
    transform: translateY(0) translateX(2px);
    text-shadow: -2px 0px 0px rgba(34, 211, 238, 0.6), 2px 0px 0px rgba(232, 121, 249, 0.6);
    filter: blur(0);
  }
  60% {
    transform: translateX(-1px);
    text-shadow: 1px 0px 0px rgba(34, 211, 238, 0.4), -1px 0px 0px rgba(232, 121, 249, 0.4);
  }
  80% {
    transform: translateX(1px);
    text-shadow: none;
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(0);
    text-shadow: none;
  }
}

.animate-glitch {
  animation: titleGlitch 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Bulk Action Bar Animation */
@keyframes slide-up {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

/* Selection Mode Styles */
.material-card.selection-mode {
    cursor: pointer;
    transition: all 0.2s ease;
}

.material-card.selection-mode:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.material-card.selected {
    border: 2px solid #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.selection-indicator {
    transition: all 0.2s ease;
}
