@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Cairo:wght@400;600;700&display=swap");

:root {
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --secondary: #a855f7;
  --bg-dark: #070b14;
  --card-bg: rgba(17, 24, 39, 0.8);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #22d3ee;
  --success: #10b981;
  --error: #ef4444;
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-gradient: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.05));
}

[dir="rtl"] {
  font-family: "Cairo", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Outfit", sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background Animated Blobs */
.background-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  filter: blur(100px);
  opacity: 0.3;
  border-radius: 50%;
  animation: move 25s infinite alternate ease-in-out;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -100px;
  right: -100px;
}

.blob-2 {
  width: 450px;
  height: 450px;
  background: var(--secondary);
  bottom: -100px;
  left: -100px;
  animation-delay: -5s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  top: 50%;
  left: 30%;
  animation-delay: -10s;
}

@keyframes move {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(120px, 80px) scale(1.1);
  }
}

/* Navigation */
.top-nav {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-container {
  max-width: 1200px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lang-switcher {
  background: var(--glass-border);
  padding: 0.3rem;
  border-radius: 12px;
  display: flex;
  gap: 0.3rem;
}

.lang-switcher button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.lang-switcher button.active {
  background: var(--primary);
  color: white;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--text-main);
}

/* App Layout */
.app-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.app-header {
  text-align: center;
  margin-bottom: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.logo-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.logo h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -2px;
}

.logo span {
  color: var(--primary);
}

.tagline {
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* Ad Containers */
.ad-container {
  margin: 2rem auto;
  text-align: center;
  max-width: 728px;
}

.ad-placeholder {
  background: var(--card-bg);
  border: 1px dashed var(--glass-border);
  border-radius: 1rem;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card Styling */
.converter-card {
  background: var(--card-bg);
  backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  border-radius: 2.5rem;
  padding: 3rem;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7);
  transition: all 0.4s ease;
}

/* Upload Section */
.upload-placeholder {
  text-align: center;
  cursor: pointer;
  padding: 4rem 2rem;
  border: 2px dashed var(--glass-border);
  border-radius: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-placeholder:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.icon-circle {
  width: 100px;
  height: 100px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 2rem;
  transition: all 0.4s ease;
}

.upload-placeholder:hover .icon-circle {
  transform: translateY(-12px) scale(1.1);
  background: var(--primary);
  color: white;
  box-shadow: 0 15px 30px var(--primary-glow);
}

/* Files Grid */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.file-item {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 0.8rem;
  text-align: center;
}

.file-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 0.6rem;
  margin-bottom: 0.6rem;
}

.file-item .file-name {
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.file-item .remove-file {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--error);
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.7rem;
}

/* Settings Group */
.conversion-settings {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.settings-group label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.format-options {
  display: flex;
  gap: 0.8rem;
}

.format-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  flex: 1;
  transition: all 0.3s;
}

.format-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 10px 20px var(--primary-glow);
}

/* Quality Range */
.setting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--glass-border);
  border-radius: 5px;
  appearance: none;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Privacy Toggle */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 1.5rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--glass-border);
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--primary);
}

input:checked+.slider:before {
  transform: translateX(24px);
}

.toggle-title {
  font-weight: 700;
  display: block;
  margin-bottom: 0.2rem;
}

.desc-private {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Buttons */
.convert-btn,
.download-all-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  padding: 1.5rem;
  border-radius: 1.2rem;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: all 0.3s;
  box-shadow: 0 15px 35px var(--primary-glow);
}

.convert-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 45px var(--primary-glow);
  filter: brightness(1.1);
}

/* Results List */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 1.2rem;
  border: 1px solid var(--glass-border);
}

.result-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 0.8rem;
}

.result-info {
  flex: 1;
}

.result-info h4 {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.result-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mini-download-btn {
  background: var(--success);
  color: white;
  text-decoration: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.mini-download-btn:hover {
  transform: scale(1.1);
}

/* Features Section */
.features-section {
  margin-top: 6rem;
  text-align: center;
}

.features-section h2 {
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  padding: 2.5rem;
  background: var(--card-bg);
  border-radius: 2rem;
  border: 1px solid var(--glass-border);
  transition: transform 0.3s;
}

.feature-card:hover {
  transform: translateY(-10px);
}

.feature-card i {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.feature-card h3 {
  margin-bottom: 1rem;
}

.feature-card p {
  color: var(--text-muted);
}

/* FAQ Section */
.faq-section {
  margin-top: 6rem;
}

.faq-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--card-bg);
  margin-bottom: 1rem;
  border-radius: 1.2rem;
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.faq-question {
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.faq-answer {
  padding: 0 1.5rem 1.5rem;
  color: var(--text-muted);
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
  transition: 0.3s;
}

/* Responsive */
@media (max-width: 768px) {
  .logo h1 {
    font-size: 2.5rem;
  }

  .converter-card {
    padding: 1.5rem;
  }

  .blob {
    filter: blur(50px);
    /* Reduce blur for better mobile performance */
  }

  .format-options {
    flex-wrap: wrap;
  }

  .nav-links {
    display: none;
  }
}

/* RTL Adjustments */
[dir="rtl"] .logo h1 {
  letter-spacing: 0;
}

[dir="rtl"] .convert-btn i {
  transform: rotate(180deg);
}

[dir="rtl"] .faq-question i {
  margin-right: auto;
  margin-left: 0;
}

/* Content Pages Styling */
.content-page {
  max-width: 800px;
}

.content-card {
  background: var(--card-bg);
  backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  padding: 3rem;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7);
}

.text-content h2 {
  font-size: 1.8rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.text-content h2:first-child {
  margin-top: 0;
}

.text-content p {
  margin-bottom: 1.2rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.text-content a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.text-content a:hover {
  text-decoration: underline;
}

.last-updated {
  margin-top: 3rem;
  font-size: 0.9rem;
  font-style: italic;
  opacity: 0.7;
  border-top: 1px solid var(--glass-border);
  padding-top: 1rem;
}

/* About Page Extras */
.features-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.feature-item i {
  font-size: 2rem;
  color: var(--secondary);
}

.feature-item span {
  font-weight: 600;
  color: var(--text-main);
}

/* Contact Page Extras */
.center-text {
  text-align: center;
}

.contact-box {
  background: rgba(99, 102, 241, 0.1);
  border: 1px dashed var(--primary);
  border-radius: 1.5rem;
  padding: 2rem;
  margin: 2rem auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.contact-box i {
  font-size: 2.5rem;
  color: var(--primary);
}

.contact-box a {
  font-size: 1.5rem;
}

.small-note {
  font-size: 0.9rem !important;
  opacity: 0.8;
}

.social-links {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.social-links a {
  color: var(--text-muted);
  font-size: 1.5rem;
  transition: 0.3s;
}

.social-links a:hover {
  color: var(--primary);
  transform: translateY(-3px);
}

.app-footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.3s;
}

.app-footer a:hover {
  color: var(--accent);
}

.logo-small a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  transition: color 0.3s;
}

.logo-small a:hover {
  color: var(--primary);
}