* {
  box-sizing: border-box;
  font-family: Inter, system-ui, sans-serif;
}

html {
  min-height: 100%;
  background: linear-gradient(180deg, #252a64, #38328c, #5566ff);
}

body {
  min-height: 100vh;
  margin: 0;
  background: transparent;
  color: #fff;
  visibility: hidden;
}

header {
  padding: 32px 36px;
  font-size: 26px;
  font-weight: 700;
  background: rgba(5, 14, 61, 0.918);
  backdrop-filter: blur(10px);
  position: relative;
}

.app {
  display: flex;
  justify-content: center;
  padding: 40px;
  gap: 30px;
  transition: 0.4s ease;
}

.app.analyzed {
  justify-content: flex-start;
}

.app.analyzed .drop-zone {
  border: none;
  background: transparent;
  padding: 0;
  cursor: default;
}

.app.analyzed .drop-zone img {
  border-radius: 16px;
  box-shadow: none;
  filter: none;
  background: transparent;
}

.drop-zone.disabled {
  opacity: 1;
}


.left-panel {
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
  position: sticky;
  top: 30px;
}

.card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.drop-zone {
  border: 2px dashed #00e0ff;
  border-radius: 18px;
  height: 260px;        
  padding: 4px;
  flex-direction: column;
  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  cursor: pointer;
  overflow: hidden;
}

.drop-zone strong {
  font-size: 18px;
  display: block;
  margin-bottom: 6px;
}

.drop-zone span {
  font-size: 16px;
  opacity: 0.9;
}

.drop-zone img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;       
  border-radius: 14px;
  display: block;
}

#imageInput {
  display: none;
}

button {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border-radius: 30px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #00e0ff, #00ffa3);
  color: #00343f;
}

#quotaInfo {
  margin-top: 8px;
  font-size: 13px;
  text-align: center;
  opacity: 0.85;
}

.loading-box {
  text-align: center;
  margin-top: 18px;
  font-size: 16px;
}

#loadingBox .loader-gif {
    width: 60px; 
    height: auto;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #00e0ff;
  border-radius: 50%;
  margin: 14px auto 0;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.right-panel {
  flex: 1;
  display: none;
  gap: 20px;
}

.panel {
  background: #fff;
  color: #1f2937;
  border-radius: 18px;
  padding: 24px;

  max-height: 420px;    
  overflow-y: auto;   

  width: 50%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}


.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel h2 {
  margin: 0;
  font-size: 20px;
}

.panel h3 {
  margin-left: 0;
}

.panel ul {
  margin-left: 18px;
}

.fullscreen-btn {
  cursor: pointer;
}

.fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
}

.panel.fullscreen {
  position: fixed;
  top: 20px;
  bottom: 20px;
  right: 20px;
  width: calc(100% - 400px);
  max-height: none;
  z-index: 999;
  border-radius: 18px;
  overflow: auto;
}

@media (max-width: 768px) {
  .app {
    flex-direction: column;
    padding: 20px;
  }

  .left-panel {
    position: static;
    max-width: 100%;
  }

  .right-panel {
    display: flex;
    flex-direction: column;
  }

  .panel {
    width: 100%;
    max-height: none;
  }

  .panel.fullscreen {
    left: 10px;
    right: 10px;
    top: 10px;
    bottom: 10px;
    width: auto;
  }

  header.site-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 16px !important;
    gap: 6px !important;
  }

  .site-logo {
    height: 44px !important;
  }

  .header-text {
    position: relative !important;   
    left: auto !important;
    top: auto !important;
    transform: none !important;       
    font-size: 17px !important;     
    font-weight: 600 !important;    
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.2 !important;
    margin-top: 4px !important;
    text-shadow:
      0 0 4px rgba(0, 224, 255, 0.35),
      0 0 8px rgba(0, 224, 255, 0.2) !important;
  }
  .generated-grid {
    grid-template-columns: 1fr;
  } 
}

.app.analyzed .left-panel {
  max-width: 400px; 
  margin: 0;         
}

.app.analyzed .drop-zone {
  min-height: 180px; 
  max-height: 260px; 
  padding: 8px;   
}

.select-wrapper {
  position: relative;
  margin-top: 14px;
}

.select-wrapper::after {
  content: "▾";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 14px;
  color: #00e0ff;
}
.select-wrapper.hidden {
  opacity: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

#analysisLangSelect {
  width: 100%;
  padding: 12px 42px 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

#analysisLangSelect option {
  color: #111;
  background: #ffffff;
}

#analysisLangSelect:hover {
  border-color: #00e0ff;
}

#analysisLangSelect:focus {
  border-color: #00ffa3;
  box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.25);
}

#analysisLangSelect option[value=""] {
  color: #9ca3af;
}

.site-header {
  padding: 20px 36px;
  background: rgba(5, 14, 61, 0.918);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
}

.site-logo {
  height: 72px;      
  width: auto;
  filter: drop-shadow(0 6px 18px rgba(0, 224, 255, 0.45));
}
.header-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) skewX(-8deg);

  font-size: 50px;
  font-weight: 800;
  color: #ffffff;
  font-style: italic;
  letter-spacing: 0.5px;
  white-space: nowrap;

  text-shadow:
    0 0 6px rgba(0, 224, 255, 0.6),
    0 0 14px rgba(0, 224, 255, 0.4),
    0 0 28px rgba(0, 224, 255, 0.25);
}


.generated-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 750px;
  margin: 0 auto;
}

.gen-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(0, 224, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.gen-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.4s ease;
}

.gen-card img:hover {
  transform: scale(1.08);
}

.gen-skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #1e224f 25%, #2a2f6a 50%, #1e224f 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.gen-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.gen-card:hover {
    transform: scale(1.02);
}

.download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
    z-index: 10;
}

.download-btn:hover {
    background: #ff00c8;
}

.zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px; 
    box-sizing: border-box;
}

.zoom-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.zoom-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    user-select: none;
}

.zoom-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 10001;
    text-shadow: 0 0 10px rgba(0,0,0,1);
    transition: color 0.3s;
}

.zoom-close:hover {
    color: #ff00c8;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loader-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.loader-gif {
    width: 75px; 
    height: auto;
    margin-bottom: 15px;
}
