#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: 190px;  
  right: calc(230px + 20px);
  height: 100vh;
  padding: 20px;
  box-sizing: border-box;

  display: flex;
  flex-direction: column; 
}


#prompt-container {
  flex-shrink: 0;
  position: absolute;
  bottom: 0;
  margin: 0 auto 5px auto;
  left: 0;
  right: 0;
  height: 80px; 
  min-height: 120px;
  width: 700px;
  background: rgba(10, 23, 64, 1.0);
  padding: 12px 16px;
  border: 1px solid #4a90e2;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  display: flex;
  gap: 10px;
  align-items: center;
  box-sizing: border-box;
  z-index: 5;
}



#prompt-container:focus-within {
  border-color: white;
  box-shadow: 0 0 20px white;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}


#prompt-input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  padding: 6px 10px;
  outline: none;
  font-family: Arial, sans-serif;
  border-radius: 6px;
  resize: none;
  min-height: 90px;
  max-height: 100px;
  overflow-y: hidden;
  line-height: 1.3;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-wrap: break-word;
}

#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;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.3s ease, box-shadow 0.3s ease;
            user-select: none;
            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;
}


#right-panel {
  position: relative; 
  display: block; 
  height: 100%; 
  overflow: hidden; 
}

#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; 
}



@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: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;

    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    overflow: visible !important;
  }

  #right-panel {
    order: -1 !important;
    width: 100% !important;
    min-height: 100%;
    flex: none !important;
    margin-bottom: 0px !important;
    padding: 0px !important;
    background: rgba(10, 23, 64, 0.8);
    border-radius: 0;
    border: 0 ;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    overflow: hidden;
    overflow-y: auto;
  }

  #prompt-container {
    position: fixed !important;
    bottom: 0px !important; 
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 95vw !important;
    max-width: 700px !important;
    height: auto !important;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6); !important;
    z-index: 5 !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;
  }

#prompt-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}
  
 .btn-send {
   flex-shrink: 0;
   box-sizing: border-box;
   margin-right: 0px !important; 
   max-width: 50px;
   display: flex;
   align-items: center;
   justify-content: center;
 }
 
}

#sidebar-container-minimax_image {
  width: 240px; 
  max-height: 660px;
  position: fixed;
  top: 20px;
  bottom: 0;
  right: 30px; 
  overflow-y: auto;
  padding: 10px;
  padding-left: 15px;
  padding-right: 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;
} 


@media (max-width: 767px) {

#sidebar-container-minimax_image {    
padding-top: 0px;    
}

#aspect-ratio-selector {
    margin-bottom: 5px !important;
    margin-top: 5px !important;
}

.model-links-wrapper {
    margin-top: 2px !important;
}
}   
    
    

#aspect-ratio-selector {
    margin-bottom: 15px;
    margin-top: 5px;

}

.aspect-ratio-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
}


.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;
}



#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;
}

@media (max-width: 767px) {
    #model-sidebar {
        margin-bottom: 10px;
    }
}

#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: 0px 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: #ffffff !important;
    cursor: default;
    pointer-events: none; 
}


#sidebar-container-minimax_image > #aspect-ratio-selector,
#sidebar-container-minimax_image > #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) {
    .balance-separator {
        margin: 5px;
    }
}


@media (max-width: 767px) {
    #sidebar-container-minimax_image {
        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-minimax_image.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-minimax_image.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-minimax_image.open + #sidebar-toggle-btn #sidebar-icon-open {
        display: none;
    }
    #sidebar-container-minimax_image.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-minimax_image.open + #sidebar-toggle-btn #sidebar-icon-open {
        display: none;
    }
    #sidebar-container-minimax_image.open + #sidebar-toggle-btn #sidebar-icon-close {
        display: block;
    }
    
@media (max-width: 767px) {
.user-logout-container {
    margin-top: 0px;
        
}
}




#prompt_optimizer_checkbox {
  width: 16px;
  height: 16px;
  transform: scale(1.5);
  margin-right: 8px;
  flex-shrink: 0;
}

label.checkbox-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
}

.checkbox-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;  
  line-height: 1.1;
}

.checkbox-text small {
  font-size: 12px;
  color: #aaccee;
  margin-top: 0;
}


.settings-separator {
    border: 0;
    height: 1px;
    background: rgba(74, 144, 226, 0.5);
    margin: 2px 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 {
  position: absolute;
  top: 0;
  bottom: 0px; 
  left: 0;
  right: 0;
  padding: 15px 10px 10px 10px;
  overflow-y: auto;
  scrollbar-width: none;      
  -ms-overflow-style: none;    
  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 {
    min-height: 180px;
    max-height: 300px;
    margin: 0 50px;
    border-radius: 15px;
    overflow: visible;
    box-shadow: 0 0 10px rgba(255,255,255,0.6);
    background: rgba(10, 23, 64, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: default;
    position: relative;
}


@media (max-width: 767px) {
  .generated-photo-window,
  .generated-photo-window.timer-window,
  .generated-photo-window .countdown-timer {
    width: 90vw !important;       
    max-width: 600px !important;   
    margin-left: auto !important;  
    margin-right: auto !important;
    box-sizing: border-box !important;
  }
  
  .generated-photo-window,
  .generated-photo-window.timer-window {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
  }
}

.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 50px;

    box-shadow: 0 0 10px rgba(255,255,255,0.6);
    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: 180px;
    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) {

  .timer-with-pulse {
    width: fit-content !important;    
    max-width: 150px !important;    
    margin: 0 auto !important;       
    padding: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .generated-photo-window .countdown-timer {
    min-width: 150px !important;        
    max-width: 150px !important;    
    width: fit-content !important;  
    padding: 6px 20px !important;     
    font-size: 20px !important;         
    margin: 0 auto !important;      
    border-radius: 20px !important;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.8) !important;
    text-align: center !important;
  }

  .timer-pulse-dot {
    width: 48px !important;
    height: 48px !important;
  }

}



@media (max-width: 767px) {
  #generated-images-container {
    max-height: 100vh;  
    overflow-y: auto;
    gap: 5px;
  }
}

#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;
}