/* Base styles for Bulma compatibility */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding-top: 3.25rem; /* Account for fixed navbar */
}

/* Login page background */
body.login-page {
  padding-top: 0; /* remove navbar offset on login layout */
  background: linear-gradient(135deg, #f3f7ff 0%, #e9f0ff 100%);
}

/* Main Layout Structure */
.main-container {
  display: flex;
  min-height: calc(100vh - 3.25rem);
  position: relative;
}

/* Sidebar Styles */
.sidebar {
  width: 250px;
  min-height: calc(100vh - 3.25rem);
  background-color: #f5f5f5;
  border-right: 1px solid #dbdbdb;
  transition: transform 0.3s ease;
  position: fixed;
  top: 3.25rem;
  left: 0;
  z-index: 30;
  overflow-y: auto;
}

.sidebar-content {
  padding: 1.5rem 1rem;
}

.sidebar-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #dbdbdb;
}

.sidebar-header .title {
  margin: 0;
  color: #363636;
  font-weight: 600;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 250px;
  padding: 2rem 1rem;
  background-color: #fafafa;
  min-height: calc(100vh - 3.25rem);
  transition: margin-left 0.3s ease;
}

/* Mobile Sidebar */
@media screen and (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.is-active {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
}

/* Custom Bulma overrides */
.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 40;
}

.navbar-brand .navbar-item {
  font-weight: 600;
  color: #363636;
}

.navbar-item {
  transition: background-color 0.3s ease;
}

.navbar-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Menu Styles */
.menu-list a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  color: #4a4a4a;
  transition: all 0.3s ease;
  text-decoration: none;
  margin-bottom: 0.25rem;
}

.menu-list a:hover {
  background-color: #e8e8e8;
  color: #363636;
  transform: translateX(4px);
}

.menu-list a.is-active {
  background-color: #667eea;
  color: white;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.menu-list a .icon {
  margin-right: 0.75rem;
  width: 1.5rem;
}

.menu-label {
  color: #7a7a7a;
  font-size: 0.75em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 2rem;
}

.menu-label:first-child {
  margin-top: 0;
}

/* Login specific styles */
.login-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  max-width: 400px;
  width: 100%;
}

.box {
  transition: box-shadow 0.3s ease;
  animation: fadeIn 0.5s ease-out;
}

.box:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Button enhancements */
.button {
  font-weight: 500;
  transition: all 0.3s ease;
}

.button.is-primary {
  background-color: #667eea;
}

.button.is-primary:hover {
  background-color: #5a6fd8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Form enhancements */
.input:focus, .textarea:focus, .select select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.125em rgba(102, 126, 234, 0.25);
}

/* Icon styles */
.icon.is-large {
  width: 3rem;
  height: 3rem;
}

/* Notification styles */
.notification.is-danger {
  background-color: #ff3860;
  color: #fff;
}

/* Help text for form validation */
.help.is-danger {
  color: #ff3860;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Loading state for buttons */
.button.is-loading {
  pointer-events: none;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .login-box {
    margin: 0 1rem;
  }
  
  .main-content {
    padding: 1rem 0.5rem;
  }
  
  .sidebar-content {
    padding: 1rem;
  }
}

/* Utility classes */
.is-fullheight-with-navbar {
  min-height: calc(100vh - 3.25rem);
}

.is-inline {
  display: inline-block;
}

/* Animation for page transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dropdown menu styles */
.navbar-dropdown {
  box-shadow: 0 8px 16px rgba(10, 10, 10, 0.1);
  border-radius: 6px;
  border: none;
}

/* Content area improvements */
.main-content .container {
  animation: fadeIn 0.5s ease-out;
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}