@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom styles */
@layer components {
  .preloader {
    @apply fixed left-0 top-0 z-[9999] flex h-screen w-screen items-center justify-center bg-white dark:bg-gray-900;
  }

  .spinner {
    @apply h-10 w-10 animate-spin rounded-full border-4 border-primary border-t-transparent;
  }
}

/* Additional custom styles can be added here */

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.btn {
    @apply border border-gray-300 dark:border-gray-600;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  @apply bg-white text-gray-900 dark:bg-gray-900 dark:text-gray-100;
}

/* Sidebar */
#wrapper {
    overflow-x: hidden;
}

#sidebar-wrapper {
    min-height: 100vh;
    margin-left: -15rem;
    transition: margin 0.25s ease-out;
    @apply bg-white dark:bg-gray-800;
}

#sidebar-wrapper .sidebar-heading {
    padding: 0.875rem 1.25rem;
    font-size: 1.2rem;
    @apply text-gray-900 dark:text-white;
}

#sidebar-wrapper .list-group {
    width: 15rem;
}

#page-content-wrapper {
    min-width: 100vw;
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
}

/* Override Bootstrap list-group styles */
#sidebar-wrapper .list-group-item,
#sidebar-wrapper .list-group-item.active,
#sidebar-wrapper .list-group-item.active.bg-light,
#sidebar-wrapper .list-group-item.bg-light {
    border: none !important;
    text-decoration: none !important;
}

#sidebar-wrapper .list-group-item.active,
#sidebar-wrapper .list-group-item.active.bg-light {
    background-color: #2563eb !important; /* blue-600 */
    color: #ffffff !important;
    border-color: transparent !important;
}

#sidebar-wrapper .list-group-item.active.bg-light {
    background-color: #2563eb !important; /* blue-600 */
}

.dark #sidebar-wrapper .list-group-item.active,
.dark #sidebar-wrapper .list-group-item.active.bg-light {
    background-color: #3b82f6 !important; /* blue-500 */
    color: #ffffff !important;
}

#sidebar-wrapper .list-group-item.bg-light {
    background-color: #f3f4f6 !important; /* gray-100 */
}

.dark #sidebar-wrapper .list-group-item.bg-light {
    background-color: #374151 !important; /* gray-700 */
}

#sidebar-wrapper .list-group-item {
    background-color: #ffffff !important;
    color: #111827 !important; /* gray-900 */
}

.dark #sidebar-wrapper .list-group-item {
    background-color: #1f2937 !important; /* gray-800 */
    color: #f3f4f6 !important; /* gray-100 */
}

/* Navbar */
.navbar {
    @apply bg-white dark:bg-gray-800;
    padding: 0.5rem 1rem;
}

#menu-toggle {
    margin-right: 1rem;
}

/* Content area */
.container-fluid {
    padding: 1.5rem;
}

/* Cards */
.card {
    @apply bg-white dark:bg-gray-800;
    margin-bottom: 1.5rem;
}

.card-header {
    @apply bg-gray-50 dark:bg-gray-700;
    border-bottom: 1px solid rgba(0,0,0,.125);
}

/* Tables */
.table {
    @apply text-gray-900 dark:text-gray-100;
}

.table th {
    border-top: none;
    @apply bg-gray-50 dark:bg-gray-700;
}

.table td {
    @apply border-gray-200 dark:border-gray-600;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    @apply bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 border-gray-300 dark:border-gray-600;
}

/* Alerts */
.alert {
    margin-bottom: 1rem;
}

/* Buttons */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Icons */
.fas {
    margin-right: 0.5rem;
}

/* Dark mode transitions */
.dark-mode-transition {
    @apply transition-colors duration-200;
}