#balance-warning {
    position: fixed;    
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 23, 64, 0.9);
    color: #fff;
    padding: 25px 35px;
    border-radius: 12px;
    box-shadow: 0 0 30px #4a90e2;
    font-weight: bold;
    font-size: 18px;
    max-width: 90vw;             
    text-align: center;
    z-index: 20;               
    display: none;                
    box-sizing: border-box;
}

@media (max-width: 480px) {
    #balance-warning {
        width: 90vw;              
        max-width: none;           
        padding: 20px 25px;        
        font-size: 16px;         
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        border-radius: 10px;
    }
}

#center-container {
  position: fixed;
  top: 0;
  bottom: 0;
  left: calc(190px + 20px);  
  right: calc(260px + 20px);  
  height: 100vh;
  box-sizing: border-box;
  padding: 20px;
  display: flex;
  gap: 20px;
  overflow-y: auto;
  background: transparent;
  border-radius: 10px;
}

#left-panel,
#right-panel {
  width: 50%;
  display: flex;
  flex-direction: column;
}

#left-panel {
  gap: 10px;
}


#main-photo-upload {
  position: relative; 
  cursor: pointer;
  overflow: hidden;
}

#main-photo-upload label {
  position: relative; 
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 18px;
  user-select: none;
  pointer-events: none; 
  cursor: pointer;
}

#main-photo-upload img.preview-image {
  z-index: 1;
}

#main-photo-upload.preview-loaded label {
  color: transparent; 
}

#main-photo-upload {
  flex: 14 1 auto;
  background: rgba(10, 23, 64, 0.8);
  border-radius: 15px;
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.6);
  border: 1px solid rgba(74,144,226,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

#additional-photos {
  flex: 0.1 1 auto;
  display: flex;
  gap: 15px;
  justify-content: space-between;
}

#prompt-container {
  display: flex;
  gap: 10px;
  margin-top: auto;
  background: rgba(10, 23, 64, 0.9);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.6);
  border: 1px solid #4a90e2;
  align-items: center;
}

#prompt-container:focus-within {
  border-color: white;
  box-shadow: 0 0 15px white;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.textarea-wrapper {
  flex: 1;
  display: flex;
}

#prompt-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  padding: 0px 10px 0px 10px;
  outline: none;
  font-family: Arial, sans-serif;
  border-radius: 6px;
  resize: none;
  min-height: 60px;
  max-height: 120px;
  overflow-y: hidden;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-sizing: border-box;
  line-height: 1.3;
}

#prompt-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.btn-send {
  background-color: rgba(74, 144, 226, 0.85);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-weight: 700;
  font-size: 20px;
  color: white;
  cursor: pointer;
  box-shadow: 0 0 10px #4a90e2;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.btn-send:hover,
.btn-send:focus {
  background-color: #357abd;
  box-shadow: 0 0 15px #357abd;
  outline: none;
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

.photo-slot {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1 / 1;
  background: rgba(10, 23, 64, 0.6);
  border: 1.5px dashed rgba(74, 144, 226, 0.8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: background-color 0.3s ease;
}
.photo-slot:hover {
  background: rgba(74, 144, 226, 0.25);
}

#right-panel {
  flex: none;
  width: 50%;
  background: rgba(10, 23, 64, 0.8);
  border-radius: 15px;
  box-shadow: 0 0 10px rgba(58, 123, 197, 0.7);
  border: 1px solid rgba(74,144,226,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
   overflow: visible;
}

#generated-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  user-select: none;
}

input[type="file"] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.photo-slot label,
#main-photo-upload label {
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
  font-weight: 600;
  font-size: 30px;
  cursor: pointer;
}

.photo-slot label > span:not(:first-child),
#main-photo-upload label > span:not(:first-child) {
  display: none; 
}

.clear-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(74, 144, 226, 0.85);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-weight: bold;
  font-size: 18px; 
  color: white;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 5px #4a90e2;
  transition: background-color 0.3s ease;
  z-index: 5;
}

.clear-button:hover,
.clear-button:focus {
  background-color: #357abd;
  outline: none;
}

@media (max-width: 767px) {
  html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
  }

  #center-container {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 5px 10px !important;
    margin: 0 !important;
    box-sizing: border-box !important;

    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    overflow: visible !important;
  }

  #left-panel {
    width: 100% !important;
    flex-direction: column !important;
  }

  #right-panel {
    order: -1 !important;
    width: 100% !important;
    min-height: 60vh;
    flex: none !important;
    margin-bottom: 0px !important;
    padding-bottom: 0px !important;
    padding-top: 0px !important;

    background: rgba(10, 23, 64, 0.8);
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(58, 123, 197, 0.7);
    border: 1px solid rgba(74,144,226,0.3);

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    overflow: hidden;
    overflow-y: auto;
  }

  #main-photo-upload {
    display: none !important;
  }

  #additional-photos {
    display: flex !important;
    gap: 10px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
  }

  #additional-photos .photo-slot {
    flex: 1 1 0;
    aspect-ratio: 1 / 1;

    background: rgba(10, 23, 64, 0.6);
    border: 1.5px dashed rgba(74, 144, 226, 0.8);
    box-shadow: none;
    border-radius: 10px;
    cursor: pointer;
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  #additional-photos .photo-slot label {
    font-size: 24px;
  }

  #prompt-container {
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 12px 0 !important;
    box-sizing: border-box !important;
    overflow: hidden;
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
  }

  #prompt-input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    padding: 0 10px !important;
    height: auto !important;
    font-size: 16px !important;
    color: white !important;
    background: transparent !important;
    border: none !important;
    resize: none !important;
  }

  .btn-send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    box-sizing: border-box;
    margin: 0 8px 0 0 !important; 
    max-width: 50px;
    background-color: rgba(74, 144, 226, 0.85);
    border: none;
    border-radius: 50%;
    font-weight: 700;
    font-size: 20px;
    color: white;
    cursor: pointer;
    box-shadow: 0 0 10px #4a90e2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  }

  .btn-send:hover,
  .btn-send:focus {
    background-color: #357abd;
    box-shadow: 0 0 15px #357abd;
    outline: none;
    transform: scale(1.1);
  }
}

#sidebar-container-nano_banana {
  width: 240px; 
  max-height: 665px;
  position: fixed;
  top: 20px;
  bottom: 0;
  right: 30px; 
  overflow-y: auto;
  padding: 15px;
  box-sizing: border-box;
  background: linear-gradient(135deg, rgba(10, 23, 64, 0.95) 0%, rgba(30, 60, 110, 0.85) 100%);
  box-shadow: 0 0 20px rgba(58, 123, 197, 0.7);
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: 15px;
  z-index: 10;
  overflow-x: hidden;
}


#aspect-ratio-selector {
    margin-bottom: 15px;
    margin-top: 5px;

}


.aspect-ratio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 10px;
  background-color: rgba(74, 144, 226, 0.15);
  color: white;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 0 5px #4a90e2;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
}

.aspect-ratio-label input[type="radio"] {
    display: none;
}

.aspect-ratio-label .aspect-ratio-text {
  flex-grow: 1;
  text-align: center;
  padding: 0;
  border-radius: 10px;
}


.aspect-ratio-label input[type="radio"]:checked + .aspect-ratio-text {
  font-weight: 700;
  color: white;
}

.aspect-ratio-label:hover {
    background-color: rgba(74, 144, 226, 0.4);
    box-shadow: 0 0 10px rgba(74,144,226,0.6);
}

.aspect-ratio-label.active {
  background: linear-gradient(135deg, #00509e, #337acc);
  box-shadow: 0 0 5px #3399ff;
  cursor: default;
  pointer-events: none;
  color: white;
  font-weight: 700;
}

.aspect-ratio-sidebar-wrapper {
    background: rgba(10, 23, 64, 0.8);           
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255,255,255,0.5); 
    color: white;
    padding: 10px 10px 12px 10px;
    font-family: Arial, sans-serif;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px; 
}

.aspect-ratio-header {
    font-size: 16px;
    user-select: none;
}


.aspect-ratio-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
}


#model-sidebar {
    background: rgba(10, 23, 64, 0.8);         
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255,255,255,0.5); 
    color: white;
    padding: 10px 10px;
    font-family: Arial, sans-serif;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

#model-sidebar .model-btn-chat-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    background-color: rgba(74, 144, 226, 0.2);
    border: none;
    height: 30px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 1px 1px;
    cursor: pointer;
    box-shadow: 0 0 5px #4a90e2 !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
}


.model-btn-chat-link {
    margin-bottom: 0px; 
}
.model-btn-chat-link:last-child {
    margin-bottom: 0px;
}


.model-btn-chat-link:hover {
    background-color: #4a90e2 !important;
    box-shadow: 0 0 10px #4a90e2 !important;
    outline: none;
}

.model-btn-chat-link:focus {
    background-color: #4a90e2 !important;
    box-shadow: 0 0 10px #4a90e2 !important;
    outline: none;
}

.model-btn-chat-link.active {
    background: linear-gradient(135deg, #00509e, #337acc) !important; 
    box-shadow: 0 0 18px #3399ff !important; 
    color: white;
    cursor: default;
    pointer-events: none; 
}


#sidebar-container-nano_banana > #aspect-ratio-selector,
#sidebar-container-nano_banana > #model-sidebar {
  width: 100%;
  box-sizing: border-box;
}


@media (max-width: 767px) {
    #model-sidebar {
        padding: 10px 10px;
        gap: 8px;
    }
}


.balance-separator {
    height: 1px;
    background: rgba(74, 144, 226, 0.5);
    margin: 10px;
}

@media (max-width: 767px) {
    #sidebar-container-nano_banana {
        position: fixed;
        top: 0;
        bottom: 0; 
        max-height: none !important;
        height: 100vh !important;
        width: 231px;
        right: -245px; 
        background: linear-gradient(135deg, rgba(10, 23, 64, 0.95) 0%, rgba(30, 60, 110, 0.85) 100%);
        box-shadow: 0 0 20px rgba(58, 123, 197, 0.7);
        border-radius: 0 0 0 15px;
        padding: 15px;
        padding-top: 0px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(74, 144, 226, 0.3);
        color: white;
        z-index: 12;
        transition: right 0.3s ease;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    #sidebar-container-nano_banana.open {
        right: 0;
        border-radius: 0 0 0 15px;
    }

    #overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 12;
        transition: opacity 0.3s ease;
        opacity: 0;
    }
    #overlay.active {
        display: block;
        opacity: 1;
    }

  #sidebar-toggle-btn {
    position: fixed;
    top: 40%;
    right: 230px;
    width: 32px;
    height: 100px;

    background: linear-gradient(135deg, rgba(10, 23, 64, 0.95) 0%, rgba(30, 60, 110, 0.85) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 15px 0 0 15px;

    border-top: 1px solid rgba(74, 144, 226, 0.3);
    border-left: 1px solid rgba(74, 144, 226, 0.3);
    border-bottom: 1px solid rgba(74, 144, 226, 0.3);
    border-right: 1px solid transparent;

    box-shadow: 0 0 20px rgba(58, 123, 197, 0.7);

    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 14;
    transition: right 0.3s ease;
    user-select: none;
    transform-origin: center center;
}
  
     #sidebar-container-nano_banana.open + #sidebar-toggle-btn {
        right: 230px; 
        border-radius: 15px 0 0 15px !important;
    }
    
    
    #sidebar-toggle-btn.closed {
    right: 0;
    border-radius: 15px 0 0 15px !important;
        
    background: linear-gradient(45deg, #3a7bd5, #00d2ff, #3a7bd5, #00d2ff);
    background-size: 300% 300%;
    border: 2px solid #4a90e2;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.7);
    color: #fff;
    cursor: pointer;
    animation: gradientShiftVertical 6s ease infinite;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 100px;
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

#sidebar-toggle-btn.closed:hover,
#sidebar-toggle-btn.closed:focus {
    box-shadow: 0 0 20px rgba(74, 144, 226, 1);
    outline: none;
    transform: scale(1.03);
    color: #fff;
}
}

@keyframes gradientShiftVertical {
    0% {
        background-position: 50% 0%;
    }
    50% {
        background-position: 50% 100%;
    }
    100% {
        background-position: 50% 0%;
    }
}
    

    #sidebar-container-nano_banana.open + #sidebar-toggle-btn #sidebar-icon-open {
        display: none;
    }
    #sidebar-container-nano_banana.open + #sidebar-toggle-btn #sidebar-icon-close {
        display: block;
    }
    

#sidebar-icon-left,
#sidebar-icon-right {
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 24px;
    height: 24px;
}

    #sidebar-container-nano_banana.open + #sidebar-toggle-btn #sidebar-icon-open {
        display: none;
    }
    #sidebar-container-nano_banana.open + #sidebar-toggle-btn #sidebar-icon-close {
        display: block;
    }
    
@media (max-width: 767px) {
.user-logout-container {
    margin-top: 0px;
        
}
}

.settings-separator {
    border: 0;
    height: 1px;
    background: rgba(74, 144, 226, 0.5);
    margin: 10px 0;
}  

.balance-text {
    display: block;
    margin-top: 8px; 
    font-size: 14px;
    color: white;
    font-weight: normal;
}

#model-prices-list {
    font-size: 12px;
    margin: 0 24px;
    margin-top: 4px; 
}

#generated-images-container {
  padding-top: 15px;
  padding-bottom: 15px;
  overflow-y: auto;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;

  scrollbar-width: none;      

  -ms-overflow-style: none;    
}

#generated-images-container::-webkit-scrollbar {
  display: none;             
}

#generated-images-container img {
  cursor: pointer;
}


.generated-photo-window {
  position: relative; 
}

.download-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: linear-gradient(135deg, #3a9fff, #0f63ff);
  border: none;
  border-radius: 50%;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 8px #3a9fff,
    0 0 15px #0f63ff;
  user-select: none;
  opacity: 0.6;
  transition:
    background 0.3s ease,
    transform 0.25s ease,
    box-shadow 0.3s ease;
}

.download-icon:hover,
.download-icon:focus {
  background: linear-gradient(135deg, #0f63ff, #3a9fff);
  outline: none;
  opacity: 1;
  transform: scale(1.2) rotate(15deg);
  box-shadow:
    0 0 12px #3a9fff,
    0 0 20px #1a7eff,
    0 0 30px #0f63ff;
  animation: pulseGlow 1.5s infinite alternate ease-in-out;
}

.download-icon svg {
  stroke: white;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

@keyframes pulseGlow {
  0% {
    box-shadow:
      0 0 12px #3a9fff,
      0 0 20px #1a7eff,
      0 0 30px #0f63ff;
  }
  100% {
    box-shadow:
      0 0 20px #5ab7ff,
      0 0 30px #3dafef,
      0 0 40px #3dafef;
  }
}

@keyframes mistMove {
    0% {
        background-position: 0% 50%;
        opacity: 0.8;
    }
    50% {
        background-position: 100% 60%;
        opacity: 1;
    }
    100% {
        background-position: 0% 50%;
        opacity: 0.8;
    }
}

.generated-photo-window.timer-window {
    position: relative;
    border-radius: 15px;
    overflow: visible;
    aspect-ratio: 16 / 9;
    margin: 0 10px;
    box-shadow: 0 0 45px #3399ffbb inset;
    cursor: default;
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    min-height: 180px;

    background: linear-gradient(270deg,
        rgba(7, 12, 25, 0.9),
        rgba(48, 75, 115, 0.9),
        rgba(24, 40, 60, 0.95),
        rgba(60, 95, 150, 0.85),
        rgba(7, 12, 25, 0.9)
    );
    background-size: 350% 350%;
    animation: mistMove 40s ease-in-out infinite;
    color: #9bd8ff;
    font-weight: 700;
    font-size: 24px;
    user-select: none;
    padding: 30px 10px 20px 10px; 
    box-sizing: border-box;
}

.generated-photo-window .countdown-timer {
    position: relative;
    z-index: 10;
    font-weight: 700;
    font-family: Arial, sans-serif;
    letter-spacing: 0.15em;
    background: rgba(0, 0, 0, 0.45);
    padding: 10px 30px;
    border-radius: 25px;
    box-shadow: 0 0 25px rgba(0, 170, 255, 1);
    user-select: none;
    font-size: 28px;
    color: #57bdfd;
    text-shadow:
        0 0 3px #2e9cff,
        0 0 6px #2e9cff,
        0 0 8px #2e9cff;
    transition: color 0.3s ease;
    min-width: 130px;
    text-align: center;
}

.timer-with-pulse {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px; 
}

.timer-pulse-dot {
    width: 48px; 
    height: 48px;
    pointer-events: none;
}

.generated-photo-window.no-padding {
    padding: 0 !important;
}

@media (max-width: 767px) {
  #generated-images-container {
    max-height: 55vh;  
    overflow-y: auto;
  }
}

#lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  overflow: hidden; 
}


#lightbox-image {
max-width:100vw; 
max-height:100vh; 
box-shadow: 0 0 20px #000;
}