/* Custom CSS for Kiko AI Website */

/* Font and Typography */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  font-family: "blockhead-unplugged", sans-serif;
}

/* Ensure font applies to all text elements */
p, span, div, button, a {
  font-family: "blockhead-unplugged", sans-serif !important;
  font-size: 1.05em;
}

.crayon-border h4 {
  font-size: 1.05em !important;
}

.crayon-border p {
  font-size: 1.05em !important;
}

button {
  font-size: 1.05em !important;
}

#dialogueText {
  font-size: 1.05em !important;
}

footer p {
  font-size: 1.05em !important;
}

/* Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-image, url("/imgs/background-home_kiko.avif")) no-repeat center center;
    background-size: cover;
    background-color: snow;
    z-index: -1;
}

/* Hamburger Menu Styles */
.hamburger-menu {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1050;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hamburger-menu.hidden {
  opacity: 0;
  visibility: hidden;
}

.hamburger-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.hamburger-btn:hover {
  transform: scale(1.05);
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: left 0.3s ease;
  z-index: 1040;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar.open {
  left: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #333;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #dc3545;
}

.sidebar-menu {
  padding: 20px 0;
}

.sidebar-menu a {
  display: block;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  text-align: center;
}

.sidebar-menu a:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #007bff;
  padding-left: 25px;
}

.sidebar-menu a.instagram-link {
  text-align: center;
  font-size: 1.5rem;
}

.sidebar-menu a.instagram-link:hover {
  padding-left: 20px;
}

.sidebar-menu hr {
  margin: 15px 20px;
  border-color: rgba(0, 0, 0, 0.1);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1030;
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Content Layout */
.content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Crayon Border Styles */
.crayon-border {
  position: relative;
  border: none;
  background-color: #f6eee3;
  border-radius: 150px;
  line-height: 1.5em;
  font-family: sans-serif;
  font-weight: bold;
  padding: 20px;
  height: 70vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.crayon-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 8px solid orange;
  border-radius: 150px;
  filter: url(#crayon-rough);
  box-shadow: 2px 2px 0 orange, -2px -1px 0 #ff9933, 1px -2px 0 #ff6600;
  z-index: -1;
}

/* Simple Border Styles */
.simple-border {
  position: relative;
  border: 1px solid black;
  background-color: #f6eee3;
  border-radius: 34px;
  line-height: 1.5em;
  font-family: sans-serif;
  font-weight: bold;
  padding: 20px;
}

.crayon-border.hidden {
  background-color: transparent;
}

.crayon-border.hidden::before {
  display: none;
}

/* Position mainContent from bottom when not hidden */
#mainContent:not(.hidden) {
  position: fixed;
  bottom: 10vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  transition: visibility 0.3s ease, opacity 0.3s ease;
}

/* Hide mainContent visually but keep it taking space when invisible */
#mainContent.invisible-but-present {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  bottom: 10vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

/* Footer */
footer {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  text-align: center;
  padding: 10px 0;
  width: 100%;
  margin-top: 20px;
  flex-shrink: 0;
}

/* Image/Video Container */
.image-video-container {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.image-video-container img,
.image-video-container video {
  max-height: 40vh;
  width: auto;
  height: auto;
  object-fit: contain;
  vertical-align: top;
}

.kiko-logo {
  max-height: 40vh;
}

/* Make only the video bigger and move it up */
#mainVideo {
  max-height: 50vh;
  margin-top: -5vh;
}

/* Visual Novel Content Styles */
#visualNovelContent {
  min-height: 200px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#visualNovelContent .text-center {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#dialogueText {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.6;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  width: 100%;
}

/* Text Content Width Constraints */
#mainContent h4,
#mainContent p,
#mainContent button {
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

#dialogueText {
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Prevent Image Selection */
#mainImage {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: none;
}

/* Kiko Hovering Animation */
@keyframes kikoHover {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.kiko-hovering {
  animation: kikoHover 2s ease-in-out infinite;
}

/* Cloud Animation Styles */
.cloud {
  position: fixed;
  z-index: -2;
  opacity: 0.7;
  pointer-events: none;
  max-width: 200px;
  max-height: 100px;
  object-fit: contain;
}

@keyframes cloudMove {
  0% {
    left: -200px;
  }
  100% {
    left: calc(100vw + 200px);
  }
}

.cloud-animating {
  animation: cloudMove 20s linear infinite;
}

/* Visual Novel Active State */
body.visual-novel-active {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Right Side Button Styles */
.right-side-button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.right-side-button.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Responsive Design */
@media (min-width: 769px) {
  .crayon-border {
    bottom: -10%;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    left: -100%;
  }
  
  .hamburger-menu {
    top: 15px;
    left: 15px;
  }
  
  .hamburger-btn {
    padding: 8px 10px;
  }
}


/* Unify question inputs and mic button with idea section styles */
.full-width-input {
  width: 100%;
}

.question-input {
  display: block;
  width: 100%;
  min-height: 180px;
  padding: 0.75rem 0.9rem;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.question-input:focus {
  outline: 0;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Override circular icon style for mic button in questions */
.mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: auto;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  background: var(--bs-secondary, #6c757d);
  border: 1px solid var(--bs-secondary, #6c757d);
  color: #fff;
}

.mic-btn:hover,
.mic-btn:focus {
  color: #fff;
  filter: brightness(0.95);
}

.mic-btn i { font-size: 1rem; }

/* Question control row layout */
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.counter {
  color: #6c757d;
  font-size: 0.875rem;
}

.question-navigation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Unified textarea styling */
textarea.form-control {
  display: block;
  width: 100%;
  min-height: 180px;
  padding: 0.75rem 0.9rem;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
  resize: vertical;
  font-family: Arial, sans-serif !important;
}

textarea.form-control::placeholder {
  color: #6c757d;
}

textarea.form-control:focus {
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
  outline: 0;
}

.kiko-counter-row small {
  color: #6c757d;
}

/* Mic button styling */
.mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  background: var(--bs-secondary, #6c757d);
  border: 1px solid var(--bs-secondary, #6c757d);
  color: #fff;
}

.mic-btn:hover,
.mic-btn:focus {
  color: #fff;
  filter: brightness(0.95);
}

.mic-btn i {
  font-size: 1rem;
}

/* Make idea section textarea taller */
#txtIdea {
  min-height: 150px;
}

/* Allow text sections to overlap with Kiko */
.simple-border {
  position: relative;
  z-index: 2;
  margin-top: -2vh;
}

/* Specific sections that should overlap more */
#ideaSection,
#questionsSection,
#resultSection {
  margin-top: -3vh;
  background-color: rgba(246, 238, 227, 0.95);
  backdrop-filter: blur(5px);
}

/* Custom Button Primary Color Override */
.btn-primary {
  background-color: #bed7d4 !important;
  border-color: #bed7d4 !important;
  color: #000 !important;
}

.btn-primary:hover {
  background-color: #9bbfbb !important;
  border-color: #8fb5b1 !important;
  color: #000 !important;
}

.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
  background-color: #7fa8a4 !important;
  border-color: #739e9a !important;
  color: #000 !important;
  box-shadow: 0 0 0 0.25rem rgba(190, 215, 212, 0.5) !important;
}

.btn-primary:disabled,
.btn-primary.disabled {
  background-color: #bed7d4 !important;
  border-color: #bed7d4 !important;
  color: #000 !important;
}

