/* ========================================
   🖼️ IMAGE COMPRESSOR - RESPONSIVE CSS
   Mobile First + Desktop Friendly
   Matches index.html Design System
======================================== */

/* ✅ Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
 
:root {
  /* Color Theme (Matching index.html) */
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: hsl(258, 90%, 66%);
  --accent-color: #ec4899;
  --success-color: #10b981;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #1e293b;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --error-color: #ef4444;
  --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;
  display: flex;
  flex-direction: column;
}

/* ========================================
   ⬅️ ENHANCED BACK BUTTON
======================================== */
.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: 4rem  2rem 2rem;  /* Ye line change kiya – upar niche space, left se right shift */
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  width: fit-content;
  justify-content: flex-start;
  align-self: flex-start;
}

.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
======================================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  width: 100%;
  background: transparent;
  flex: 1;
}

/* ========================================
   📄 PAGE HEADER
======================================== */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

/* ========================================
   🎨 COMPRESSOR WRAPPER
======================================== */
.compressor-wrapper {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.5rem;
  animation: fadeInUp 0.6s ease;
}

/* ========================================
   📤 UPLOAD SECTION
======================================== */
.upload-section {
  margin-bottom: 2rem;
}

/* Upload Zone (Drag & Drop) */
.upload-zone {
  display: block;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, var(--bg-color) 0%, #f1f5f9 100%);
}

.upload-zone:hover {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #eef2ff 0%, #f0f4ff 100%);
}

.upload-zone.dragover {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #e0e7ff 0%, #e0e7ff 100%);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.upload-zone h3 {
  font-size: 1.25rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.upload-zone p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.upload-zone small {
  display: block;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Error Message */
.error-message {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: #fee2e2;
  border-left: 4px solid var(--error-color);
  border-radius: 6px;
  color: #991b1b;
  font-size: 0.95rem;
}

.error-message.show {
  display: block;
  animation: slideIn 0.3s ease;
}

/* ========================================
   👀 PREVIEW SECTION
======================================== */
.preview-section {
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease 0.2s backwards;
}

.preview-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: stretch;
}

.preview-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  transition: all 0.3s ease;
}

.preview-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.preview-card h4 {
  font-size: 1rem;
  color: var(--text-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

.preview-card img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 1rem;
  background: white;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
}

.file-info {
  text-align: left;
}

.file-info p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.file-info p strong {
  color: var(--text-color);
}

.savings {
  color: var(--success-color);
  font-weight: 600;
}

/* VS Icon */
.vs-icon {
  display: none;
  font-size: 2rem;
  text-align: center;
  align-self: center;
  color: var(--primary-color);
  animation: fadeIn 0.6s ease;
}

/* ========================================
   🔘 BUTTONS
======================================== */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease 0.4s backwards;
}

.btn {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-shadow: var(--shadow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #9333ea 100%);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-secondary {
  background: var(--text-light);
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ========================================
   ℹ️ INFO SECTION
======================================== */
.info-section {
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
  border-left: 4px solid var(--primary-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease 0.6s backwards;
}

.info-section h3 {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.info-section ul {
  list-style: none;
  padding-left: 0;
}

.info-section li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.95rem;
  color: var(--text-color);
  line-height: 1.5;
}

.info-section li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success-color);
  font-weight: bold;
}

/* ========================================
   🚀 FEATURES SECTION
======================================== */
.features-section {
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease 0.8s backwards;
}

.features-section h3 {
  font-size: 1.25rem;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.feature-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.feature-card h4 {
  font-size: 1.05rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ========================================
   👣 FOOTER STYLES (Shared with index.html)
======================================== */
.pro-footer {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #e2e8f0;
  padding: 3rem 1rem 1rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.footer-brand {
  text-align: center;
}

.footer-brand img {
  width: 200px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.footer-brand p {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-top: 0;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--primary-color);
}

.contact p {
  margin-bottom: 0.5rem;
  color: #cbd5e1;
}

.contact small {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
  margin-top: -0.25rem;
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid #475569;
  padding-top: 1.5rem;
  text-align: center;
}

.footer-bottom p {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.copyright-warning {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.5rem;
}

/* ========================================
   📱 RESPONSIVE DESIGN - TABLETS (640px+)
======================================== */
@media (min-width: 640px) {
  .compressor-wrapper {
    padding: 2.5rem 2rem;
  }

  .preview-container {
    grid-template-columns: 1fr 60px 1fr;
    align-items: center;
  }

  .vs-icon {
    display: block;
  }

  .preview-card img {
    max-height: 250px;
  }

  .button-group {
    flex-direction: row;
    gap: 1rem;
  }

  .btn {
    flex: 1;
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   💻 RESPONSIVE DESIGN - DESKTOP (768px+)
======================================== */
@media (min-width: 768px) {
  .container {
    padding: 2rem 1.5rem;
  }

  .page-header h1 {
    font-size: 2.5rem;
  }

  .page-header p {
    font-size: 1.1rem;
  }

  .compressor-wrapper {
    padding: 3rem;
  }

  .preview-card img {
    max-height: 350px;
  }

  .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .feature-card {
    padding: 2rem 1.5rem;
  }

  .footer-container {
    grid-template-columns: repeat(3, 1fr);
    text-align: left;
  }

  .footer-brand {
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 2.5rem 2rem;
  }

  .page-header h1 {
    font-size: 3rem;
  }

  .compressor-wrapper {
    padding: 3.5rem;
  }
}

/* ========================================
   ✨ ANIMATIONS & EFFECTS
======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.compressor-wrapper {
  animation: fadeInUp 0.6s ease;
}

.preview-section {
  animation: fadeInUp 0.6s ease 0.2s backwards;
}

.feature-card {
  animation: fadeInUp 0.6s ease backwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading State */
.btn:disabled {
  pointer-events: none;
}

.btn.loading::after {
  content: ' ⏳';
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========================================
   ♿ 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;
}

/* ========================================
   📝 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);
}
