body, html, div, span, h1, h2, p, a, form, input, button, textarea, select {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

html[lang="ar"],
html[lang="ur"] {
  direction: rtl;
}

body { background-color: #ddf6ca; color: #fff; line-height: 1.6; }
header { 
  padding: 12px; 
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1); 
  display: flex; 
  align-items: center; 
  gap: 20px;
  flex-wrap: wrap; 
}
header .logo { 
  font-size: 28px; 
  font-weight: 900;
  flex-shrink: 0;
}

/* Language Picker Dropdown with globe icon and flag emojis */
.language-picker {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #000;
}
.language-picker label {
  margin-right: 6px;
}
.language-picker select {
  padding: 4px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

main { padding: 12px; background-color: #fff; color: #000; }
section { margin-bottom: 16px; }
textarea { width: 100%; min-height: 220px; padding: 4px; margin-bottom: 8px; background: #eee; }
.option { margin-bottom: 8px; }
button { background: #275900; color: #fff; padding: 6px 12px; cursor: pointer; }
a.download-link { background: #28a745; color: #fff; padding: 6px 12px; text-decoration: none; display: inline-block; }
footer { padding: 8px; text-align: justify; background: #275900; margin-top: 16px; }

/* File Dropzone Styles */
.file-dropzone {
  border: 2px dashed #ccc;
  border-radius: 4px;
  padding: 20px;
  text-align: center;
  background-color: #f9f9f9;
  color: #333;
  cursor: pointer;
  margin-bottom: 10px;
  position: relative;
}
.file-dropzone:hover { background-color: #f0f0f0; }

/* Wrap the dropzone text in a span */
.file-dropzone .file-dropzone-text {
  display: inline-block;
}
.file-dropzone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Progress bar styling */
#file-progress { margin-bottom: 10px; }
#file-progress progress { width: 100%; }

/* Layout with sidebar */
.content-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.ad-left {
  position: static;
  width: 160px;
  min-height: 600px;
  background: #f5f5f5;
  margin-top: 20px;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  min-width: 0; /* Prevents flex item from overflowing */
}

.sidebar {
  width: 340px;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 4px;
  flex-shrink: 0;
}

.sidebar h3 {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #439a00;
  color: #275900;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 8px;
}

.sidebar a {
  color: #275900;
  text-decoration: none;
  display: block;
  padding: 4px 0;
}

.sidebar a:hover {
  color: #439a00;
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .content-wrapper {
    justify-content: flex-start;
  }
  
  .main-content {
    flex: 1;
    order: 1;
  }
  
  .ad-left {
    order: 0;
  }
  
  .sidebar {
    width: 100%;
    order: 2;
  }
}

@media (max-width: 512px) {
  .ad-left {
    display: none;
  }
  
  .main-content {
    width: 100%;
  }
}

/* Advanced Options Section */
#advanced-options {
  margin-top: 24px;
}

#advanced-options .container {
  max-width: 1024px;
  margin: 0 auto;
}

#advanced-options .option {
  margin-bottom: 24px;
}

#advanced-options h3 {
  color: #275900;
  margin-bottom: 8px;
}

#advanced-options p {
  line-height: 1.6;
}

#advanced-options .note {
  padding: 12px;
  background: #f5f5f5;
  border-left: 4px solid #439a00;
  margin-top: 24px;
}

/* Base64 Information Section */
#base64-information {
  margin-top: 24px;
}

#base64-information .container {
  max-width: 1024px;
  margin: 0 auto;
}

#base64-information h3 {
  color: #275900;
  margin: 24px 0 12px;
}

#base64-information p {
  margin-bottom: 16px;
  line-height: 1.6;
}

#base64-information ul,
#base64-information ol {
  margin: 16px 0;
  padding-left: 24px;
}

#base64-information li {
  margin-bottom: 8px;
  line-height: 1.5;
}

#base64-information code {
  background: #f5f5f5;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}

/* Section Divider */
.section-divider {
  max-width: 1024px;
  margin: 32px auto;
  border: none;
  border-top: 1px solid #ddd;
}

/* Form Sections Styling */
#text-encoding,
#file-encoding {
  max-width: 1024px;
  margin: 0 auto 32px;
}

#text-encoding h1,
#file-encoding h2 {
  color: #275900;
  margin-bottom: 16px;
}

/* Form elements styling */
textarea {
  width: 100%;
  min-height: 220px;
  padding: 0px;
  margin-bottom: 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: monospace;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: #439a00;
  background: #fff;
}

.info {
  display: block;
  color: #666;
  font-size: 14px;
  margin-bottom: 16px;
}

/* Options styling */
.encoding-options {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 20px;
}

.option {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.option:last-child {
  margin-bottom: 0;
}

.option label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.option select {
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #333;
}

.option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 8px;
}

.option h5 {
  margin-right: 8px;
  min-width: 70px;
}

/* Button styling */
button {
  background: #275900;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}

button:hover {
  background: #439a00;
}

button.live {
  background: #666;
}

button.live:hover {
  background: #888;
}

button.live-mode {
  background: #275900;
}

button.live-mode:hover {
  background: #92ad7e;
}

button.copy {
  background: #28a745;
}

button.copy:hover {
  background: #218838;
}

/* File dropzone enhancement */
.file-dropzone {
  border: 2px dashed #ccc;
  border-radius: 4px;
  padding: 24px;
  text-align: center;
  background-color: #f9f9f9;
  color: #666;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.file-dropzone:hover {
  border-color: #439a00;
  background-color: #f0f0f0;
  color: #275900;
}

/* Progress bar enhancement */
#file-progress {
  margin: 16px 0;
}

#file-progress progress {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

#file-progress progress::-webkit-progress-bar {
  background-color: #f0f0f0;
}

#file-progress progress::-webkit-progress-value {
  background-color: #439a00;
}

/* Success and error messages */
#file-success,
#file-error {
  padding: 12px;
  border-radius: 4px;
  margin-top: 16px;
}

#file-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

#file-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.download-link {
  display: inline-block;
  background: #28a745;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  margin-top: 8px;
  transition: background-color 0.2s;
}

.download-link:hover {
  background: #218838;
} 

.wrapper { 
  padding: 20px; 
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.content-wrapper { display: flex; gap: 30px; }
.main-content { flex: 1; }
footer { 
  background: #f5f5f5; 
  padding: 20px;
  margin-top: 40px;
  border-top: 1px solid #e0e0e0;
  color: #666;
}
footer a { color: #4a90e2; }
#privacy-policy {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Ad placements */
.ad_top {
  display: block;
  width: 100%;
  height: 90px;
  background: #f5f5f5;
  margin: 20px 0;
}

.ad-nav-top,
.ad-nav-bottom {
  width: 336px;
  height: 280px;
  background: #f5f5f5;
  margin: 20px 0;
}

/* Logo and Navigation */
.logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #275900;
  line-height: 1.2;
}

.logo-line {
  display: block;
}

.logo-line:first-child {
  font-size: 1.5em;
  font-weight: bold;
}

.main-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  gap: 0px;
}

.nav-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #275900;
  padding: 10px;
  margin: 5px 0;
  width: 100%;
  transition: background-color 0.2s;
}

.nav-link i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

.nav-link:hover {
  background-color: #f0f0f0;
}

.nav-link.active {
  background-color: #275900;
  color: white;
  border-radius: 4px;
}
