/* --- Reset & Basic Styles --- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #121212;
    color: #eee;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 40px 20px;
}

/* --- Container --- */

.container {
    width: 100%;
    max-width: 500px;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Navbar --- */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 20px;
    background-color: #292929;
    border-radius: 12px 12px 0 0;
    position: relative; /* Add this */
}
.nav-header{
    width: 100%;
}
/* --- Logo --- */
.logo-image {
    max-width: 150px;
    display: block;
    margin-right: auto; /* Move logo to the left */
}

/* --- Hamburger Menu --- */
/*Position on the right*/
.nav-btn {
    position: absolute; /* Absolute positioning */
    top: 10px; /* Adjust as needed */
    right: 20px; /* Adjust as needed */
}

.nav-btn label {
  display: inline-block;
  width: 25px;
  height: 18px;
  padding: 13px;
  transition: all 0.3s ease-out;
  cursor: pointer;
}
/* bars in the menu */
.nav-btn label span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #eee;
  margin: 5px 0;
  transition: 0.4s;
  border-radius: 2px;
}


/* --- Navigation Links --- */

.nav-links {
    list-style: none;
    display: flex; /* Default (desktop) layout */
    margin: 0;
    padding: 0;
    position: fixed; /* Fixed positioning */
    top: 0;
    right: -100%; /* Initially off-screen to the RIGHT */
    width: auto; /*  Width to auto */
    max-width: 80vw; /* Limit the max width */
    height: 100vh;
    background-color: #292929;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 60px;
    transition: right 0.6s ease; /* SLOWER transition, target RIGHT */
    z-index: 1000;
    overflow-x: hidden; /* prevent horizontal scroll */
    white-space: nowrap; /* Keep menu items on one line */
}

/* .nav-links.show {
    left: 0;
} */
#nav-check:checked ~ .nav-links {
    right: 0; /* Slide in from the RIGHT */
}

.nav-links li {
    margin: 15px 0;
    padding-left: 20px
}

.nav-links a {
    color: #eee;
    text-decoration: none;
    font-size: 1.2em;
    display: block;
    padding: 10px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-links a:hover {
    background-color: #3498db;
    color: white;
    border-radius: 5px;
}
/* --- Conversation Area --- */

#conversation {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Bot Message --- */

.bot-message {
    background-color: #333333;
    border-radius: 18px 18px 18px 4px;
    padding: 16px;
    margin: 8px 0;
    max-width: 75%;
    align-self: flex-start;
    color: #f0f0f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    line-height: 1.5;
}

/* --- User Input (Upload Button) --- */

.user-input {
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
    display: block; /* Add this to ensure it takes full width */
    align-self: center;
    margin-top: 16px;
    margin-bottom: 16px;
}

.btn {
    background-color: #3B82F6;
    color: white;
    font-weight: 500;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block;
    font-family: 'Inter', sans-serif;
    width: 180px;
    height: 40px;
    line-height: 20px;
    margin: 5px;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* Active state for upload button */
.btn:active {
  transform: scale(0.98);
}

/* Add focus styles for keyboard navigation */
.btn:focus {
    outline: 3px solid #4c9aff;
    outline-offset: 2px;
}

.retry-button:focus {
    outline: 3px solid #4c9aff;
    outline-offset: 2px;
}

/* Specific styles for the "Choose File" label */
label.btn {
      display: inline-flex;
      justify-content: center;
      align-items: center;
}
/* --- Critique Container --- */

#critique-container {
    white-space: pre-wrap;
    margin-bottom: 1rem;
     width: 100%;
}

/* --- Error Message --- */
.error-message {
  background-color: rgba(220, 38, 38, 0.2);
  border-left: 3px solid #DC2626;
  color: #FECACA;
  padding: 12px 16px;
  margin: 12px 0;
  border-radius: 6px;
  font-size: 14px;
  align-self: center;
  max-width: 90%;
}

/* --- Typing indicator --- */

.typing-indicator {
  display: flex;
  align-items: center;
  background-color: #333333;
  border-radius: 18px 18px 18px 4px;
  padding: 16px;
  margin: 8px 0;
  max-width: 75%;
  align-self: flex-start;
  color: #f0f0f0;
  animation: fadeIn 0.3s ease-out;  /* Add entrance animation */
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  margin: 0 2px;
  background-color: #999;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.4;
  animation: typing 1s infinite alternate;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0ms;
}
.typing-indicator span:nth-child(2) {
  animation-delay: 200ms;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 400ms;
}

@keyframes typing {
  0% {
    transform: translateY(0px);
    opacity: 0.4;
  }
  100% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* --- Image Styles --- */
.user-image-container {
    align-self: flex-end;
    margin: 8px 0;
    max-width: 75%;
    border-radius: 18px 18px 4px 18px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-out;
}

.user-image {
    max-width: 100%; /* Change from 30% to show full-size images */
    height: auto;
    border-radius: 8px;
    display: block;
}

/* --- Interaction Wrapper Styles  --- */

.interaction-wrapper {
    margin-bottom: 10px; /* Space between interactions */
    width: 100%;
    display: flex;
    flex-direction: column;
}

.interaction-wrapper .user-image-container {
    align-self: flex-end;
}

.interaction-wrapper .critique-container {
    align-self: flex-start;
}

/* --- Responsive Adjustments --- */

/* Show hamburger and hide links on small screens */
@media (max-width: 768px) {
    .nav-btn {
        display: inline-block;
    }
    .nav-links {
        display: none;
    }

/* Show the navigation links when the checkbox is checked */
    #nav-check:checked ~ .nav-links {
        display: flex;

    }
   .container {
        padding: 0;
    }
    .btn, #uploadButton{
        width: 100%;
    }
      .logo-image{
        margin-right: 0; /*Remove the margin*/
    }
    .bot-message, .critique-container {
        max-width: 90%;
        padding: 14px;
    }
  
    .user-image-container {
        max-width: 90%;
    }
  
    #conversation {
        padding: 16px;
    }
  
    .btn {
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
}

/* Hide checkbox */
#nav-check{
    display: none;
}

/* Add these styles to your existing CSS */
.hidden {
    display: none;
}

/* Critique Container */
.critique-container {
    background-color: #333333;
    border-radius: 18px 18px 18px 4px;
    padding: 16px;
    margin: 8px 0;
    max-width: 75%;
    align-self: flex-start;
    color: #f0f0f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    line-height: 1.5;
}

/* Add subtle animations */
.bot-message, .critique-container, .user-image-container {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}