/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Arial', sans-serif;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #1A2130;
}

/* HEADER + NAV (DESKTOP) */
header {
  background: #1A2130;
  color: white;
  /* remove fixed height; let content define it: */
  /* height: 100px; */
  width: 100%;
  /* we can allow the header to be flexible or block:
     display: block or flex is up to you. We'll do block if we want
     the nav items to appear below the hamburger. 
  */
  display: block;
  padding: 10px;
}

header .logo img {
  height: auto;
  width: auto;
  min-width: 50px;
  max-height: 80px;
  float: left;
}

nav {
  background: #444;
  width: 100%;
  /* remove position: relative; so it just flows normally. */
  display: flex; 
  align-items: center;
  padding: 10px; 
}
/* The UL itself can also be a flex container if you want items horizontally aligned */
#navLinks {
  display: flex;
  list-style-type: none;
  margin: 0;
  padding: 0;
  flex: 1; /* This ensures the ul can stretch across the nav */
  justify-content: flex-end; /* Items on the right by default */
}

/* The logo item will "push" the other items to the right. */
#navLinks .logo-item {
  margin-right: auto; 
}


.menu-toggle {
  display: none; /* Hidden on large screens; shown on mobile in media query */
  font-size: 24px;
  cursor: pointer;
  margin-right: 15px;
  background: #444;
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
}

/* The UL in desktop mode => horizontal menu */
nav ul {
  list-style: none;
  display: flex;  /* horizontal row on desktop */
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  width: 100%;
}

nav ul li {
  padding: 0 10px;
}

nav ul li button {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 10px 20px;
  transition: background-color 0.3s ease;
  line-height: 20px;
  text-align: center;
}

nav ul li button:hover {
  background: #535353;  
}

/* MAIN LAYOUT */
main {
  display: flex;
  width: 100%;
  flex: 1; /* let main fill leftover vertical space */
}    /* let main grow/shrink */


/* TAB CONTENT + COLUMN LAYOUT */
.tabcontent {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  align-items: stretch;
}

.columnbig {
padding: 10px;
display: flex;
flex-direction: column;
justify-content: center;
/* remove float: left; */
/* optionally set a width or let flex shrink it */
width: 50%; /* or a fixed width like 80% */
height: auto;
height:auto;
background: #f4f4f4;
border-right: 1px solid #ccc;
float: left;
}

.columnsmall {
padding: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex: 1;            /* take the remaining width instead of a fixed 80% */
background: #ddd;
/* remove height: 100%; to allow auto‐height */
}

.generated-image {
display: flex;
justify-content: center;
align-items: center;
width: 100%; 
margin: 0 auto;
padding: 10px;
border: none;
}

.generated-image img {
max-width: 100%;
display: block;
margin: 0 auto;
}


.columnsmall img {
  width: 100%;
  height: auto;
  display: block;
}

.columnbig label,
.columnbig input,
.columnbig button {
  width: 100%;
  margin-top: 10px;
  box-sizing: border-box;
  padding: 8px;
}

.columnsmall .results-container {
  width: 100%;
  text-align: center;
}

.columnsmall label {
  font-weight: bold;
  margin-top: 10px;
  width: 100%;
  text-align: left;
}

.columnsmall input {
  margin-bottom: 10px;
  width: 100%;
}

.full-width-section {
  background: #FDFFE2;
  padding: 20px;
  text-align: center;
}

footer {
  background: #222;
  color: #5A72A0;
  text-align: center;
  padding: 10px 0;
  margin-top: auto;
}

.tab-content:first-of-type {
  display: flex;
}

.image_container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
  perspective: 500px;
  margin: 10rem 0;
}

.image_container .card {
  position: absolute;
  width: 30%;
  height: 10rem;
  background: #333;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.5s;
  transform-style: preserve-3d;
  transform-origin: bottom;
  user-select: none;
}

.image_container .card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  transition: 0.5s;
}

.image_container .card:nth-child(1) {
  transform: translate3d(-250px, 0, 0) scale(0.8) rotateY(25deg);
  z-index: 1;
}

.image_container .card:nth-child(2) {
  transform: translate3d(-150px, 0, 0) scale(0.9) rotateY(15deg);
  z-index: 2;
}

.image_container .card:nth-child(3) {
  transform: translate3d(0, 0, 0) scale(1) rotateY(0deg);
  z-index: 3;
}

.image_container .card:nth-child(4) {
  transform: translate3d(150px, 0, 0) scale(0.9) rotateY(-15deg);
  z-index: 4;
}

.image_container .card:nth-child(5) {
  transform: translate3d(250px, 0, 0) scale(0.8) rotateY(-25deg);
  z-index: 5;
}

.full-width-section .buttons button {
  border: solid 1px #aed6e4;
  border-radius: 5px;
  padding: 0.75rem 1.5rem;
  background: #83B4FF;
  color: #fff;
  cursor: pointer;
  width: 150px;
  margin: 1rem;
}

.full-width-section .buttons button:hover {
  background: #ff4500;
  transition: 0.5s;
}

.results {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.results-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  text-align: center;
  border-bottom: 4px solid #ccc;
}

.result {
  width: 30%;
  margin: 1rem;
  padding: 1rem;
  background: #f4f4f4;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}


button {
  background-color: #333;
  color: white;
  cursor: pointer;
}

.loading-spinner {
  display: none;
  position: absolute;
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 10px 0;
  margin-top: auto;
}

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


input[type="text"], input[type="file"], input[type="range"], button {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
}

button {
  background-color: #333;
  color: white;
  cursor: pointer;
}

.loading-spinner {
  display: none;
  position: absolute;
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 2s linear infinite;
}
.original-image{
  border: 1px solid #ccc;
  padding: 10px;
  width: 720px;
  text-align: center;
  border: none;

}


footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 10px 0;
  margin-top: auto;
}

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

/* For the /recent_images 2x2 layout *//* For the /recent_images 2x2 layout *//* For the /recent_images 2x2 layout: 4 sections */
.recent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* two columns */
  grid-template-rows: auto auto;  /* two rows => 4 cells total */
  gap: 20px;
  padding: 20px;
}

/* Each cell in the grid */
.recent-section {
  background: #1A2130; /* or your background color */
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  color: white;          /* so text is visible */
  display: flex;
  flex-direction: column;
  align-items: center;   /* center items horizontally */
  justify-content: center; /* center them vertically if desired */
}

.recent-section h2 {
  margin-bottom: 10px;
  text-align: center;
}

/* Basic carousel styling for each section */
.carousel-wrapper {
  display: flex;
  flex-direction: column;   /* stack carousel + nav vertically */
  align-items: center;      /* center them horizontally */
}

.carousel {
  display: flex;
  width: 300px;       /* or any width you prefer */
  margin: 0 auto;     /* center horizontally */
  overflow: hidden;
  justify-content: center;
}

.carousel-item {
  min-width: 300px;
  display: none; /* hidden by default; we show one at a time in JS */
}

.carousel-item img {
  width: 100%;
  height: auto;
  border-radius: 5px;
}

/* The nav with prev/next buttons goes below the carousel */
.carousel-nav {
  margin-top: 10px;
}

.carousel-btn {
  background: #444;
  color: #fff;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 14px;
  margin: 0 5px;
}

.carousel-btn:hover {
  background: #666;
}


/* ... same code from your snippet above ... */

/* --------------------------------------------
 MEDIA QUERY FOR SMALL SCREENS
-------------------------------------------- */@media (max-width: 768px) {
/* We show the hamburger icon; hide the horizontal menu */
.menu-toggle {
  display: inline-block;  /* show hamburger */
}
/* The UL is hidden by default on small screens,
   only shown when .active is toggled. 
   crucially, we remove absolute positioning so the UL is in normal flow. */
nav ul {
  display: none;
  flex-direction: column; /* vertical list on mobile */
  width: 100%;
  background: #444;
  margin-top: 10px; /* small gap after the hamburger */
  padding: 10px;    /* add some padding if you want */
}
nav ul.active {
  display: flex;   /* when toggled active, show them */
}

/* each li is a separate row now */
nav ul li {
  padding: 10px 5px;
  text-align: center;
}
#navLinks .logo-item {
  margin: 0 auto;   /* Force logo to be centered horizontally */
  text-align: center;
}

/* The tab content and columns stack vertically on phones */
.tabcontent {
  flex-direction: column; 
  align-items: flex-start;
}
.columnbig, .columnsmall {
  width: 100% !important; 
  float: none;
  border-right: none;
}

.original-image, .generated-image {
  width: 100% !important;
}
.image_container .card:nth-child(1),
  .image_container .card:nth-child(2),
  .image_container .card:nth-child(3),
  .image_container .card:nth-child(4),
  .image_container .card:nth-child(5) {
    transform: none !important;
  }
}