/* ./public/css/styles.css */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  color: #343a40;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* Background fix for mobile */
.background {
  background-image: url("/bg.webp");
  background-size: cover;
  background-position: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

/* Mobile Background Gradient with Noise */
@media (max-width: 767px) {
  body {
    background: linear-gradient(
      to right,
      #16282d,
      #112d44,
      #16282d
    ); /* Modified to horizontal gradient */
  }
  body::before,
  body::after {
    display: none;
  }

  .background {
    display: none;
  }
  body::after {
    content: "";
    position: fixed; /* Changed to fixed */
    top: 0;
    left: 0;
    width: 100vw; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><filter id='noise'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch' /></filter><rect width='100%' height='100%' filter='url(%23noise)' opacity='0.4' /></svg>");
    opacity: 0.5;
    z-index: -2; /* Below the gradient but above other elements */
    pointer-events: none; /* Prevent interaction with the pseudo-element */
  }
  /* Fix for Android navigation bar */
  body > div:first-child {
    margin-bottom: -5vh;
    padding-bottom: 5vh;
  }
}

.content-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
}

.universal-container {
  width: 80vw;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

.project-cards-container {
  width: 90vw;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
  margin-bottom: 0;
  padding-bottom: 0;
}

@media (min-width: 768px) {
  .project-cards-container {
    width: 80vw;
  }
}

.card-img-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 56.25%;
  overflow: hidden;
}

.card-img-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.cover-image-admin {
  width: 80px;
  height: 45px;
  object-fit: cover;
}

@media (max-width: 576px) {
  .cover-image-admin {
    width: 60px;
    height: 34px;
  }
}

.project-card {
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.project-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

a {
  text-decoration: none;
  color: #2889ed;
}

.stretched-link::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.project-container,
.admin-container {
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  overflow-y: auto; /* For scrolling within the container */
}

/* Image within markdown content */
.project-container .markdown-content img {
  max-width: 100%;
  height: auto;
  display: block; /* Prevents the image from affecting layout of surrounding elements */
}

/* Wrapper for the button to keep it at the bottom */
.project-container .back-button-wrapper {
  width: 100%;
  text-align: left;
}

.table .btn {
  margin-bottom: 0;
}

h2,
h3 {
  color: #343a40;
}

.btn-primary,
.btn-success,
.btn-danger {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.btn-primary:hover,
.btn-success:hover,
.btn-danger:hover {
  opacity: 0.9;
}

@media (min-width: 992px) {
  .universal-container,
  .project-cards-container {
    padding-left: 30px;
    padding-right: 30px;
  }
}

@media (max-width: 991.98px) {
  .universal-container,
  .project-cards-container {
    padding-left: 15px;
    padding-right: 15px;
  }
}

.navbar-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-top: 20px;
  margin-bottom: 30px;
}

.custom-navbar {
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 10px 20px;
  z-index: 1000;
  width: 56vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.custom-navbar-brand {
  font-weight: bold;
  color: #343a40;
  white-space: nowrap;
}

.custom-navbar-nav {
  display: flex;
  align-items: center;
  list-style-type: none;
  padding: 0;
  margin: 0;
  flex-wrap: nowrap; /* Prevent items from wrapping */
  margin-right: -10px; /* Add margin to the left */
}

.custom-navbar-nav .nav-item {
  display: flex;
  align-items: center;
}

.custom-navbar-nav .nav-link {
  color: #343a40;
  margin: 0 10px;
  padding-top: 5px; /* Top padding */
  padding-right: 10px; /* Right padding */
  padding-bottom: 7px; /* Bottom padding */
  padding-left: 10px; /* Left padding */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  border-radius: 5px;
  text-decoration: none !important;
  line-height: 1;
  border: 1px solid #ccc;
  font-weight: bold;
  white-space: nowrap;
}

.custom-navbar-nav .nav-link:hover {
  background-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Style for language toggle button */
.custom-navbar-nav .nav-item form button.nav-link {
  border: none; /* Remove border */
  background-color: transparent; /* Remove background */
  cursor: pointer; /* Indicate it's clickable */
}

/* Style for language toggle button on hover*/
.custom-navbar-nav .nav-item form button.nav-link:hover {
  background-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 576px) {
  .custom-navbar {
    width: 90vw; /* Increase navbar width to take up more of mobile screen */
  }
}

.page-with-background {
  color: #f8f9fa;
}

.project-container .markdown-content {
  color: #343a40;
}

footer {
  background: transparent;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  position: relative;
}

.text-light {
  color: white !important;
}

.cat-animation-container {
  background-color: #132328;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 0;
  width: 56vw;
  position: relative;
  min-height: 230px;
}

@media (max-width: 768px) {
  .cat-animation-container {
    width: 90vw;
  }
}

.cat-animation-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

.cat-animation-container .cat-animation {
  position: relative;
  z-index: 2;
  top: 30px;
}

.cat-disabled .cat-animation-container {
  display: none;
}

.cat-text {
  color: white;
  text-align: center;
  z-index: 3;
  position: absolute;
  font-size: 1rem;
  width: 90%;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
}

@media (min-width: 1200px) {
  .cat-text {
    font-size: 1.3rem;
  }
}

@media (max-width: 850px) {
  .cat-text {
    font-size: 1.2rem;
  }
}

@media (max-width: 570px) {
  .cat-text {
    font-size: 1rem; /* Increased font-size for mobile */
  }
}

.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #163248, #3a576f, #627a8f);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: auto;
}

.loader-wrapper.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.loader {
  width: 60px;
  height: 60px;
  position: relative;
  animation: spin 1s linear infinite;
}

.loader::before,
.loader::after {
  content: "";
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  background: transparent;
  border: 8px solid transparent;
}

.loader::before {
  border-top-color: #163248;
  mask: radial-gradient(
    circle at 60px 60px,
    transparent 0,
    transparent 60%,
    black 60%,
    black 100%
  );
  -webkit-mask: radial-gradient(
    circle at 60px 60px,
    transparent 0,
    transparent 60%,
    black 60%,
    black 100%
  );
}

.loader::after {
  border-bottom-color: #627a8f;
  mask: radial-gradient(
    circle at 0 0,
    black 0,
    black 40%,
    transparent 40%,
    transparent 100%
  );
  -webkit-mask: radial-gradient(
    circle at 0 0,
    black 0,
    black 40%,
    transparent 40%,
    transparent 100%
  );
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Project Page Specific Adjustments for Mobile */
@media (max-width: 767.98px) {
  .project-page .universal-container {
    padding-left: 2vw;
    padding-right: 2vw;
    width: 96vw;
  }
}

/* Custom Scrollbar for WebKit Browsers*/
::-webkit-scrollbar {
  width: 10px;
  height: 3px;
  z-index: 100;
  position: relative;
}

::-webkit-scrollbar-track {
  background: #343a40;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(109, 133, 153, 0.5);
  border-radius: 5px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:vertical {
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:horizontal {
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(85, 85, 85, 0.5);
}

/* Style for the "Back to Projects" button */
.back-button {
  background-color: transparent;
  color: #343a40;
  padding: 5px 10px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  border: 1px solid #ccc;
  font-weight: bold;
  text-decoration: none;
  line-height: 1;
}

.back-button:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #343a40;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Project Page - Spacing for Bottom "Back to Projects" Button */
.project-page .mt-4 {
  margin-bottom: 3rem !important;
}

/* Firefox Scrollbar Styling */
* {
  scrollbar-width: thin;
  scrollbar-color: #6d8599 transparent;
}

/* Styles for contenteditable div */
.markdown-editor {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto;
  min-height: 150px;
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  background-color: white;
  line-height: 1.5;
}

.markdown-editor:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}