/* 
 * Fasicare Service Desk - Modern Minimal Theme
 * Primary Color: #0FA89E (Teal/Mint Green)
 * Design: Clean, Professional, White-dominant with subtle accents
 */

/* ========================================
   COLOR PALETTE
   ======================================== */
:root {
  --primary: #0FA89E;
  --primary-hover: #0d8f86;
  --primary-light: #e6f7f6;
  --primary-lighter: #f0faf9;
  
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-primary: 0 4px 14px 0 rgba(15, 168, 158, 0.15);
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* ========================================
   GLOBAL STYLES
   ======================================== */

/* Import Kanit Font */
@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

body {
  background-color: var(--gray-50);
  color: var(--gray-800);
  font-family: 'Kanit', 'Inter', 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   CARDS
   ======================================== */
.card-minimal {
  background-color: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.card-minimal:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

.card-glass {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 168, 158, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-secondary:hover {
  background-color: var(--gray-50);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background-color: transparent;
  color: var(--gray-600);
  border-color: transparent;
}

.btn-ghost:hover {
  background-color: var(--primary-lighter);
  color: var(--primary);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
}

.badge-primary {
  background-color: var(--primary-light);
  color: var(--primary-hover);
}

.badge-success {
  background-color: #f0fdf4;
  color: #15803d;
}

.badge-warning {
  background-color: #fef3c7;
  color: #b45309;
}

.badge-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

.badge-gray {
  background-color: var(--gray-100);
  color: var(--gray-600);
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  background-color: var(--white);
  border-right: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin: 0.25rem 0.5rem;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-item:hover {
  background-color: var(--primary-lighter);
  color: var(--primary);
}

.sidebar-item.active {
  background-color: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.sidebar-item i {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
}

/* ========================================
   TABLES
   ======================================== */
.table-minimal {
  width: 100%;
  background-color: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.table-minimal thead {
  background-color: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.table-minimal th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
}

.table-minimal td {
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--gray-700);
  border-top: 1px solid var(--gray-100);
}

.table-minimal tbody tr {
  transition: background-color 0.15s ease;
}

.table-minimal tbody tr:hover {
  background-color: var(--gray-50);
}

/* ========================================
   FORMS
   ======================================== */
.input-minimal {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--gray-800);
  background-color: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.input-minimal:hover {
  border-color: var(--gray-400);
}

.input-minimal:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-lighter);
}

.input-minimal::placeholder {
  color: var(--gray-400);
}

.label-minimal {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

/* ========================================
   MODALS
   ======================================== */
.modal-overlay {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content {
  background-color: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--gray-200);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background-color: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-primary {
  color: var(--primary) !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

.bg-primary-light {
  background-color: var(--primary-light) !important;
}

.bg-primary-lighter {
  background-color: var(--primary-lighter) !important;
}

.border-primary {
  border-color: var(--primary) !important;
}

.shadow-minimal {
  box-shadow: var(--shadow-sm);
}

.shadow-card {
  box-shadow: var(--shadow-md);
}

.shadow-elevated {
  box-shadow: var(--shadow-lg);
}

.rounded-minimal {
  border-radius: var(--radius-md);
}

.rounded-card {
  border-radius: var(--radius-lg);
}

.divider {
  height: 1px;
  background-color: var(--gray-200);
  margin: 1rem 0;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

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

/* Premium Landing Page Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.animation-delay-200 {
  animation-delay: 0.2s;
}

.animation-delay-400 {
  animation-delay: 0.4s;
}

.animation-delay-600 {
  animation-delay: 0.6s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float 8s ease-in-out infinite;
  animation-delay: 1s;
}

@keyframes gradientX {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.animate-gradient-x {
  background-size: 200% 200%;
  animation: gradientX 3s ease infinite;
}

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

.animate-shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Grid Pattern Background */
.bg-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Hover Effects */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-8px);
}

.hover-scale {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hover-glow {
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(15, 168, 158, 0.3);
}

/* Button Shine Effect */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.btn-shine:hover::before {
  left: 100%;
}

/* Glass Morphism */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading Skeleton */
@keyframes skeleton {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-200) 25%,
    var(--gray-100) 50%,
    var(--gray-200) 75%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

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

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  /* Default: Hide sidebar on mobile (slide out to left) */
  .sidebar,
  .sidebar-mobile-hidden {
    transform: translateX(-100%) !important;
  }
  
  /* Show sidebar when explicitly opened */
  .sidebar-mobile-show {
    transform: translateX(0) !important;
  }
  
  /* Legacy support */
  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }
}

/* ========================================
   SIDEBAR COLLAPSE (Desktop)
   ======================================== */
@media (min-width: 769px) {
  /* Sidebar collapsed state */
  .sidebar-collapsed {
    width: 80px !important;
  }
  
  /* Hide ALL text elements when sidebar is collapsed */
  .sidebar-collapsed .sidebar-text,
  .sidebar-collapsed span.sidebar-text,
  .sidebar-collapsed p.sidebar-text {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  
  .sidebar-collapsed button {
    justify-content: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
    position: relative;
  }
  
  /* Tooltip for collapsed menu items */
  .sidebar-collapsed button:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease;
  }
  
  @keyframes tooltipFadeIn {
    from {
      opacity: 0;
      transform: translateY(-50%) translateX(-5px);
    }
    to {
      opacity: 1;
      transform: translateY(-50%) translateX(0);
    }
  }
  
  .sidebar-collapsed .w-10 {
    margin: 0 auto;
  }
  
  /* Sidebar expanded state */
  .sidebar-expanded {
    width: 280px;
  }
  
  /* Toggle button inside sidebar header */
  #sidebar-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  #sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  /* Floating toggle button (when sidebar is collapsed) */
  #sidebar-float-toggle {
    position: fixed !important;
    left: 24px;
    top: 24px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0FA89E 0%, #0d8a7f 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
  }
  
  #sidebar-float-toggle:hover {
    transform: translateX(0) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  }
  
  /* Show floating button when sidebar is collapsed */
  .sidebar-collapsed ~ #sidebar-float-toggle,
  body.sidebar-collapsed #sidebar-float-toggle {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  body {
    background-color: white;
  }
  
  .sidebar,
  .no-print {
    display: none !important;
  }
}
