@import 'bootstrap/dist/css/bootstrap.min.css';
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Overhauled CSS for new light pastel theme */

:root {
  --bs-body-bg: #f5f7fa;
  --bs-body-color: #333333;
  --primary-blue: #4682B4; /* Steel blue */
  --primary-blue-light: #d0e9ff; /* Light sky blue */
  --primary-blue-dark: #00a3ff; /* Deeper sky blue */
  --secondary-gray: #adb5bd;
  --card-bg: #ffffff;
  --card-shadow: rgba(0, 0, 0, 0.05); /* Softer shadow */
  --border-radius: 12px;
}

body {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  font-family: 'Inter', sans-serif;
}

.sidebar {
  background: var(--primary-blue);
  width: 250px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  box-shadow: 2px 0 8px var(--card-shadow);
  border-radius: 0 12px 12px 0;
  padding-top: 1rem;
}

.sidebar a,
.sidebar button {
  color: #000;
  font-weight: 600;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--border-radius);
  transition: background-color 0.3s, color 0.3s;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar a:hover,
.sidebar a.active,
.sidebar button:hover,
.sidebar button.active {
  background-color: var(--primary-blue-dark);
  color: #000;
}

.sidebar a i,
.sidebar button i {
  font-size: 1.2rem;
  color: #000;
}

.topbar {
  height: 60px;
  background: #ffffff;
  position: fixed;
  top: 0;
  left: 250px;
  right: 0;
  z-index: 999;
  box-shadow: 0 2px 8px var(--card-shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  border-radius: 0 0 12px 12px;
  color: var(--primary-blue-dark);
  transition: height 0.3s ease, padding 0.3s ease, border 0.3s ease;
}

.topbar h5 {
  color: var(--primary-blue-dark);
  font-weight: 700;
  margin: 0;
}

.topbar form {
  max-width: 300px;
  width: 100%;
}

.topbar input[type="search"] {
  border: 1px solid var(--secondary-gray);
  border-radius: var(--border-radius) 0 0 var(--border-radius);
  padding: 6px 12px;
  width: 100%;
  font-size: 0.9rem;
  color: var(--bs-body-color);
}

.topbar button {
  border: 1px solid var(--secondary-gray);
  border-left: none;
  background-color: var(--primary-blue-light);
  color: var(--primary-blue-dark);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  padding: 6px 12px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.topbar button:hover {
  background-color: var(--primary-blue-dark);
  color: #fff;
}

.topbar .dropdown-toggle {
  color: var(--primary-blue-dark);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar .dropdown-menu {
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px var(--card-shadow);
}

/* Collapse topbar when submenu is open */
.topbar.collapsed {
  height: 0;
  overflow: hidden;
  padding: 0 !important;
  border: none !important;
}

.main-content {
  margin-left: 250px;
  margin-top: 60px;
  padding: 2rem;
  min-height: calc(100vh - 60px);
  background-color: var(--bs-body-bg);
}

.card {
  background: var(--card-bg);
  border: 1px solid #e1e5eb;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: var(--bs-body-color);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px var(--card-shadow);
}

.card-title {
  color: var(--primary-blue-dark);
  font-weight: 700;
  margin-bottom: 1rem;
}

.btn-primary {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: background-color 0.3s;
}

.btn-primary:hover {
  background-color: var(--primary-blue-dark);
  border-color: var(--primary-blue-dark);
}

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

.text-secondary-gray {
  color: var(--secondary-gray);
}

/* Tables */
.table {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 8px var(--card-shadow);
}

.table thead {
  background-color: var(--primary-blue-light);
  color: var(--primary-blue-dark);
  font-weight: 600;
}

.table tbody tr:hover {
  background-color: var(--primary-blue-light);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
    border-radius: 0;
  }
  .topbar {
    left: 0;
    border-radius: 0;
  }
  .main-content {
    margin-left: 0;
    margin-top: 60px;
    padding: 1rem;
  }
}
