@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;800&display=swap');

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --navy: #0a0f1d;
  --text: #1e293b;
  --text-light: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --accent-purple: #a855f7;
  --bg-light: #f8fafc;
  --border: #e2e8f0;
}

/* ================= GLOBAL & RESET ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #fdfdff;
  color: var(--text);
  overflow-x: hidden;
  perspective: 1500px;
  line-height: 1.6;
  font-size: clamp(0.9rem, 1.5vw, 1rem);
}

img, canvas, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ================= MOBILE MENU TOGGLE ================= */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1002;
  min-height: 44px;
  min-width: 44px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* ================= NAVBAR ================= */
.navbar {
  background: var(--navy);
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8%;
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.accent { color: var(--primary); }

.nav-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-item {
  cursor: pointer;
  padding: 10px 15px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  user-select: none;
  min-height: 44px;
}

.nav-item svg {
  stroke: currentColor;
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: var(--primary);
}

/* ================= DROPDOWNS ================= */
.dropdown { position: relative; }

.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  background: white;
  padding: 10px;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(12px) rotateX(-15deg);
  transform-origin: top;
  pointer-events: none;
  transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1001;
}

.dropdown:hover .dropdown-content {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
  pointer-events: auto;
}

.dropdown-content a {
  display: block;
  padding: 12px;
  text-decoration: none;
  color: #475569;
  border-radius: 8px;
  transition: 0.2s;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.dropdown-content a:hover {
  background: #f1f5f9;
  color: var(--primary);
  transform: translateX(8px);
}

/* ================= LAYOUT ================= */
.layout {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  min-height: calc(100vh - 80px);
}

.content {
  padding: 40px 5%;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.ad-column {
  background: #f1f5f9;
  text-align: center;
  padding-top: 100px;
  font-weight: 800;
  color: #cbd5e1;
  font-size: 0.9rem;
}

/* ================= HERO ================= */
.hero-title {
  font-size: clamp(1.8rem, 5vw, 3.3rem);
  text-align: center;
  margin-top: 30px;
  animation: heroReveal 1.2s cubic-bezier(.22,1,.36,1) both;
  line-height: 1.2;
}

@keyframes heroReveal {
  0% { opacity: 0; transform: translateY(40px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.gradient-text {
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #6366f1);
  background-size: 300% auto;
  animation: gradientFlow 5s linear infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes gradientFlow {
  to { background-position: 300% center; }
}

.subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 50px;
  animation: fadeUp 0.8s ease 0.4s both;
  font-size: clamp(1rem, 2vw, 1.1rem);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= HOME GRID ================= */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  perspective: 1200px;
  margin-bottom: 50px;
}

.home-card {
  background: white;
  padding: 35px;
  border-radius: 24px;
  border: 1px solid var(--border);
  text-align: center;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  animation: toolFloat 6s ease-in-out infinite;
}

.home-card:nth-child(2) { animation-delay: 1s; }
.home-card:nth-child(3) { animation-delay: 2s; }
.home-card:nth-child(4) { animation-delay: 3s; }
.home-card:nth-child(5) { animation-delay: 4s; }
.home-card:nth-child(6) { animation-delay: 5s; }

@keyframes toolFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.home-card:hover {
  animation-play-state: paused;
  transform: rotateX(10deg) rotateY(-10deg) translateZ(30px);
  border-color: var(--primary);
  box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.25);
}

.home-card h3 {
  margin: 0 0 10px 0;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  transform: translateZ(40px);
}

.home-card p {
  color: var(--text-light);
  transform: translateZ(20px);
  font-size: 0.95rem;
}

/* ================= PAGE TRANSITIONS ================= */
.page { display: none; }

.page.active {
  display: block;
  animation: pageEnter 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) both;
}

@keyframes pageEnter {
  from { opacity: 0; transform: rotateY(-10deg) translateX(50px); }
  to { opacity: 1; transform: rotateY(0) translateX(0); }
}

/* ================= TOOL CARDS ================= */
.tool-title {
  text-align: center;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 30px;
}

.tool-card {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
  background: #ffffff;
  border-radius: 22px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

/* ================= FILE INPUT ================= */
.file-input-wrapper {
  width: 100%;
  height: 180px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}

.file-input-wrapper:hover, .file-input-wrapper.drag-over {
  border-color: var(--primary);
  background: #eef2ff;
}

.hidden-input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  top: 0;
  left: 0;
}

.custom-file-btn {
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  pointer-events: none;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.file-name {
  color: var(--text-light);
  font-size: 0.9rem;
  pointer-events: none;
  text-align: center;
  padding: 0 10px;
}

/* ================= FORM ELEMENTS ================= */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group input[type="color"],
.input-group select,
.full-width {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s;
  min-height: 44px;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  min-width: 20px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  transition: background 0.2s;
  min-height: 44px;
}

.radio-label:hover {
  background: rgba(99, 102, 241, 0.1);
}

.radio-label input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  min-width: 18px;
}

/* ================= BUTTONS ================= */
button, a {
  min-height: 44px;
  min-width: 44px;
}

.primary-btn {
  width: 100%;
  padding: 14px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}

.primary-btn:hover {
  background: var(--primary);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.primary-btn:active {
  transform: scale(0.98);
}

.secondary-btn {
  padding: 10px 20px;
  background: var(--bg-light);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
}

.secondary-btn:hover {
  background: var(--border);
}

.danger-btn {
  padding: 10px 20px;
  background: #fee2e2;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
}

.danger-btn:hover {
  background: var(--danger);
  color: white;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--bg-light);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.icon-btn:hover {
  background: var(--primary);
  color: white;
}

/* ================= SLIDERS ================= */
.slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  margin: 10px 0;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ================= TEXTAREAS ================= */
textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  resize: vertical;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.full-textarea {
  min-height: 200px;
}

.code-textarea {
  font-family: 'Courier New', monospace;
  background: #f8f9fa;
}

/* ================= PREVIEW AREAS ================= */
.preview-area, .filter-preview, .watermark-preview {
  width: 100%;
  min-height: 200px;
  background: var(--bg-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-area img, .filter-preview img, .watermark-preview img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

/* ================= DOWNLOAD ZONE ================= */
.download-zone {
  margin-top: 20px;
  padding: 20px;
  background: #ecfdf5;
  border-radius: 12px;
  text-align: center;
  display: none;
}

.download-zone.show {
  display: block;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 30px;
  background: var(--success);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  transition: all 0.3s;
  min-height: 44px;
}

.download-btn:hover {
  background: #059669;
  transform: translateY(-2px);
}

/* ================= INFO BOX ================= */
.info-box {
  padding: 15px;
  background: #eff6ff;
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text);
  display: none;
  border-left: 4px solid var(--primary);
}

.info-box.show {
  display: block;
  animation: slideIn 0.3s ease;
}

/* ================= FORMAT BUTTONS ================= */
.format-buttons, .preset-buttons, .text-buttons, .filter-presets, .rotate-buttons, .json-buttons, .csv-buttons, .base64-buttons, .merge-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.format-btn, .preset-buttons button, .text-buttons button, .filter-presets button, .rotate-btn {
  padding: 10px 18px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.format-btn.active, .format-btn:hover, .preset-buttons button:hover, .text-buttons button:hover, .filter-presets button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.rotate-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ================= STATS GRID ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.stat-card {
  background: var(--bg-light);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--border);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.stat-number {
  display: block;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 5px;
  display: block;
}

/* ================= COMPARE ================= */
.compare-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.compare-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-side textarea {
  min-height: 300px;
}

.compare-result {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-light);
  border-radius: 12px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.diff-added {
  background: #d1fae5;
  color: #065f46;
  padding: 2px 4px;
  border-radius: 3px;
}

.diff-removed {
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 4px;
  border-radius: 3px;
  text-decoration: line-through;
}

/* ================= JSON ================= */
.status-message {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  display: none;
}

.status-message.show {
  display: block;
  animation: slideIn 0.3s ease;
}

.status-message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.status-message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

/* ================= QR CODE ================= */
.qr-result {
  margin-top: 20px;
  text-align: center;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 12px;
  padding: 20px;
}

.qr-result img, .qr-result canvas {
  max-width: 100%;
  height: auto;
}

/* ================= PASSWORD GENERATOR ================= */
.password-display {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.password-display input {
  flex: 1;
  min-width: 200px;
  padding: 15px;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-family: 'Courier New', monospace;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-light);
  letter-spacing: 2px;
  min-height: 44px;
}

.password-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.password-strength {
  margin-top: 15px;
  padding: 12px 15px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s;
  display: none;
}

.password-strength.show {
  display: block;
}

.password-strength.strength-weak {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.password-strength.strength-medium {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.password-strength.strength-strong {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ================= COLOR PICKER ================= */
.color-picker-container {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 30px;
  align-items: start;
}

.color-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.color-input-wrapper input[type="color"] {
  width: 150px;
  height: 150px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  padding: 5px;
  background: var(--bg-light);
}

.color-preview {
  width: 150px;
  height: 80px;
  border-radius: 12px;
  background: var(--primary);
  border: 2px solid var(--border);
  transition: background 0.3s;
}

.color-values {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.color-palettes {
  margin-top: 30px;
}

.color-palettes h3 {
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: var(--text);
}

.palette-row {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.palette-color {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: transform 0.2s;
}

.palette-color:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ================= CROP ================= */
.crop-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 0 auto;
  background: var(--bg-light);
  border-radius: 12px;
  overflow: hidden;
}

#cropCanvas {
  max-width: 100%;
  display: block;
}

.crop-overlay {
  position: absolute;
  border: 2px dashed var(--primary);
  background: rgba(99, 102, 241, 0.2);
  pointer-events: none;
}

.crop-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 15px;
}

/* ================= FILE LIST ================= */
.file-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg-light);
}

.file-list-item {
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  border-bottom: 1px solid var(--border);
}

.file-list-item:last-child {
  border-bottom: none;
}

.file-list-item:hover {
  background: #e0e7ff;
}

.file-list-item.selected {
  background: #e0e7ff;
  border-left: 3px solid var(--primary);
}

/* ================= SPLIT OPTIONS ================= */
.split-options {
  margin: 20px 0;
}

.split-mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

/* ================= WATERMARK CONTROLS ================= */
.watermark-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

/* ================= FILTER CONTROLS ================= */
.filter-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

/* ================= RESIZE CONTROLS ================= */
.resize-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

/* ================= BASE64 MODE ================= */
.base64-mode {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ================= QR OPTIONS ================= */
.qr-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

/* ================= BLOG STYLES ================= */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  margin-top: 30px;
  perspective: 1200px;
}

.blog-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  animation: toolFloat 6s ease-in-out infinite;
}

.blog-card:nth-child(2) { animation-delay: 1s; }
.blog-card:nth-child(3) { animation-delay: 2s; }
.blog-card:nth-child(4) { animation-delay: 3s; }
.blog-card:nth-child(5) { animation-delay: 4s; }
.blog-card:nth-child(6) { animation-delay: 5s; }

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), #ec4899);
  transform: scaleX(0);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.blog-card:hover {
  animation-play-state: paused;
  transform: rotateX(5deg) rotateY(-5deg) translateZ(20px) translateY(-10px);
  box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
}

.blog-card:hover::before {
  transform: scaleX(1);
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 0.85em;
  transform: translateZ(30px);
  flex-wrap: wrap;
  gap: 10px;
}

.blog-category {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7em;
  letter-spacing: 0.8px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.blog-date {
  color: var(--text-light);
  font-weight: 600;
}

.blog-title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 800;
  margin-bottom: 15px;
  line-height: 1.3;
  color: var(--navy);
  transform: translateZ(40px);
  transition: color 0.3s;
}

.blog-card:hover .blog-title {
  color: var(--primary);
}

.blog-excerpt {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 25px;
  font-size: 0.95em;
  transform: translateZ(20px);
}

.blog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 2px solid var(--border);
  transform: translateZ(30px);
  flex-wrap: wrap;
  gap: 10px;
}

.read-time {
  color: var(--text-light);
  font-size: 0.85em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.read-time::before {
  content: '⏱';
}

.read-more {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9em;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.read-more::after {
  content: '→';
  transition: transform 0.3s;
}

.blog-card:hover .read-more {
  color: var(--accent-purple);
  transform: translateX(5px);
}

.blog-card:hover .read-more::after {
  transform: translateX(3px);
}

/* BLOG FULL POST STYLES */
.blog-full {
  max-width: 800px;
  margin: 0 auto;
  animation: pageEnter 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) both;
}

.back-btn {
  background: white;
  border: 2px solid var(--border);
  color: var(--primary);
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 30px;
  transition: all 0.3s;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  min-height: 44px;
}

.back-btn::before {
  content: '←';
  transition: transform 0.3s;
}

.back-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateX(-5px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.back-btn:hover::before {
  transform: translateX(-3px);
}

.blog-meta-full {
  display: flex;
  gap: 25px;
  color: var(--text-light);
  margin-bottom: 35px;
  font-size: 0.95em;
  font-weight: 600;
  padding: 20px;
  background: var(--bg-light);
  border-radius: 12px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.blog-meta-full span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.blog-body {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.9;
  color: var(--text);
}

.blog-body p {
  margin-bottom: 25px;
}

.blog-body h2 {
  color: var(--navy);
  margin: 35px 0 20px 0;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 800;
}

.blog-body h3 {
  color: var(--primary);
  margin: 30px 0 15px 0;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 700;
}

.blog-body ul, .blog-body ol {
  margin: 20px 0;
  padding-left: 30px;
}

.blog-body li {
  margin: 12px 0;
  color: var(--text-light);
}

.blog-body strong {
  color: var(--navy);
  font-weight: 700;
}

.blog-body a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s;
}

.blog-body a:hover {
  border-bottom-color: var(--primary);
}

.blog-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 20px 30px;
  margin: 30px 0;
  background: var(--bg-light);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--text-light);
}

.blog-body code {
  background: var(--bg-light);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--primary);
  border: 1px solid var(--border);
}

.blog-body pre {
  background: var(--navy);
  color: white;
  padding: 25px;
  border-radius: 16px;
  overflow-x: auto;
  margin: 25px 0;
}

.blog-body pre code {
  background: transparent;
  color: white;
  border: none;
  padding: 0;
}

/* ================= ABOUT ================= */
.about-card {
  font-size: 1.1em;
  line-height: 1.8;
}

.about-card h3 {
  color: var(--primary);
  margin-top: 30px;
  margin-bottom: 15px;
  font-size: 1.3em;
}

.about-card ul {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.about-card li {
  padding: 8px 0;
  padding-left: 25px;
  position: relative;
  color: var(--text-light);
}

.about-card li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

/* ================= UTILITY CLASSES ================= */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.hidden { display: none !important; }
.show { display: block !important; }

/* ================= TABLET BREAKPOINT (768px) ================= */
@media (max-width: 768px) {
  .navbar {
    padding: 0 4%;
    position: relative;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .nav-container {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 20px;
    gap: 0;
    transform: translateY(-150%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  }
  
  .nav-container.active {
    transform: translateY(0);
  }
  
  .nav-item {
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    justify-content: space-between;
  }
  
  .dropdown-content {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    background: transparent;
    box-shadow: none;
    padding: 10px 0 0 20px;
    display: none;
    min-width: auto;
  }
  
  .dropdown.active .dropdown-content {
    display: block;
  }
  
  .dropdown-content a {
    color: rgba(255,255,255,0.8);
    padding: 12px;
    transform: none;
  }
  
  .dropdown-content a:hover {
    background: rgba(255,255,255,0.1);
    color: var(--primary);
    transform: none;
  }
  
  .layout {
    grid-template-columns: 1fr;
  }
  
  .ad-column {
    display: none;
  }
  
  .content {
    padding: 20px 4%;
  }
  
  .home-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .home-card {
    padding: 25px;
    animation: none;
  }
  
  .home-card:hover {
    transform: translateY(-5px);
  }
  
  .tool-card {
    padding: 25px;
    margin: 0;
  }
  
  .compare-container {
    grid-template-columns: 1fr;
  }
  
  .compare-side textarea {
    min-height: 150px;
  }
  
  .crop-controls {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .color-picker-container {
    grid-template-columns: 1fr;
  }
  
  .color-input-wrapper {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }
  
  .password-options {
    grid-template-columns: 1fr;
  }
  
  .password-display input {
    width: 100%;
    order: -1;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
  }
  
  .blog-card {
    animation: none;
    padding: 25px;
  }
  
  .blog-card:hover {
    transform: translateY(-5px);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .file-input-wrapper {
    height: 150px;
  }
  
  .format-buttons,
  .preset-buttons,
  .text-buttons,
  .filter-presets,
  .rotate-buttons,
  .json-buttons,
  .csv-buttons,
  .base64-buttons {
    justify-content: center;
  }
  
  .merge-controls {
    flex-direction: column;
  }
  
  .qr-options {
    grid-template-columns: 1fr;
  }
  
  .watermark-controls {
    grid-template-columns: 1fr;
  }
  
  .filter-controls {
    grid-template-columns: 1fr;
  }
  
  .resize-controls {
    grid-template-columns: 1fr;
  }
  
  .base64-mode {
    flex-direction: column;
    gap: 10px;
  }
  
  .slider::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }
  
  .slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }
}

/* ================= SMALL MOBILE BREAKPOINT (480px) ================= */
@media (max-width: 480px) {
  .navbar {
    height: 70px;
  }
  
  .nav-container {
    top: 70px;
    max-height: calc(100vh - 70px);
  }
  
  .hero-title {
    font-size: 1.6rem;
    margin-top: 20px;
  }
  
  .subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
  }
  
  .tool-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }
  
  .tool-card {
    padding: 20px;
    border-radius: 16px;
  }
  
  .home-card h3 {
    font-size: 1.1rem;
  }
  
  .primary-btn,
  .secondary-btn,
  .danger-btn {
    padding: 12px 20px;
    font-size: 0.95rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .crop-controls {
    grid-template-columns: 1fr;
  }
  
  .blog-card {
    padding: 20px;
  }
  
  .blog-title {
    font-size: 1.2rem;
  }
  
  .blog-meta-full {
    flex-direction: column;
    gap: 10px;
  }
  
  .blog-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .file-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .preview-area,
  .filter-preview,
  .watermark-preview {
    min-height: 150px;
  }
  
  .preview-area img,
  .filter-preview img,
  .watermark-preview img {
    max-height: 250px;
  }
  
  .qr-result {
    min-height: 200px;
  }
  
  .compare-result {
    max-height: 300px;
  }
  
  textarea {
    min-height: 100px;
  }
  
  .full-textarea {
    min-height: 150px;
  }
}

/* ================= LARGE DESKTOP (1400px+) ================= */
@media (min-width: 1400px) {
  .content {
    max-width: 1400px;
    padding: 60px 8%;
  }
  
  .home-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .tool-card {
    max-width: 1000px;
  }
  
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ================= TOUCH DEVICE OPTIMIZATIONS ================= */
@media (hover: none) and (pointer: coarse) {
  .home-card:hover,
  .blog-card:hover {
    transform: none;
    animation: none;
  }
  
  .home-card:active,
  .blog-card:active {
    transform: scale(0.98);
  }
  
  .nav-item:hover {
    background: transparent;
  }
  
  .primary-btn:hover {
    transform: none;
  }
  
  .primary-btn:active {
    transform: scale(0.98);
  }
  
  .slider::-webkit-slider-thumb {
    width: 32px;
    height: 32px;
  }
  
  .slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
  }
}

/* ================= REDUCED MOTION ================= */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .home-card,
  .blog-card {
    animation: none;
  }
}

/* ================= PRINT STYLES ================= */
@media print {
  .navbar,
  .ad-column,
  .mobile-menu-toggle,
  .primary-btn,
  .secondary-btn,
  .danger-btn {
    display: none !important;
  }
  
  .content {
    padding: 0;
    max-width: 100%;
  }
  
  .tool-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .page {
    display: block !important;
  }
}

/* ================= DARK MODE SUPPORT (Optional) ================= */
@media (prefers-color-scheme: dark) {
  /* Uncomment if you want automatic dark mode
  :root {
    --bg-light: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --border: #334155;
  }
  
  body {
    background: #0f172a;
  }
  
  .tool-card,
  .home-card,
  .blog-card {
    background: #1e293b;
    border-color: #334155;
  }
  */
}