/* Google Fonts Import */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

/* Base styles and typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #111827;
  line-height: 1.5;
  background-color: #f3f4f6;
}

/* Custom wave shape divider */
.custom-shape-divider-bottom-1709766271 {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: -1;
}

.custom-shape-divider-bottom-1709766271 svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 150px;
}

.custom-shape-divider-bottom-1709766271 .shape-fill {
  fill: #3b82f6;
}

/* Login page styles */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.login-container {
  width: 100%;
  max-width: 28rem;
}

.login-box {
  background-color: white;
  padding: 2rem 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.login-icon {
  font-size: 3rem;
  color: #3b82f6;
}

.login-title {
  margin-top: 1rem;
  text-align: center;
  font-size: 1.875rem;
  font-weight: 800;
  color: #111827;
}

.error-message {
  margin-top: 1rem;
  background-color: #fef2f2;
  border-left: 4px solid #ef4444;
  padding: 1rem;
}

.error-icon {
  color: #ef4444;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.input-group {
  margin-top: 0.25rem;
  position: relative;
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.form-input:focus {
  outline: none;
  ring: 2px;
  ring-color: #3b82f6;
  border-color: #3b82f6;
}

.submit-button {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  color: white;
  background-color: #2563eb;
  transition: background-color 0.2s;
}

.submit-button:hover {
  background-color: #1d4ed8;
}

.submit-button:focus {
  outline: none;
  ring: 2px;
  ring-offset: 2px;
  ring-color: #3b82f6;
}

.button-icon {
  position: absolute;
  left: 0;
  inset-y: 0;
  display: flex;
  align-items: center;
  padding-left: 0.75rem;
}

/* Dashboard styles */
.dashboard-nav {
  background-color: white;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  height: 4rem;
}

.brand-logo {
  font-size: 1.5rem;
  color: #3b82f6;
}

.brand-text {
  margin-left: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.user-info {
  color: #374151;
  margin-right: 1rem;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  color: white;
  background-color: #dc2626;
}

.logout-button:hover {
  background-color: #b91c1c;
}

.dashboard-main {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  background-color: white;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.stat-icon {
  padding: 0.75rem;
  border-radius: 0.375rem;
  color: white;
}

.stat-icon.blue {
  background-color: #3b82f6;
}

.stat-icon.green {
  background-color: #10b981;
}

.stat-icon.purple {
  background-color: #8b5cf6;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 600;
  color: #111827;
}

.activity-section {
  margin-top: 2rem;
}

.activity-header {
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.activity-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #111827;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-item {
  padding: 1rem;
  display: flex;
  align-items: flex-start;
}

.activity-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.activity-content {
  margin-left: 1rem;
  flex: 1;
}

.activity-text {
  font-size: 0.875rem;
  color: #6b7280;
}

.activity-name {
  font-weight: 500;
  color: #111827;
}

.activity-time {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Login page animations */
.login-bg-animation {
  position: fixed;
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 0;
  overflow: hidden;
}

.login-bg-animation div {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(45deg, #3b82f6, #8b5cf6);
  animation: float 15s infinite;
  opacity: 0.1;
}

.login-bg-animation div:nth-child(1) {
  width: 70vh;
  height: 70vh;
  left: -20vh;
  top: -20vh;
  animation-delay: 0s;
}

.login-bg-animation div:nth-child(2) {
  width: 50vh;
  height: 50vh;
  right: -10vh;
  bottom: -10vh;
  animation-delay: -5s;
}

.login-bg-animation div:nth-child(3) {
  width: 60vh;
  height: 60vh;
  right: 30%;
  top: 50%;
  animation-delay: -10s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(2%, 2%) rotate(120deg);
  }
  66% {
    transform: translate(-2%, -1%) rotate(240deg);
  }
  100% {
    transform: translate(0, 0) rotate(360deg);
  }
}

/* Login form styles */
.login-field-group {
  position: relative;
}

.login-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.login-input-wrapper {
  position: relative;
}

.login-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  transition: color 0.2s;
}

.login-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #1f2937;
  transition: all 0.2s;
}

.login-input:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.login-input:focus + .login-input-icon {
  color: #3b82f6;
}

.login-button {
  position: relative;
  width: 100%;
  padding: 0.75rem 1rem;
  padding-left: 2.5rem;
  background: linear-gradient(to right, #3b82f6, #6366f1);
  color: white;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-button:hover {
  background: linear-gradient(to right, #2563eb, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.login-button i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease;
}

.login-button:hover i {
  color: white;
}

/* Card hover effect */
.bg-white.rounded-2xl {
  transition: transform 0.3s, box-shadow 0.3s;
}

.bg-white.rounded-2xl:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Input placeholder animation */
.login-input::placeholder {
  transition: opacity 0.2s;
}

.login-input:focus::placeholder {
  opacity: 0.5;
}

/* Error message animation */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.border-red-500 {
  animation: shake 0.5s ease-in-out;
}

/* New styles for modern dashboard */
.bg-light {
  background-color: #f3f4f6;
}

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

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.animate-fade-up {
  animation: fadeUp 0.8s ease-out forwards;
}

/* Credits Section */
.credits-section {
  margin-top: 2rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.add-credit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #10b981;
  color: white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.add-credit-btn:hover {
  background-color: #059669;
  transform: translateY(-1px);
}

/* Table Styles */
.table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

table.display {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
}

table.display thead th {
  background-color: #f9fafb;
  padding: 1rem;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  text-align: left;
}

table.display tbody td {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #4b5563;
}

/* Badge Styles */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge.consumer {
  background-color: #dbeafe;
  color: #1e40af;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  padding: 0.375rem;
  border-radius: 0.375rem;
  color: #6b7280;
  transition: all 0.2s;
}

.action-btn:hover {
  transform: translateY(-1px);
}

.action-btn.edit:hover {
  color: #3b82f6;
  background-color: #eff6ff;
}

.action-btn.view:hover {
  color: #10b981;
  background-color: #ecfdf5;
}

.action-btn.delete:hover {
  color: #ef4444;
  background-color: #fef2f2;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-content {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
  }

  .user-info {
    margin: 1rem 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .add-credit-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Modern Navbar Styles */
.navbar {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4rem;
  display: flex;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a56db;
  letter-spacing: -0.025em;
}

.navbar-brand i {
  font-size: 1.5rem;
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #4b5563;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
}

.navbar-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  margin-left: 2rem;
}

.navbar-start,
.navbar-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: #4b5563;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 0.9375rem;
}

.navbar-item:hover {
  background-color: #f3f4f6;
  color: #1a56db;
}

.navbar-item.active {
  background-color: #e0e7ff;
  color: #1a56db;
}

.navbar-item i {
  font-size: 1.25rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background-color: #f3f4f6;
  border-radius: 0.5rem;
  margin-right: 0.5rem;
}

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  color: #111827;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.user-role {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
}

.navbar-item.logout {
  color: #dc2626;
}

.navbar-item.logout:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

/* Modern Statistics Styles */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--card-color);
  opacity: 0.1;
}

.stat-card.primary {
  --card-color: #1a56db;
}
.stat-card.success {
  --card-color: #059669;
}
.stat-card.info {
  --card-color: #7c3aed;
}
.stat-card.warning {
  --card-color: #d97706;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background-color: var(--card-color);
  opacity: 0.8;
}

.stat-icon i {
  position: relative;
  font-size: 1.5rem;
  color: #ffffff;
  opacity: 1;
}

.stat-details {
  flex: 1;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  margin: 0.25rem 0 0.75rem 0;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.stat-trend.positive {
  color: #059669;
}

.stat-trend.negative {
  color: #dc2626;
}

.stat-trend.neutral {
  color: #6b7280;
}

.trend-period {
  color: #6b7280;
  margin-left: 0.25rem;
  font-weight: 400;
}

/* Responsive Navbar */
@media (max-width: 1024px) {
  .navbar-container {
    height: auto;
    padding: 1rem;
    flex-wrap: wrap;
  }

  .navbar-toggle {
    display: block;
  }

  .navbar-menu {
    display: none;
    width: 100%;
    margin: 1rem 0 0 0;
    flex-direction: column;
    gap: 1rem;
  }

  .navbar-menu.active {
    display: flex;
  }

  .navbar-start,
  .navbar-end {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .navbar-item {
    width: 100%;
    justify-content: flex-start;
  }

  .user-profile {
    width: 100%;
    margin: 0;
  }
}

/* Responsive Stats */
@media (max-width: 640px) {
  .stats-container {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 1.25rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

/* Updated navbar styles */
.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.025em;
}

.navbar-item {
  font-weight: 500;
  font-size: 0.9375rem;
}

.profile-icon {
  font-size: 1.75rem;
  color: #4b5563;
}

.user-name {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.user-role {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Updated stat card styles */
.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}

.stat-trend {
  font-size: 0.8125rem;
  font-weight: 500;
}

.trend-period {
  font-weight: 400;
}

/* Updated table styles */
table.display thead th {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

table.display tbody td {
  font-size: 0.9375rem;
  font-weight: 400;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* Section titles */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Button styles */
.add-credit-btn {
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Enhanced Search Styles */
.table-header {
  margin-bottom: 1.5rem;
}

.enhanced-search {
  width: 100%;
  max-width: 300px;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.enhanced-search:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.enhanced-search::placeholder {
  color: #9ca3af;
}

/* Updated Table Container */
.table-container {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-top: 1rem;
}

/* DataTables Customization */
.dataTables_wrapper {
  margin-top: 1rem;
}

.dataTables_length select {
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  cursor: pointer;
}

.dataTables_paginate {
  margin-top: 1rem;
  display: flex;
  gap: 0.25rem;
}

.dataTables_paginate .paginate_button {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s;
}

.dataTables_paginate .paginate_button:hover {
  background-color: #f3f4f6;
  color: #1a56db;
}

.dataTables_paginate .paginate_button.current {
  background-color: #e0e7ff;
  color: #1a56db;
  font-weight: 500;
}

.dataTables_info {
  margin-top: 1rem;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .enhanced-search {
    max-width: 100%;
  }

  .table-container {
    padding: 1rem;
  }

  .dataTables_wrapper {
    overflow-x: auto;
  }
}
