:root {
  --color-primary: #203580; /* Memori logo blue */
  --color-primary-light: #2a439e; /* Slightly lighter blue for hover states */
  --color-accent: #006838; /* Green as accent */
  --color-accent-light: #007f45; /* Lighter green for hover states */
  --color-background: #f8f9fa; /* Very light gray background */
  --color-text: #2d3748; /* Softer than pure black */
  --color-text-light: #718096; /* For secondary text */
  --color-white: #ffffff;
  --navbar-shadow: rgba(32, 53, 128, 0.1); /* Tinted shadow to match brand */
}

/* html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-primary);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
} */

html,
body {
  height: 100%;
  width: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  /* iOS Safari fix */
  overscroll-behavior: none;
  /* Prevents bounce */
  touch-action: manipulation;
  /* Allows text selection but no zooming */
  font-family: sans-serif;
  display: flex;
  justify-content: center;
  background-color: var(--color-background);
  color: var(--color-text);
}

.text-primary {
  color: var(--color-primary) !important;
}

.turbo-progress-bar {
  display: none;
}

.app-container {
  flex: 1;
  background-color: var(--color-background);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(
    100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  margin-top: env(safe-area-inset-top);
  position: relative;
  overflow: hidden;
}

.main-content {
  flex: 1;
  position: relative;
  background-color: var(--color-background);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(32, 53, 128, 0.02); /* Very subtle blue tint */
  pointer-events: none;
}

.navbar {
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 4px var(--navbar-shadow);
  height: 60px;
  position: relative;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.navbar-container {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 max(10px, env(safe-area-inset-left));
}

.main-container {
  flex: 1;
  height: calc(100% - 70px);
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  padding: 0rem max(15px, env(safe-area-inset-left));
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;
  /* padding-bottom: env(safe-area-inset-bottom); */
}

.navbar-nav .nav-link {
  color: var(--color-primary);
  font-weight: 500;
  transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
  color: var(--color-primary-light);
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    position: absolute;
    top: 100%;
    right: max(15px, env(safe-area-inset-right));
    width: 150px;
    background-color: var(--color-white);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--navbar-shadow);
    box-shadow: 0 4px 6px var(--navbar-shadow);
    z-index: 1000;
    margin-top: 0.5rem;
  }

  .navbar-nav {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
  }

  .nav-item {
    width: 100%;
    text-align: right;
  }

  .nav-link {
    padding: 0.5rem 0;
    font-size: 1.1rem;
  }

  .navbar-toggler {
    position: absolute;
    right: max(15px, env(safe-area-inset-right));
    top: 50%;
    transform: translateY(-50%);
    border-color: var(--color-primary);
  }
}

.navbar > .navbar-container {
  position: relative;
}

.navbar-toggler {
  position: absolute;
  right: max(15px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  border-color: var(--color-primary);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(32, 53, 128, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-brand {
  height: auto;
  width: auto;
  max-height: 60px;
  padding: 10px 0;
}

.navbar-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  position: relative;
}

.navbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.create-memori-link {
  display: block;
  transition: transform 0.2s ease;

  &:hover {
    transform: scale(1.2);
  }

  img {
    display: block;
  }
}

body.use-background-image .navbar {
  filter: brightness(90%);
}

/* Auth pages styles */
.auth-card {
  background: var(--color-white);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px var(--navbar-shadow);
}

.auth-card h1 {
  color: var(--color-primary);
  font-family: "Madimi One", sans-serif;
}

.form-control {
  border: 1px solid var(--navbar-shadow);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem var(--navbar-shadow);
}

/* Alert styles */
.alert {
  border: none;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
}

/* Memori card styles */
.memori-card {
  background: var(--color-white);
  border-radius: 1rem;
  padding: 1.5rem;
  height: 100%;
  box-shadow: 0 4px 6px var(--navbar-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.memori-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 8px var(--navbar-shadow);
}

.memori-card h3 {
  color: var(--color-primary);
  font-family: "Madimi One", sans-serif;
}

.memori-card-meta {
  border-top: 1px solid rgba(32, 53, 128, 0.1);
  padding-top: 1rem;
  margin-top: 1rem;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  text-transform: capitalize;
}

/* Button styles */
.btn-create-memori {
  background-color: var(--color-white);
  border: 2px solid var(--color-accent);
  border-radius: 2rem;
  padding: 0.75rem 2rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-create-memori:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px var(--navbar-shadow);
  color: var(--color-primary);
}

.btn-create-memori .memori-icon {
  width: 2.5rem;
  height: 2.5rem;
}

.btn-accent {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  border-radius: 1.5rem;
}

.btn-accent:hover {
  background-color: var(--color-accent-light);
  border-color: var(--color-accent-light);
  color: white;
}

.btn-outline-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline-primary:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.btn-outline-danger {
  color: #dc3545;
  border-color: #dc3545;
}

.btn-outline-danger:hover {
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
}

/* Sliding panel styles */
.sliding-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 600px;
  background: var(--color-white);
  box-shadow: -4px 0 10px var(--navbar-shadow);
  z-index: 1050;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

.sliding-panel.active {
  transform: translateX(0);
}

@media (max-width: 768px) {
  .sliding-panel {
    max-width: 100%;
  }
}

/* Videochat layout */
#livekit-root {
  width: 100%;
}

.videochat-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(48svw, 360px), 1fr));
  align-items: start;
}

.videochat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  min-height: 0;
  max-width: 300px;
  width:45svh
  padding: 0.75rem;
  background: var(--color-white);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

.videochat-frame {
  position: relative;
  width: 100%;
  height: clamp(220px, calc(48svw * 0.75), 300px);
  max-height: 300px;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #0f172a;
}

.videochat-player {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: transparent;
}

.videochat-name {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.65);
  z-index: 1;
}

.videochat-transcript {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  overflow-y: auto;
  max-height: calc(100svh - 320px);
}

.videochat-transcript .transcript-final-list {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}

.videochat-transcript .transcript-interim {
  display: none;
  color: #6b7280;
  font-style: italic;
}

@media (min-width: 1024px) {
  .videochat-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }

  .videochat-frame {
    height: min(300px, 28vw);
  }
}
