/* General Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", "Helvetica", "Arial", sans-serif; /* Modern font */
  background: linear-gradient(135deg, #1c2526, #2e3839); /* Subtle gradient */
  color: #e0e0e0; /* Softer white */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: all 0.4s ease;
}

body.light-mode {
  background: linear-gradient(135deg, #f4f4f4, #e0e0e0); /* Light gradient */
  color: #2d3436; /* Darker gray for contrast */
}

/* Container Styling */
.container {
  max-width: 1300px; /* Slightly wider */
  margin: 30px auto;
  padding: 0 20px;
  flex: 1;
}

/* Navbar Styling */
.navbar {
  background: linear-gradient(90deg, #2e3839, #3e494a); /* Gradient navbar */
  padding: 15px 25px;
  border-bottom: 2px solid rgba(68, 68, 68, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.4s ease;
}

body.light-mode .navbar {
  background: linear-gradient(90deg, #ffffff, #f8f9fa);
  border-bottom: 2px solid rgba(221, 221, 221, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  color: #00d4c4; /* Vibrant teal */
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: color 0.3s ease, transform 0.3s ease;
}

.navbar-brand:hover {
  color: #00b4a4;
  transform: scale(1.05);
}

body.light-mode .navbar-brand {
  color: #00b4a4;
}

.nav-link {
  color: #b0bec5 !important; /* Softer gray */
  font-size: 15px;
  margin-left: 20px;
  font-weight: 500;
  transition: color 0.3s ease, transform 0.3s ease;
}

body.light-mode .nav-link {
  color: #636e72 !important; /* Muted gray */
}

.nav-link:hover,
.nav-link.active {
  color: #00d4c4 !important;
  transform: translateY(-2px); /* Subtle lift */
}

.sign-up-btn,
.sign-in-btn {
  background: linear-gradient(45deg, #00d4c4, #00a99d); /* Gradient button */
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 25px; /* Rounded */
  box-shadow: 0 2px 8px rgba(0, 212, 196, 0.3);
  transition: all 0.3s ease;
}

.sign-up-btn:hover,
.sign-in-btn:hover {
  background: linear-gradient(45deg, #00b4a4, #008d83);
  box-shadow: 0 4px 12px rgba(0, 212, 196, 0.5);
  transform: translateY(-2px);
}

/* Mode Toggle Button */
#mode-toggle {
  background: linear-gradient(45deg, #3e494a, #2e3839);
  border: none;
  color: #00d4c4;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

body.light-mode #mode-toggle {
  background: linear-gradient(45deg, #f8f9fa, #e9ecef);
  color: #00b4a4;
}

#mode-toggle:hover {
  background: linear-gradient(45deg, #00d4c4, #00a99d);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 212, 196, 0.5);
  transform: translateY(-2px);
}

/* Invoice Wrapper */
.invoice-wrapper {
  display: flex;
  justify-content: space-between;
  background: linear-gradient(135deg, #2e3839, #3e494a);
  border: 1px solid rgba(68, 68, 68, 0.5);
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.4s ease;
  animation: slideUp 0.6s ease-out;
}

body.light-mode .invoice-wrapper {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  border-color: rgba(221, 221, 221, 0.5);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.main-content {
  flex: 1;
  padding-right: 25px;
}

.right-sidebar {
  width: 220px;
  text-align: center;
}

.right-sidebar h3 {
  font-size: 28px;
  font-weight: 700;
  color: #00d4c4;
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Form Fields */
.form-label {
  font-weight: 600;
  color: #b0bec5;
  font-size: 15px;
  margin-bottom: 6px;
  transition: color 0.3s ease;
}

body.light-mode .form-label {
  color: #636e72;
}

.form-control,
textarea,
.form-select {
  border: 1px solid rgba(68, 68, 68, 0.5);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  background: linear-gradient(135deg, #3e494a, #2e3839);
  color: #e0e0e0 !important;
  width: 100%;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

body.light-mode .form-control,
body.light-mode textarea,
body.light-mode .form-select {
  border-color: rgba(221, 221, 221, 0.5);
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  color: #2d3436 !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Placeholder Styling */
.form-control::placeholder,
textarea::placeholder,
.form-select::placeholder {
  color: #ffffff; /* Set placeholder color to white */
  opacity: 0.7; /* Slightly reduce opacity for better contrast */
}

body.light-mode .form-control::placeholder,
body.light-mode textarea::placeholder,
body.light-mode .form-select::placeholder {
  color: #ffffff; /* Keep placeholder color white in light mode */
  opacity: 0.7;
}

.form-control:focus,
textarea:focus,
.form-select:focus {
  border-color: #00d4c4;
  box-shadow: 0 0 8px rgba(0, 212, 196, 0.6);
  background: #3e494a; /* Darker on focus */
}

body.light-mode .form-control:focus,
body.light-mode textarea:focus,
body.light-mode .form-select:focus {
  background: #ffffff;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Button Styling */
.btn-primary {
  background: linear-gradient(45deg, #00d4c4, #00a99d);
  border: none;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 25px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 212, 196, 0.3);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(45deg, #00b4a4, #008d83);
  box-shadow: 0 4px 12px rgba(0, 212, 196, 0.5);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(45deg, #27ae60, #219653);
  border: none;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 25px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
  transition: all 0.3s ease;
}

.btn-success:hover {
  background: linear-gradient(45deg, #219653, #1e8449);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.5);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(45deg, #e74c3c, #c0392b);
  border: none;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 25px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background: linear-gradient(45deg, #c0392b, #a93226);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.5);
  transform: translateY(-2px);
}

/* Items Section */
.items-heading {
  font-size: 20px;
  font-weight: 700;
  margin-top: 25px;
  margin-bottom: 15px;
  color: #00d4c4;
  letter-spacing: 0.5px;
}

#items-container {
  border: 1px solid rgba(68, 68, 68, 0.5);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 25px;
  transition: border-color 0.4s ease;
  position: relative;
}

body.light-mode #items-container {
  border-color: rgba(221, 221, 221, 0.5);
}

#items-container::before {
  content: "Items                                                                                       Quantity                                           Price                                     Amount";
  white-space: pre;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  background: linear-gradient(90deg, #333, #444); /* Gradient header */
  color: #e0e0e0;
  font-weight: 600;
  padding: 12px 20px;
  font-size: 15px;
  border-bottom: 1px solid rgba(68, 68, 68, 0.5);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

body.light-mode #items-container::before {
  background: linear-gradient(90deg, #e9ecef, #dee2e6);
  color: #2d3436;
  border-bottom: 1px solid rgba(221, 221, 221, 0.5);
}

.item-row {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, #2e3839, #3e494a);
  border-bottom: 1px solid rgba(68, 68, 68, 0.5);
  transition: all 0.3s ease;
}

body.light-mode .item-row {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  border-bottom: 1px solid rgba(221, 221, 221, 0.5);
}

.item-row:hover {
  background: linear-gradient(135deg, #3e494a, #4e595a);
  transform: translateX(5px); /* Subtle shift */
}

body.light-mode .item-row:hover {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.item-row:last-child {
  border-bottom: none;
}

.item-row .amount {
  font-weight: 600;
  text-align: center;
  color: #00d4c4;
}

/* Summary Section */
.summary-section {
  margin-top: 25px;
  text-align: right;
  padding: 20px;
  background: linear-gradient(135deg, #3e494a, #2e3839);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.4s ease;
  animation: slideUp 0.6s ease-out;
}

body.light-mode .summary-section {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.summary-row,
.summary-total-balance,
.amount-paid {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 25px;
  margin-bottom: 12px;
}

.summary-row span,
.summary-total-balance span {
  font-weight: 600;
}

.summary-total-balance span {
  color: #00d4c4;
  font-size: 18px;
  font-weight: 700;
}

/* History Page */
.history-container {
  background: linear-gradient(135deg, #2e3839, #3e494a);
  padding: 35px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.4s ease;
  animation: slideUp 0.6s ease-out;
}

body.light-mode .history-container {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.table {
  background: transparent;
  color: #e0e0e0;
  transition: all 0.4s ease;
}

body.light-mode .table {
  color: #2d3436;
}

.table thead th {
  background: linear-gradient(90deg, #333, #444);
  color: #e0e0e0;
  font-weight: 600;
  padding: 12px;
  border-bottom: 2px solid rgba(68, 68, 68, 0.5);
}

body.light-mode .table thead th {
  background: linear-gradient(90deg, #e9ecef, #dee2e6);
  color: #2d3436;
  border-bottom: 2px solid rgba(221, 221, 221, 0.5);
}

/* Authentication Pages */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(
    135deg,
    #6e8efb,
    #a777e3,
    #00d4c4
  ); /* Vibrant gradient */
  animation: gradientShift 10s ease infinite alternate;
}

.auth-box {
  background: linear-gradient(135deg, #2e3839, #3e494a);
  padding: 35px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.4s ease;
  animation: slideUp 0.6s ease-out;
}

body.light-mode .auth-box {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Blog Page Styling */
.blog-container {
  background: linear-gradient(135deg, #2e3839, #3e494a);
  padding: 35px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.4s ease;
  animation: slideUp 0.6s ease-out;
}

body.light-mode .blog-container {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.blog-heading {
  font-size: 28px;
  font-weight: 700;
  color: #00d4c4;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.blog-description {
  font-size: 16px;
  color: #b0bec5;
  margin-bottom: 25px;
}

body.light-mode .blog-description {
  color: #636e72;
}

.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.blog-post {
  background: linear-gradient(135deg, #3e494a, #2e3839);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

body.light-mode .blog-post {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.blog-post:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 212, 196, 0.3);
}

.post-title {
  font-size: 22px;
  font-weight: 600;
  color: #00d4c4;
  margin-bottom: 10px;
}

.post-date {
  font-size: 14px;
  color: #b0bec5;
  margin-bottom: 15px;
}

body.light-mode .post-date {
  color: #636e72;
}

.post-content {
  font-size: 15px;
  color: #e0e0e0;
}

body.light-mode .post-content {
  color: #2d3436;
}

.post-content ul {
  list-style: none;
  padding-left: 0;
}

.post-content li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
}

.post-content li::before {
  content: "➜";
  color: #00d4c4;
  position: absolute;
  left: 0;
}

.no-posts-message {
  font-size: 16px;
  color: #b0bec5;
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #3e494a, #2e3839);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.light-mode .no-posts-message {
  color: #636e72;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Guide Page Styling */
.help-container {
  background: linear-gradient(135deg, #2e3839, #3e494a);
  padding: 35px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.4s ease;
  animation: slideUp 0.6s ease-out;
}

body.light-mode .help-container {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.help-heading {
  font-size: 28px;
  font-weight: 700;
  color: #00d4c4;
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.guide-section {
  background: linear-gradient(135deg, #3e494a, #2e3839);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

body.light-mode .guide-section {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.guide-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 212, 196, 0.3);
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  color: #00d4c4;
  margin-bottom: 15px;
}

.section-content {
  font-size: 15px;
  color: #e0e0e0;
  margin-bottom: 15px;
  line-height: 1.6;
}

body.light-mode .section-content {
  color: #2d3436;
}

/* Footer */
.footer {
  background: linear-gradient(90deg, #2e3839, #3e494a);
  color: #b0bec5;
  padding: 40px 20px; /* Increased padding for better spacing */
  border-top: 2px solid rgba(68, 68, 68, 0.5);
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.4s ease;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

body.light-mode .footer {
  background: linear-gradient(90deg, #ffffff, #f8f9fa);
  color: #636e72;
  border-top: 2px solid rgba(221, 221, 221, 0.5);
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 40px; /* Space between sections */
}

.footer-section {
  flex: 1;
  min-width: 200px; /* Ensure sections don't collapse too small */
}

.footer-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: #00d4c4;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

body.light-mode .footer-section h4 {
  color: #00b4a4;
}

.footer-section p {
  margin-bottom: 10px;
}

.footer-section a {
  color: #b0bec5;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease;
}

body.light-mode .footer-section a {
  color: #636e72;
}

.footer-section a:hover {
  color: #00d4c4;
  transform: translateX(5px); /* Subtle shift on hover */
}

body.light-mode .footer-section a:hover {
  color: #00b4a4;
}

.footer-right {
  text-align: right;
  flex: 1;
  min-width: 200px;
}

.footer-right .copyright {
  font-size: 14px;
  margin-bottom: 15px;
}

.footer-right .copyright a {
  color: #00d4c4;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

body.light-mode .footer-right .copyright a {
  color: #00b4a4;
}

.footer-right .copyright a:hover {
  color: #00b4a4;
}

body.light-mode .footer-right .copyright a:hover {
  color: #008d83;
}

.social-links {
  margin-bottom: 15px;
  display: flex;
  justify-content: flex-end;
  gap: 15px; /* Space between icons */
}

.social-links a {
  display: inline-block;
  transition: transform 0.3s ease;
}

.social-links img {
  width: 24px; /* Consistent size for icons */
  height: 24px;
  filter: brightness(0.8); /* Slightly dimmed for contrast */
  transition: filter 0.3s ease, transform 0.3s ease;
}

body.light-mode .social-links img {
  filter: brightness(0.6);
}

.social-links a:hover img {
  filter: brightness(1);
  transform: scale(1.2); /* Slight zoom on hover */
}

.footer-links {
  font-size: 14px;
}

.footer-links a {
  color: #00d4c4;
  text-decoration: none;
  margin: 0 5px;
  transition: color 0.3s ease;
}

body.light-mode .footer-links a {
  color: #00b4a4;
}

.footer-links a:hover {
  color: #00b4a4;
}

body.light-mode .footer-links a:hover {
  color: #008d83;
}

/* Enhanced Animations */
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .invoice-wrapper {
    flex-direction: column;
    padding: 20px;
  }

  .main-content {
    padding-right: 0;
  }

  .right-sidebar {
    width: 100%;
    margin-top: 25px;
  }

  .bill-to-ship-to,
  .date-terms {
    flex-direction: column;
  }

  .summary-row,
  .summary-total-balance {
    flex-direction: column;
    gap: 15px;
  }

  #mode-toggle {
    margin-top: 15px;
  }

  /* Blog Responsive */
  .blog-container {
    padding: 20px;
  }

  .blog-heading {
    font-size: 24px;
  }

  .post-title {
    font-size: 20px;
  }

  /* Guide Responsive */
  .help-container {
    padding: 20px;
  }

  .help-heading {
    font-size: 24px;
  }

  .section-title {
    font-size: 20px;
  }

  /* Footer Responsive */
  .footer {
    flex-direction: column;
    text-align: center;
  }

  .footer-content {
    justify-content: center;
    gap: 30px;
  }

  .footer-right {
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .navbar-nav {
    flex-direction: column;
    align-items: center;
  }

  .nav-item {
    margin-bottom: 15px;
  }

  .navbar-brand {
    font-size: 20px;
  }

  #items-container::before {
    font-size: 13px;
    padding: 10px 15px;
  }

  /* Footer Responsive */
  .footer-section {
    min-width: 100%;
  }

  .footer-section h4 {
    font-size: 14px;
  }

  .footer-section a {
    font-size: 13px;
  }

  .footer-right .copyright,
  .footer-links {
    font-size: 13px;
  }

  .social-links img {
    width: 20px;
    height: 20px;
  }
}