/* ========================================
   ⬅️ 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;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  width: fit-content;
}

.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);
}

/* ========================================
   🔐 SECRET MESSAGE CONVERTER - CSS
   Matches Index.html Theme
======================================== */

/* ========================================
   📦 TOOL CONTAINER
======================================== */
.tool-container {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  animation: fadeInUp 0.6s ease;
}

/* ========================================
   📋 TOOL HEADER
======================================== */
.tool-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tool-header h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 800;
}

.tool-description {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.8;
  max-width: 700px;
  margin: 0 auto;
}

/* ========================================
   🔄 TAB SWITCHER
======================================== */
.tab-switcher {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  background: var(--card-bg);
  padding: 0.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.tab-btn {
  flex: 1;
  padding: 1rem 1.5rem;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  background: var(--bg-color);
  color: var(--text-color);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.tab-icon {
  font-size: 1.2rem;
}

/* ========================================
   🎴 TOOL CARD
======================================== */
.tool-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 3rem 2.5rem;
  margin-bottom: 2rem;
}

/* ========================================
   📝 MODE CONTENT
======================================== */
.mode-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.mode-content.active {
  display: block;
}

.mode-header {
  text-align: center;
  margin-bottom: 2rem;
}

.mode-header h2 {
  font-size: 1.8rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.mode-header p {
  color: var(--text-light);
  font-size: 1rem;
}

/* ========================================
   📥 INPUT SECTION
======================================== */
.input-section {
  margin-bottom: 1.5rem;
}

.input-section label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

.input-box {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
  resize: vertical;
  transition: all 0.3s ease;
}

.input-box:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-box::placeholder {
  color: var(--text-light);
}

.char-count {
  text-align: right;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.char-count span {
  color: var(--primary-color);
  font-weight: 700;
}

/* ========================================
   🔘 ACTION BUTTON
======================================== */
.action-btn {
  width: 100%;
  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: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  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;
}

.action-btn:hover::before {
  left: 100%;
}

.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.action-btn:active {
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 1.3rem;
}

/* ========================================
   📤 OUTPUT SECTION
======================================== */
.output-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

.output-section label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

.output-box {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Courier New', monospace;
  color: var(--text-color);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  resize: vertical;
  cursor: text;
}

.output-box:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ========================================
   📋 COPY BUTTON
======================================== */
.copy-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.copy-btn:active {
  transform: translateY(0);
}

/* ========================================
   ✅ SUCCESS MESSAGE
======================================== */
.success-message {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
  border: 2px solid #10b981;
  border-radius: 8px;
  color: #059669;
  font-weight: 600;
  text-align: center;
  animation: slideDown 0.3s ease;
}

/* ========================================
   ❌ ERROR MESSAGE
======================================== */
.error-message {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
  border: 2px solid #ef4444;
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  color: #dc2626;
  font-weight: 600;
  animation: shake 0.4s ease;
}

/* ========================================
   📚 INFO SECTION
======================================== */
.info-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

.info-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.info-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.info-card h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 700;
}

.info-card p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.info-card p:last-child {
  margin-bottom: 0;
}

.info-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-card ul li {
  padding: 0.5rem 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-color);
}

/* ========================================
   ⚠️ WARNING CARD
======================================== */
.warning-card {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.1) 100%);
  border: 2px solid #ffc107;
  border-left: 4px solid #ffc107;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.warning-card h3 {
  font-size: 1.3rem;
  color: #f59e0b;
  margin-bottom: 1rem;
  font-weight: 700;
}

.warning-card p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-color);
  margin: 0;
}

/* ========================================
   ❓ FAQ SECTION
======================================== */
.faq-section {
  margin-top: 3rem;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2.5rem;
}

.faq-section h2 {
  font-size: 2rem;
  color: var(--text-color);
  margin-bottom: 2rem;
  text-align: center;
  font-weight: 700;
}

.faq-item {
  background: white;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.faq-item:hover {
  box-shadow: var(--shadow);
  transform: translateX(3px);
}

.faq-item h3 {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.faq-item p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-color);
  margin: 0;
}

/* ========================================
   📱 RESPONSIVE - TABLETS (640px+)
======================================== */
@media (min-width: 640px) {
  .tool-header h1 {
    font-size: 3rem;
  }

  .info-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   💻 RESPONSIVE - DESKTOP (768px+)
======================================== */
@media (min-width: 768px) {
  .tool-card {
    padding: 4rem 3.5rem;
  }

  .tab-btn {
    font-size: 1.05rem;
  }

  .info-section {
    grid-template-columns: repeat(2, 1fr);
  }

  .warning-card {
    grid-column: 1 / -1;
  }
}

/* ========================================
   📱 RESPONSIVE - MOBILE (<640px)
======================================== */
@media (max-width: 640px) {
  .tool-container {
    margin: 2rem auto;
    padding: 0 1rem;
  }

  .tool-card {
    padding: 2rem 1.5rem;
  }

  .tool-header h1 {
    font-size: 2rem;
  }

  .tab-switcher {
    flex-direction: column;
    gap: 0.5rem;
  }

  .tab-btn {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }

  .action-btn {
    font-size: 1rem;
    padding: 1rem 1.5rem;
  }

  .faq-section {
    padding: 1.5rem;
  }
}

/* ========================================
   ✨ ANIMATIONS
======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ========================================
   ♿ ACCESSIBILITY
======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   📝 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);
}
