/* ========================================= */
/* Matilde Saunders Button Styles */
/* ========================================= */

/* ========================================= */
/* Red Button (from #E60002 to #AF1720) */
/* ========================================= */
.ms-btn-red {
  position: relative;
  display: inline-block;
}

.ms-btn-red button,
.ms-btn-red input[type="submit"],
.ms-btn-red a {
  position: relative;
  padding: 15px 30px;
  background-color: #e60002;
  color: #ffffff;
  cursor: pointer;
  z-index: 1;
  text-align: center;
  text-decoration: none;
  font-family: sans-serif;
  font-size: 16px;
  border: none;
  transition: color 0.4s ease-in-out;
  display: inline-block;
}

.ms-btn-red button::before,
.ms-btn-red input[type="submit"]::before,
.ms-btn-red a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: #af1720;
  z-index: -1;
  transition: width 0.4s ease-in-out;
}

.ms-btn-red button:hover,
.ms-btn-red input[type="submit"]:hover,
.ms-btn-red a:hover {
  color: #ffffff !important;
}

.ms-btn-red button:hover::before,
.ms-btn-red input[type="submit"]:hover::before,
.ms-btn-red a:hover::before {
  width: 100%;
}

/* ========================================= */
/* Blue Button (from #2F3B4B to #596F7E) */
/* ========================================= */
.ms-btn-blue {
  position: relative;
  display: inline-block;
}

.ms-btn-blue button,
.ms-btn-blue input[type="submit"],
.ms-btn-blue a,
.ms-btn-blue span {
  position: relative;
  padding: 15px 30px;
  background-color: #2f3b4b;
  color: #ffffff;
  cursor: pointer;
  z-index: 1;
  text-align: center;
  text-decoration: none;
  font-family: sans-serif;
  font-size: 10px;
  border: none;
  transition: color 0.4s ease-in-out;
  display: inline-block;
}

.ms-btn-blue button::before,
.ms-btn-blue input[type="submit"]::before,
.ms-btn-blue a::before,
.ms-btn-blue span::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: #596f7e;
  z-index: -1;
  transition: width 0.4s ease-in-out;
}

.ms-btn-blue button:hover,
.ms-btn-blue input[type="submit"]:hover,
.ms-btn-blue a:hover,
.ms-btn-blue span:hover {
  color: #ffffff !important;
}

.ms-btn-blue button:hover::before,
.ms-btn-blue input[type="submit"]:hover::before,
.ms-btn-blue a:hover::before,
.ms-btn-blue span:hover::before {
  width: 100%;
}

/* Hover effect for span when parent link is hovered */
.ms-related-project-card-link:hover .ms-btn-blue span {
  color: #ffffff !important;
}

.ms-related-project-card-link:hover .ms-btn-blue span::before {
  width: 100%;
}

/* ========================================= */
/* Inverse Blue Button (from #596F7E to #2F3B4B) */
/* ========================================= */
.ms-btn-blue-inverse {
  position: relative;
  display: inline-block;
}

.ms-btn-blue-inverse button,
.ms-btn-blue-inverse input[type="submit"],
.ms-btn-blue-inverse a {
  font-family: "Inter", Sans-serif !important;
  position: relative;
  padding: 15px 30px;
  background-color: #596f7e;
  color: #ffffff;
  cursor: pointer;
  z-index: 1;
  text-align: center;
  text-decoration: none;
  font-family: sans-serif;
  font-size: 16px;
  border: none;
  transition: color 0.4s ease-in-out;
  box-shadow: none;
  display: inline-block;
}

.ms-btn-blue-inverse button::before,
.ms-btn-blue-inverse input[type="submit"]::before,
.ms-btn-blue-inverse a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: #2f3b4b;
  z-index: -1;
  transition: width 0.4s ease-in-out;
}

.ms-btn-blue-inverse button:hover,
.ms-btn-blue-inverse input[type="submit"]:hover,
.ms-btn-blue-inverse a:hover {
  color: #ffffff !important;
}

.ms-btn-blue-inverse button:hover::before,
.ms-btn-blue-inverse input[type="submit"]:hover::before,
.ms-btn-blue-inverse a:hover::before {
  width: 100%;
}

/* ========================================= */
/* White-Red Button (from #FFFFFF to #E60002) */
/* ========================================= */
.ms-btn-white-red {
  position: relative;
  display: inline-block;
}

.ms-btn-white-red button,
.ms-btn-white-red input[type="submit"],
.ms-btn-white-red a {
  position: relative;
  padding: 15px 30px;
  background-color: #ffffff;
  color: #e60002;
  cursor: pointer;
  z-index: 1;
  text-align: center;
  text-decoration: none;
  font-family: sans-serif;
  font-size: 16px;
  border: 2px solid #e60002;
  transition: color 0.4s ease-in-out;
  display: inline-block;
}

.ms-btn-white-red button::before,
.ms-btn-white-red input[type="submit"]::before,
.ms-btn-white-red a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: #e60002;
  z-index: -1;
  transition: width 0.4s ease-in-out;
}

.ms-btn-white-red button:hover,
.ms-btn-white-red input[type="submit"]:hover,
.ms-btn-white-red a:hover {
  color: #ffffff !important;
}

.ms-btn-white-red button:hover::before,
.ms-btn-white-red input[type="submit"]:hover::before,
.ms-btn-white-red a:hover::before {
  width: 100%;
}

/* ========================================= */
/* White-Blue Button (from #FFFFFF to #2F3B4B) */
/* ========================================= */
.ms-btn-white-blue {
  position: relative;
  display: inline-block;
}

.ms-btn-white-blue button,
.ms-btn-white-blue input[type="submit"],
.ms-btn-white-blue a {
  position: relative;
  padding: 15px 30px;
  background-color: #ffffff;
  color: #2f3b4b;
  cursor: pointer;
  z-index: 1;
  text-align: center;
  text-decoration: none;
  font-family: sans-serif;
  font-size: 16px;
  border: 2px solid #2f3b4b;
  transition: color 0.4s ease-in-out;
  display: inline-block;
}

.ms-btn-white-blue button::before,
.ms-btn-white-blue input[type="submit"]::before,
.ms-btn-white-blue a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: #2f3b4b;
  z-index: -1;
  transition: width 0.4s ease-in-out;
}

.ms-btn-white-blue button:hover,
.ms-btn-white-blue input[type="submit"]:hover,
.ms-btn-white-blue a:hover {
  color: #ffffff !important;
}

.ms-btn-white-blue button:hover::before,
.ms-btn-white-blue input[type="submit"]:hover::before,
.ms-btn-white-blue a:hover::before {
  width: 100%;
}

/* ========================================= */
/* Green Button (from #28a745 to #1e7e34) */
/* ========================================= */
.ms-btn-green {
  position: relative;
  display: inline-block;
}

.ms-btn-green button,
.ms-btn-green input[type="submit"],
.ms-btn-green a {
  position: relative;
  padding: 15px 30px;
  background-color: #28a745;
  color: #ffffff;
  cursor: pointer;
  z-index: 1;
  text-align: center;
  text-decoration: none;
  font-family: sans-serif;
  font-size: 16px;
  border: none;
  transition: color 0.4s ease-in-out;
  display: inline-block;
}

.ms-btn-green button::before,
.ms-btn-green input[type="submit"]::before,
.ms-btn-green a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: #1e7e34;
  z-index: -1;
  transition: width 0.4s ease-in-out;
}

.ms-btn-green button:hover,
.ms-btn-green input[type="submit"]:hover,
.ms-btn-green a:hover {
  color: #ffffff !important;
}

.ms-btn-green button:hover::before,
.ms-btn-green input[type="submit"]:hover::before,
.ms-btn-green a:hover::before {
  width: 100%;
}

/* ========================================= */
/* Gray Button (from #6c757d to #545b62) */
/* ========================================= */
.ms-btn-gray {
  position: relative;
  display: inline-block;
}

.ms-btn-gray button,
.ms-btn-gray input[type="submit"],
.ms-btn-gray a {
  position: relative;
  padding: 15px 30px;
  background-color: #6c757d;
  color: #ffffff;
  cursor: pointer;
  z-index: 1;
  text-align: center;
  text-decoration: none;
  font-family: sans-serif;
  font-size: 16px;
  border: none;
  transition: color 0.4s ease-in-out;
  display: inline-block;
}

.ms-btn-gray button::before,
.ms-btn-gray input[type="submit"]::before,
.ms-btn-gray a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: #545b62;
  z-index: -1;
  transition: width 0.4s ease-in-out;
}

.ms-btn-gray button:hover,
.ms-btn-gray input[type="submit"]:hover,
.ms-btn-gray a:hover {
  color: #ffffff !important;
}

.ms-btn-gray button:hover::before,
.ms-btn-gray input[type="submit"]:hover::before,
.ms-btn-gray a:hover::before {
  width: 100%;
}

/* ========================================= */
/* Button sizes */
/* ========================================= */
.ms-btn-small button,
.ms-btn-small input[type="submit"],
.ms-btn-small a,
.ms-btn-small span {
  padding: 0;
  font-size: 10px;
}

.ms-btn-large button,
.ms-btn-large input[type="submit"],
.ms-btn-large a {
  padding: 20px 40px;
  font-size: 18px;
}

/* ========================================= */
/* Botones de ancho completo */
/* ========================================= */
.ms-btn-full-width {
  width: 100%;
}

.ms-btn-full-width button,
.ms-btn-full-width input[type="submit"],
.ms-btn-full-width a {
  width: 100%;
  display: block;
}

/* ========================================= */
/* Botones de Favoritos */
/* ========================================= */
.toggle-favorite-btn {
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border-radius: 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid #e60002 !important;
  background-color: #ffffff !important;
  transition: all 0.3s ease !important;
}

.toggle-favorite-btn:not(.favorite-active):not(:disabled) {
  border-color: #e60002 !important;
}

.toggle-favorite-btn:hover {
  background-color: #e60002 !important;
  transform: scale(1.1) !important;
}

.toggle-favorite-btn.favorite-active {
  background-color: #e60002 !important;
}

.toggle-favorite-btn.favorite-active:hover {
  background-color: #af1720 !important;
}

.toggle-favorite-btn:disabled {
  background-color: #6c757d !important;
  border-color: #545b62 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

.toggle-favorite-btn:disabled:hover {
  background-color: #6c757d !important;
  transform: none !important;
}

.heart-icon {
  width: 18px;
  height: 18px;
  fill: #e60002;
  transition: fill 0.3s ease;
}

/* When NOT marked as favorite, the icon is red and turns white on hover */
.toggle-favorite-btn:not(.favorite-active):not(:disabled) .heart-icon {
  fill: #e60002;
}

.toggle-favorite-btn:not(.favorite-active):not(:disabled):hover .heart-icon {
  fill: #ffffff;
}

/* When marked as favorite, the icon is white */
.toggle-favorite-btn.favorite-active .heart-icon {
  fill: #ffffff;
}

/* When disabled, the icon is white with opacity */
.toggle-favorite-btn:disabled .heart-icon {
  fill: #ffffff;
  opacity: 0.6;
}
