/* ==========================================================================
   1. CORE DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  --bg-gradient: radial-gradient(circle at 50% -20%, #1e1b4b, #0f172a 60%, #020617);
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.12);
  
  --accent-purple: #818cf8;
  --accent-pink: #c084fc;
  --accent-glow: rgba(129, 140, 248, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  
  --radius-xl: 24px;
  --radius-md: 12px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body{
    background: var(--bg-gradient);
}


.body {
  background: var(--bg-gradient);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
}

/* Background Ambient Glow Orbs */
.ambient-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
}
.glow-1 { top: 10%; left: 15%; background: rgba(99, 102, 241, 0.15); }
.glow-2 { bottom: 10%; right: 15%; background: rgba(192, 132, 252, 0.12); }

.container {
  width: 100%;
  max-width: 90vw;
  z-index: 1;
}

/* ==========================================================================
   2. MAIN CARD CONTAINER
   ========================================================================== */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
              0 0 40px var(--accent-glow);
  transition: var(--transition-smooth);
  max-width: 90vw;
  width: 700px;

}

.card:hover {
  border-color: rgba(129, 140, 248, 0.35);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6),
              0 0 50px rgba(129, 140, 248, 0.35);
}

/* Headline & Text */
.card-title {
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.8rem;
}

.card-title .highlight {
  font-size: 1.55rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a5b4fc 0%, #c084fc 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   3. STUDIO ACTION SELECTOR TABS
   ========================================================================== */
.studio-actions-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.action-tab {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.action-tab:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.action-tab.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: #6366f1;
}

/* ==========================================================================
   4. FORMAT CONVERSION BADGES (FROM -> TO)
   ========================================================================== */
.format-badge-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1.8rem;
}

.format-badge {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.highlight-badge {
  border-color: rgba(192, 132, 252, 0.4);
  background: rgba(192, 132, 252, 0.1);
}

.badge-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-select {
  background: transparent;
  border: none;
  color: #c084fc;
  font-size: 0.95rem;
  font-weight: 800;
  outline: none;
  cursor: pointer;
}

.badge-select option {
  background: #0f172a;
  color: var(--text-primary);
}

.badge-arrow {
  color: var(--accent-purple);
  font-size: 1.2rem;
  font-weight: 800;
}

/* ==========================================================================
   5. MODE TOGGLE BAR (FILES vs FOLDER)
   ========================================================================== */
.mode-toggle-bar {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1.5rem;
  gap: 6px;
}

.toggle-btnn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.toggle-btnn:hover {
  color: var(--text-primary);
}

.toggle-btnn.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* ==========================================================================
   6. UPLOAD ZONES
   ========================================================================== */
.upload-zone {
  display: block;
  border: 2px dashed rgba(129, 140, 248, 0.3);
  border-radius: 18px;
  padding: 3rem 1.5rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.3);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-purple);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

.upload-icon {
  font-size: 2.8rem;
  margin-bottom: 0.8rem;
  transition: var(--transition-smooth);
  filter: drop-shadow(0 4px 12px rgba(129, 140, 248, 0.3));
}

.upload-zone:hover .upload-icon {
  transform: translateY(-6px) scale(1.1);
}

#upload-prompt-files, #upload-prompt-folder {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-zone input[type="file"] {
  display: none;
}

.supportParag{
    color: green;
    font-size: small;
}




/*-----------------------------------------------------------------------------*/

/* --- Main Editor Container (Two-Part Split) --- */
.editor-container {
  display: flex !important;
  flex-direction: row !important; /* Forces side-by-side */
  flex-wrap: nowrap !important;   /* Prevents panels from dropping down */
  width: 100%;
  max-width: 1100px;
  background-color: #1e293b;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
  border: 1px solid #334155;
  overflow: hidden;
}

/* --- Part 1: Left Side Image Preview Panel --- */
.preview-panel {
  flex: 1.2;
  background-color: #0f172a;
  background-image: 
    radial-gradient(#1e293b 1px, transparent 1px);
  background-size: 16px 16px; /* Subtle grid background pattern */
  padding: 2.5rem;
  justify-self: center;
  align-self: center;
  border-right: 1px solid #334155;
  min-height: 800px;
  max-width: 550px;
}

.preview-panel img {
    margin-top: 20px;
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}



/*----- the rest button parent-----*/
.preview-image-top{
    margin-top: 0px;
    border-bottom: solid;
    border-color: #b41717;
    

}
/* Container box for the canvas preview */
.preview-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.preview-image {
    width: 100%;
    /* Set a fixed maximum height for the viewport so vertical images fit */
    height: 500px; 
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0f172a; /* Subtle background preview area */
    border-radius: 8px;
    padding: 0px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Force canvas to scale based on available space without stretching */
#previewCanvas {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    display: block;
    margin: auto;
}
/* --- Action Button --- */
.reset-btn {
  margin-bottom: 20px;
  padding: 0.875rem 1.5rem;
  background-color: #ce1414;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  align-self: center;
  justify-self: center;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.reset-btn:hover {
  background-color: #ff0000;
}

.reset-btn:active {
  transform: scale(0.98);
}


 #allImgWarning {
    /* Removes all heading bulk to make it small and flat */
    margin: 8px 0;
    padding: 0;
    background: none;
    box-shadow: none;
    border: none;
    
    /* Tiny, clean, and highly readable typography */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem; 
    font-weight: 500;
    line-height: 1.4;
    color: #ffffff; /* Muted dark grey so it doesn't shout */
  }

  /* The only bright element is the label, ensuring it clearly shows it's a warning */
  #allImgWarning .alert-label {
    color: #ff0004; /* Sharp warning red */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
  }

/*---------------- this is the code of toggle buttons of manual and platforsize in pading setting --------*/
       .ratio-selector-container {
            display: flex;
            gap: 16px;
            background-color: #161820;
            padding: 12px;
            border-radius: 16px;
            border: 1px solid #242736;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        }

        /* Shared Button Styles */
        .ratio-btn {
            background: none;
            border: 2px solid transparent;
            padding: 14px 24px;
            font-size: 15px;
            font-weight: 600;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            gap: 10px;
            background-color: #242736;
            color: #f8fafc;
            border-color: #33374f;
        }

        /* Hover Interaction */
        .ratio-btn:hover {
            border-color: #38bdf8; 
            box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
            transform: translateY(-2px);
        }

.ratio-btn.active {
    background-color: #1e293b;
    color: #38bdf8;
    border-color: #38bdf8;
}

/* 2. THE DOT INDICATOR (Appears only on the active button) */
.ratio-btn.active::before {
    content: '';          /* Required to make the pseudo-element show up */
    width: 8px;           /* Width of the dot */
    height: 8px;          /* Height of the dot */
    background-color: #38bdf8; /* Same electric blue color */
    border-radius: 50%;   /* Makes the square box a perfect circle */
    display: inline-block; /* Allows width/height properties to apply */
}

/* 3. MICRO-INTERACTION CLICK STATE (While pressing down) */
.ratio-btn:active {
    transform: translateY(1px);
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.1);
}


/* --- Part 2: Right Side Controls Panel --- */
.controls-panel {
  flex: 1;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background-color: #1e293b;
  max-width: 400px;

}

.controls-panel h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 0.5rem;
}

/* --- Form Controls & Inputs --- */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: solid;
    border-color: #49b417;

}

.control-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
}

select {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

select:focus {
  border-color: #3b82f6;
}

/* Color Picker Wrapper */
.color-picker-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.color-picker-wrapper select {
  flex: 1;
}

input[type="color"] {
  -webkit-appearance: none;
  border: 1px solid #334155;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  padding: 2px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

/* --- Sliders Grid --- */
.sliders-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  background-color: #0f172a;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid #334155;
}

.slider-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-item label {
  font-size: 0.85rem;
  color: #cbd5e1;
  display: flex;
  justify-content: space-between;
}

.slider-item label span {
  color: #3b82f6;
  font-weight: 600;
}

input[type="range"] {
  accent-color: #3b82f6;
  width: 100%;
  cursor: pointer;
}


/* --- Mobile / Tablet Responsiveness --- */


/* this is the code for the platform size code block */
/*--------------------------------------------------------------------*/

/* Container Grid */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Custom Scrollbar Styling for Grid */
.platform-grid::-webkit-scrollbar {
  width: 6px;
}

.platform-grid::-webkit-scrollbar-track {
  background: #0f172a;
  border-radius: 4px;
}

.platform-grid::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.platform-grid::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Base Card Styling */
.platform-card {
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease-in-out;
  color: #f3f4f6;
  outline: none;
  user-select: none;
  max-width: 150px;
}

.platform-card:hover {
  background-color: #26334d;
  border-color: #475569;
  transform: translateY(-1px);
}

/* Active Selected State */
.platform-card.active {
  background-color: #1e3a8a;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6, 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Platform Logo Icons */
.platform-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Platform Name Text */
.platform-name {
  font-size: 0.825rem;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e2e8f0;
}

.platform-card.active .platform-name {
  color: #ffffff;
  font-weight: 600;
}

/* Aspect Ratio Badge */
.ratio-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background-color: #0f172a;
  color: #38bdf8;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid #1e293b;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.platform-card.active .ratio-badge {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .platform-grid {
    grid-template-columns: 1fr;
  }
}

.dawnloade-button-space{
    margin-top: 0px;
    border-bottom: solid;
    border-color: #31ff08;
    display: flex;
    justify-content: center;
    align-items: center;

}
/* --- Action dawnloade Button --- */
.dawnloade-btn {
  margin-bottom: 20px;
  padding: 0.875rem 1.5rem;
  background-color: #3e920e;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  align-self: center;
  justify-self: center;
  font-weight: 600;
  width: 300px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.dawnloade-btn:hover {
  background-color: #5dc422;
}

.dawnloade-btn:active {
  transform: scale(0.98);
}

@media (max-width: 768px) {
  .editor-container {
    display: block !important;
  }
  .preview-panel {
    border-right: none;
    border-bottom: 1px solid #334155;
    min-height: 300px;
  }
  .sliders-grid {
    grid-template-columns: 1fr;
  }

}
