/* ========================================
   🖼️ IMAGE TO BASE64 CONVERTER - CSS
   Index.html Theme ke According
======================================== */

/* ✅ Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Theme - Same as Index.html */
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #8b5cf6;
  --accent-color: #ec4899;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #1e293b;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --success-color: #10b981;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  padding: 2rem 1rem;
}

/* ========================================
   ⬅️ BACK BUTTON (Enhanced with SVG)
======================================== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--card-bg);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
}

.back-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  transition: left 0.5s ease;
}

.back-btn:hover::before {
  left: 100%;
}

.back-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.back-btn:active {
  transform: translateX(-3px) scale(0.98);
}



/* ========================================
   📦 MAIN CONTAINER
====
.back-btn.hidden {
  display: none;==================================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 2.5rem 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s ease;
}

.container h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-align: center;
}

.container > p {
  font-size: 1rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* ========================================
   📤 UPLOAD BOX
======================================== */
.upload-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 3px dashed var(--primary-color);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.upload-box:hover {
  border-color: var(--secondary-color);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.upload-box::before {
  content: '📁';
  display: block;
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 2s infinite;
}

.upload-box::after {
  content: 'Click or drag image here to upload';
  display: block;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

#imageInput {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

#imageInput:focus {
  outline: none;
}

.upload-box:has(#imageInput:focus) {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* File Selected State */
#imageInput:valid ~ .upload-box::before {
  content: '✓';
  color: var(--success-color);
}

/* ========================================
   📝 BASE64 OUTPUT TEXTAREA
======================================== */
#base64Output {
  width: 100%;
  min-height: 250px;
  padding: 1.25rem;
  font-size: 0.95rem;
  font-family: 'Courier New', monospace;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-color);
  color: var(--text-color);
  resize: vertical;
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

#base64Output:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  background: white;
}

#base64Output::placeholder {
  color: var(--text-light);
  font-style: italic;
}

#base64Output:not(:placeholder-shown) {
  border-color: var(--success-color);
  background: white;
}

/* Scrollbar Styling */
#base64Output::-webkit-scrollbar {
  width: 10px;
}

#base64Output::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 10px;
}

#base64Output::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

#base64Output::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ========================================
   📋 COPY BUTTON
======================================== */
.copy-btn {
  width: 100%;
  max-width: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 2rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

.copy-btn::before {
  content: '📋';
  font-size: 1.3rem;
}

.copy-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.copy-btn:hover::after {
  left: 100%;
}

.copy-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
}

.copy-btn:active {
  transform: translateY(-1px) scale(1);
}

.copy-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.copy-btn.copied {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  animation: successPulse 0.5s ease;
}

.copy-btn.copied::before {
  content: '✓';
}

/* ========================================
   📱 RESPONSIVE - TABLETS (640px+)
======================================== */
@media (min-width: 640px) {
  .container h1 {
    font-size: 2.25rem;
  }

  .upload-box {
    padding: 4rem 2rem;
  }

  .copy-btn {
    width: auto;
    min-width: 250px;
  }
}

/* ========================================
   💻 RESPONSIVE - DESKTOP (768px+)
======================================== */
@media (min-width: 768px) {
  body {
    padding: 3rem 2rem;
  }

  .container {
    padding: 3rem 2.5rem;
  }

  .container h1 {
    font-size: 2.5rem;
  }

  .container > p {
    font-size: 1.1rem;
  }

  #base64Output {
    min-height: 300px;
  }
}

/* ========================================
   🖥️ RESPONSIVE - LARGE DESKTOP (1024px+)
======================================== */
@media (min-width: 1024px) {
  .container h1 {
    font-size: 3rem;
  }
}

/* ========================================
   ✨ ANIMATIONS
======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes successPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ========================================
   ♿ ACCESSIBILITY
======================================== */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/*Google Ads*/

.ad-sidebar {
  width: 100%; /* Full on mobile */
  max-width: 300px; /* Sidebar size on desktop */
  margin: 20px auto; /* Center it */
  text-align: center;
  border-radius: 8px;
}

/*Google Ads*/
.ad-sidebar {
  width: 100%; /* Full on mobile */
  max-width: 300px; /* Sidebar size on desktop */
  margin: 20px auto; /* Center it */
  text-align: center;
  border-radius: 8px;
}

/* ========================================
   📝 BLOG CTA
======================================== */
.blog-cta {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
}

.blog-cta-content h3 {
  font-size: 1.8rem;
  color: var(--text-color);
  margin-bottom: 1rem;
  font-weight: 700;
}

.blog-cta-content p {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.blog-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.blog-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
