/* Navy and White Monochrome Color Scheme */
:root {
  /* Primary Navy Colors */
  --navy-primary: #1a237e;
  --navy-dark: #0d1442;
  --navy-light: #3949ab;
  --navy-lighter: #5c6bc0;
  --navy-lightest: #9fa8da;

  /* White and Gray Scale */
  --white-primary: #ffffff;
  --white-off: #f8f9fa;
  --gray-light: #e3f2fd;
  --gray-medium: #90a4ae;
  --gray-dark: #37474f;
  --gray-darker: #263238;

  /* Accent Colors (Navy variations) */
  --accent-primary: #1a237e;
  --accent-secondary: #3949ab;
  --accent-light: #5c6bc0;

  /* Status Colors (Navy variations) */
  --success: #2e7d32;
  --warning: #f57c00;
  --danger: #c62828;
  --info: #1565c0;

  /* Text Colors */
  --text-primary: #1a237e;
  --text-secondary: #37474f;
  --text-muted: #90a4ae;
  --text-light: #ffffff;

  /* Background Colors */
  --bg-primary: #e8e8e8;
  --bg-secondary: #e8e8e8;
  --bg-accent: #e3f2fd;
  --bg-dark: #1a237e;

  /* Border Colors */
  --border-light: #e3f2fd;
  --border-medium: #90a4ae;
  --border-dark: #1a237e;

  /* Shadow Colors */
  --shadow-light: rgba(26, 35, 126, 0.1);
  --shadow-medium: rgba(26, 35, 126, 0.2);
  --shadow-dark: rgba(26, 35, 126, 0.3);
}

body {
  background-color: #c4c3bf;
  color: var(--text-primary);
  font-family: 'Helvetica', 'Arial', sans-serif;
  height: 100%;
}

body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
  color: var(--text-primary);
}

body h2 {
  font-size: 2.5rem;
  margin: 0;
  color: #28282f;
}

body h3 {
  margin: 0;
  color: #28282f;
}

.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
}

.base-container {
  height: auto !important;
  max-width: 960px;
  background-color: #c4c3bf;
  border-radius: 0px;
}

#create-container {
  position: relative;
  background-color: var(--bg-primary);
  border-radius: 0px;
  padding: 1.5rem;
  /* box-shadow: 0 2px 8px var(--shadow-light); */
}

#main {
  height: 100%;
  min-width: 540px;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
}

#main .deal-details {
  height: auto;
  margin: auto;
  margin-top: 0.1rem !important;
  background-color: #ffffff;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px var(--shadow-light);
}

@media (min-width: 768px) {
  #main .deal-details {
    width: 100%;
  }
}

#main .deal-details #inputBody,
#main .deal-details #historyBody {
  margin-top: 0;
  background-color: #ffffff;
}

#main .deal-details .form-check {
  padding-left: 0;
}

#main .deal-details .form-check .g-3 {
  --bs-gutter-y: 0;
  --bs-gutter-x: 0;
}

.g-3 {
  gap: 0px !important;
}

/* Py-5 Container Styling */
.py-5.container {
  background-color: #ffffff;
  border-radius: 20px;
  min-height: calc(100% + 5px);
}


#main .deal-details .form-check .container-sm {
  padding-left: 0;
  margin: 0.5rem 0;

}

#main .deal-details .form-check .div-address {
  width: auto;
  margin-bottom: 0.5rem;
}

#main .deal-details .form-check #address {
  margin-bottom: 0;
  display: flex;
  flex-direction: row;
}

#main .deal-details .form-check #address #my-addr {
  margin-bottom: 0;
  color: var(--text-primary);
}

#main .deal-details .form-check #address #show-account {
  margin-left: 0.5rem;
  font-size: 1rem;
  margin-bottom: 0;
  color: var(--text-secondary);
}

#main .deal-details .form-check #connectButton {
  margin-top: 0.5rem;
  background-color: #28282f;
  border-color: #28282f;
  color: var(--text-light);
}

#main .deal-details .form-check #connectButton:hover {
  background-color: #1f1f2c;
  border-color: #1f1f2c;
}

#main .deal-details #create-deal-btn .toast-body {
  padding: 0;
}

#main .deal-details #create-deal-btn .toast-body .toast-body-div {
  margin-bottom: 0;
}

.history-div {
  width: 80%;
  color: var(--text-primary);
}

.historyLi {
  border: 1px solid var(--border-light);
  border-radius: 0px;
  /* margin-bottom: 0.5rem; */
  transition: all 0.2s ease;
}

.historyLi:hover {
  cursor: pointer;
  background-color: var(--bg-accent) !important;
  border-color: #28282f;
  box-shadow: 0 2px 4px var(--shadow-light);
  transform: translateY(-1px);
}

hr.my-4 {
  margin: 1rem 0 !important;
  border-color: var(--border-light);
}

.textLayout-div {
  /* margin-top: 1rem; */
  background-color: rgb(235, 235, 235);
  border-radius: 0px;
  padding: 1.5rem;
  /* box-shadow: 0 2px 8px var(--shadow-light); */
}

.textLayout-div.spec {
  margin-top: 0 !important;
}

.form-label {
  margin-bottom: 0;
  color: var(--text-primary);
  font-weight: 500;
}

.text-container {
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
  color: var(--text-primary);
}

@media (max-width: 425px) {
  .text-container {
    font-size: 15px !important;
  }
}

.txt {
  width: 20%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

.txt-muted {
  --bs-text-opacity: 1;
  color: var(--text-muted);
}

.txt-success {
  --bs-text-opacity: 1;
  color: var(--success) !important;
}

.toast-body {
  padding: 0;
}

.toast-body #toast-msg {
  margin-bottom: 0;
}

#fee-container {
  display: flex;
  flex-direction: row;
  padding-left: 0;
}

#fee-container {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0px !important;
}

#fee-container .btn {
  width: 100px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  border-radius: 0px !important;
  transition: all 0.2s ease !important;
  margin: 0 !important;
}

/* Role buttons container */
.role-buttons-container {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0px !important;
}

.btn-width {
  width: 120px !important;
  height: 45px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  border-radius: 0px !important;
  transition: all 0.2s ease !important;
  margin: 0 !important;
}

#buttonSection {
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  float: right;
}

#buttonSection button {
  width: 120px !important;
  height: 40px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Approve and New Deal buttons */
#buttonSection .btn-success,
#buttonSection .btn[data-action="approve"],
#buttonSection button[onclick*="approve"],
#buttonSection button[onclick*="new-deal"],
#buttonSection button:contains("Approve"),
#buttonSection button:contains("New Deal") {
  background-color: #dbff00;
  color: #000000;
  border: 2px solid #dbff00;
}

#buttonSection .btn-success:hover,
#buttonSection .btn[data-action="approve"]:hover,
#buttonSection button[onclick*="approve"]:hover,
#buttonSection button[onclick*="new-deal"]:hover,
#buttonSection button:contains("Approve"):hover,
#buttonSection button:contains("New Deal"):hover {
  background-color: #c7e600;
  border-color: #c7e600;
  color: #000000;
}

/* Other buttons (Change, etc.) */
#buttonSection .btn:not(.btn-danger):not(.btn-success):not([data-action="approve"]):not([onclick*="approve"]):not([onclick*="new-deal"]):not(:contains("Approve")):not(:contains("New Deal")) {
  background-color: #aaaaae;
  color: #000000;
  border: 2px solid #aaaaae;
}

#buttonSection .btn:not(.btn-danger):not(.btn-success):not([data-action="approve"]):not([onclick*="approve"]):not([onclick*="new-deal"]):not(:contains("Approve")):not(:contains("New Deal")):hover {
  background-color: #999999;
  border-color: #999999;
  color: #000000;
}

/* Cancel button */
#buttonSection .btn-danger {
  background-color: #f76450;
  color: #ffffff;
  border: 2px solid #f76450;
}

#buttonSection .btn-danger:hover {
  background-color: #e55a47;
  border-color: #e55a47;
  color: #ffffff;
}

/* Deal buttons container for horizontal alignment */
.deal-buttons-container {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  width: 100% !important;
}

/* Deal buttons alignment and sizing */
#cancel-deal,
#change-deal-step,
#next-deal-step,
#new-deal {
  width: 120px !important;
  height: 40px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 0px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
}

/* Change deal step button */
#change-deal-step {
  background-color: #c4c3bf;
  color: #000000;
  border: 2px solid #c4c3bf;
}

#change-deal-step:hover {
  background-color: #b0b0b5;
  border-color: #b0b0b5;
  color: #000000;
}

/* Next deal step and new deal buttons */
#next-deal-step,
#new-deal {
  background-color: #dbff00;
  color: #000000;
  border: 2px solid #dbff00;
}

#next-deal-step:hover,
#new-deal:hover {
  background-color: #c7e600;
  border-color: #c7e600;
  color: #000000;
}

/* Cancel deal button */
#cancel-deal {
  background-color: #f76450;
  color: #ffffff;
  border: 2px solid #f76450;
}

#cancel-deal:hover {
  background-color: #e55a47;
  border-color: #e55a47;
  color: #ffffff;
}

/* Admin decision buttons styling */
#buyer-right,
#seller-right {
  width: 100px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  border-radius: 0px !important;
  transition: all 0.2s ease !important;
  margin: 0 0.25rem !important;
}

#new-deal {
  float: left;
}

#feePayment {
  display: flex;
  flex-direction: row;
}

/* Form Elements Styling */
.form-control {
  border: 2px solid #4a6fa5;
  border-radius: 0px;
  padding: 0.75rem;
  font-size: 1rem;
  color: var(--text-primary);
  background-color: #ffffff;
  transition: all 0.2s ease;
}

.form-control:focus {
  border: 2px solid #4a6fa5;
  box-shadow: none;
  background-color: #ffffff;
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-select {
  border: 2px solid #4a6fa5;
  border-radius: 0px;
  padding: 0.75rem;
  font-size: 1rem;
  color: var(--text-primary);
  background-color: #ffffff;
  transition: all 0.2s ease;
}

.form-select:focus {
  border: 2px solid #4a6fa5;
  box-shadow: none;
  outline: none;
}

/* Button Styling */
.btn {
  border-radius: 0px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  padding: 0.75rem 1.5rem;
}

.btn.btn-primary {
  background-color: #dbff00;
  color: #000000;
  border: 2px solid #dbff00;
}

.btn.btn-primary:hover {
  background-color: #c7e600;
  border-color: #c7e600;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(219, 255, 0, 0.3);
}

.btn.btn-primary:active {
  transform: translateY(0);
}

/* Create Deal Button - Bright Yellow */
.btn.btn-primary.btn-lg {
  background-color: #dbff00;
  border: 2px solid #dbff00;
  color: #000000;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(219, 255, 0, 0.3);
}

.btn.btn-primary.btn-lg:hover {
  background-color: #c7e600;
  border-color: #c7e600;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(219, 255, 0, 0.5);
}

.btn.btn-primary.btn-lg:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(219, 255, 0, 0.4);
}

.btn.btn-secondary {
  background-color: #1f1f2c;
  color: #ffffff;
  border: 2px solid #1f1f2c;
}

.btn.btn-secondary:hover {
  background-color: #2a2a3a;
  border-color: #2a2a3a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(31, 31, 44, 0.3);
}

.btn.btn-outline-primary {
  border: 2px solid #1f1f2c;
  color: #1f1f2c;
  background-color: transparent;
}

.btn.btn-outline-primary:hover {
  background-color: #1f1f2c;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(31, 31, 44, 0.3);
}

.btn.btn-danger {
  background-color: var(--danger);
  color: var(--text-light);
}

.btn.btn-danger:hover {
  background-color: #b71c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px var(--shadow-medium);
}

/* Card Styling */
.card {
  border: 1px solid var(--border-light);
  border-radius: 0px;
  background-color: var(--bg-primary);
  box-shadow: 0 2px 8px var(--shadow-light);
}

/* Alert Styling */
.alert {
  border-radius: 0px;
  border: none;
}

.alert.alert-success {
  background-color: #e8f5e8;
  color: var(--success);
}

.alert.alert-danger {
  background-color: #ffebee;
  color: var(--danger);
}

.alert.alert-warning {
  background-color: #fff3e0;
  color: var(--warning);
}

.alert.alert-info {
  background-color: var(--bg-accent);
  color: var(--info);
}

/* Footer Job Banner Styles */
.job-banner {
  position: fixed;
  bottom: 20px;
  left: 10px;
  right: 10px;
  width: calc(100% - 20px);
  height: 60px;
  background: #ffffff;
  z-index: 1000;
  overflow: hidden;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #00ff41;
  border-radius: 20px;
  display: none;
}

.job-banner-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-slider {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(100%);
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: #ffffff;
  cursor: pointer;
}

.job-slide.active {
  opacity: 1;
  transform: translateX(0);
}

.job-slide.prev {
  transform: translateX(-100%);
  opacity: 0;
}

.job-slide:hover {
  background: #f8f8f8;
  transform: scale(1.02);
}

.job-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2f2f2f;
  text-align: center;
  text-shadow: none;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Animation for sliding effect */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

.job-slide.slide-in {
  animation: slideIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.job-slide.slide-out {
  animation: slideOut 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .job-banner {
    height: 50px;
  }

  .job-title {
    font-size: 1rem;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .job-title {
    font-size: 0.9rem;
    gap: 6px;
  }
}

/* Mobile touch targets and interactions */
.mobile-touch-target {
  min-height: 44px !important;
  min-width: 44px !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.mobile-button-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 1rem !important;
  padding: 0 !important;
}

.mobile-button-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
}

/* Enhanced mobile form styling */
@media (max-width: 768px) {
  #main {
    min-width: 100%;
    padding: 0.5rem;
  }

  #create-container {
    padding: 1rem;
    margin: 0;
  }

  #main .deal-details {
    margin: 0;
    padding: 1rem;
    border-radius: 15px;
  }

  .textLayout-div {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
  }

  .form-control,
  .form-select {
    min-height: 44px;
    font-size: 16px;
    /* Prevents zoom on iOS */
    padding: 0.75rem;
  }

  .btn-width {
    min-height: 44px !important;
    width: 140px !important;
    font-size: 1rem !important;
  }

  #fee-container .btn {
    min-height: 44px !important;
    width: 110px !important;
    font-size: 0.9rem !important;
  }

  .role-buttons-container {
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  #fee-container {
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  #buttonSection {
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    float: none !important;
  }

  #buttonSection button,
  #buttonSection a {
    min-height: 44px !important;
    width: auto !important;
    min-width: 140px !important;
    padding: 0.75rem 1.5rem !important;
  }

  .mobile-button-container {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .mobile-button-group {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* iPhone 16 and similar device optimizations */
@media (max-width: 430px) {
  body {
    font-size: 16px;
    /* Prevents zoom on iOS */
  }

  h4 {
    font-size: 1.3rem;
  }

  h5 {
    font-size: 1.1rem;
  }

  .text-container {
    font-size: 16px !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .div-address {
    width: 100% !important;
  }

  #address {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  #address #show-account {
    margin-left: 0 !important;
    margin-top: 0.25rem;
    font-size: 14px;
  }

  .btn-width {
    width: 120px !important;
    font-size: 0.9rem !important;
  }

  #fee-container .btn {
    width: 90px !important;
    font-size: 0.8rem !important;
  }

  .mobile-button-group {
    flex-direction: column !important;
    width: 100% !important;
  }

  .mobile-button-group button,
  .mobile-button-group a {
    width: 100% !important;
    max-width: 280px !important;
    margin-bottom: 0.5rem !important;
  }
}

/* Safe area adjustments for iPhone 16 */
@media (max-width: 430px) and (min-height: 900px) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }

  .wrapper {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .job-banner {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

/* Mobile history list optimizations */
.mobile-history-list {
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.mobile-history-list .historyLi {
  min-height: 44px;
  /* Touch target */
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

/* Toast notifications for mobile */
@media (max-width: 768px) {
  .toast-container {
    position: fixed !important;
    bottom: calc(90px + env(safe-area-inset-bottom)) !important;
    right: 1rem !important;
    left: 1rem !important;
    width: auto !important;
    z-index: 1050;
  }

  .toast {
    width: 100% !important;
    max-width: none !important;
  }
}

/* Landscape mode optimizations for mobile */
@media (max-height: 500px) and (orientation: landscape) {
  #main .deal-details {
    flex-direction: row;
    overflow-x: auto;
  }

  #inputBody {
    min-width: 400px;
  }

  #historyBody {
    min-width: 300px;
  }

  .py-5.container {
    padding: 1rem !important;
  }

  .mobile-history-list {
    max-height: 200px;
  }
}

/* Adjust body padding to accommodate fixed footer */
body {
  padding-bottom: 90px;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 80px;
  }
}