@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');

/* Base Styles */
body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  direction: rtl;
}

/* Header Styles */
.main-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 15px 0;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.language-toggle {
  display: flex;
  align-items: center;
}

.language-button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.language-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.logo img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.logo img:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.site-title h1 {
  color: white;
  margin: 0;
  font-size: 1.8em;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.site-tagline {
  color: rgba(255, 255, 255, 0.9);
  margin: 5px 0 0 0;
  font-size: 0.9em;
  font-weight: 400;
}

/* Navigation Styles */
.main-navigation {
  flex: 2;
  display: flex;
  justify-content: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 10px;
  align-items: center;
}

.nav-menu li {
  position: relative;
}

.nav-link {
  display: block;
  padding: 12px 20px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 1em;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: right 0.5s;
}

.nav-link:hover::before {
  right: 100%;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
  padding: 8px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover span {
  background: rgba(255, 255, 255, 0.8);
}

.container {
  max-width: 1100px;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 25px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 30px;
  font-size: 2.2em;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Form Sections */
.form-section {
  background: rgba(255, 255, 255, 0.8);
  padding: 25px;
  border-radius: 20px;
  margin: 20px 0;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.section-title {
  color: #2c3e50;
  margin: 0 0 20px 0;
  font-size: 1.3em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Form Elements */
input, select {
  width: 100%;
  padding: 15px;
  margin: 8px 0;
  border-radius: 12px;
  border: 2px solid #e1e8ed;
  font-size: 16px;
  font-family: 'Cairo', sans-serif;
  transition: all 0.3s ease;
  background: #fff;
}

input:focus, select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

button:hover::before {
  left: 100%;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Prominent Convert Buttons */
.primary-convert-btn, .batch-convert-btn {
  padding: 20px 40px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  border-radius: 15px !important;
  margin: 15px 10px !important;
  min-height: 60px !important;
  position: relative !important;
  overflow: hidden !important;
  animation: pulse 2s infinite !important;
}

.primary-convert-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #ff9ff3 100%) !important;
  box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.batch-convert-btn {
  background: linear-gradient(135deg, #26de81 0%, #20bf6b 50%, #0fb9b1 100%) !important;
  box-shadow: 0 10px 30px rgba(38, 222, 129, 0.4) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.primary-convert-btn:hover, .batch-convert-btn:hover {
  transform: translateY(-5px) scale(1.02) !important;
  box-shadow: 0 15px 40px rgba(0,0,0,0.2) !important;
  animation: none !important;
}

.primary-convert-btn::after, .batch-convert-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

/* Drop Zone */
.drop-zone {
  border: 3px dashed #667eea;
  padding: 40px;
  text-align: center;
  color: #667eea;
  margin-bottom: 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '📸';
  font-size: 3em;
  position: absolute;
  top: -50px;
  right: 20px;
  opacity: 0.1;
  transition: all 0.3s ease;
}

.drop-zone:hover::before {
  top: 20px;
  opacity: 0.2;
}

.drop-zone:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-color: #764ba2;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.drop-zone.dragover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  border-color: #764ba2;
  color: #764ba2;
}

/* Layout Components */
.upload-info {
  font-size: 13px;
  color: #666;
  margin: 8px 0;
  text-align: center;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
}

.size-inputs {
  display: flex;
  gap: 15px;
  margin: 15px 0;
}

.size-inputs > div {
  flex: 1;
  position: relative;
}

.size-inputs label {
  display: block;
  margin-bottom: 8px;
  color: #2c3e50;
  font-weight: 500;
  font-size: 0.9em;
}

/* Progress Bar */
#progressBar {
  width: 100%;
  height: 25px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  margin: 20px 0;
  display: none;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

#progressBar div {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  transition: width 0.4s ease;
  position: relative;
}

#progressBar div::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

/* Preview Container */
.preview-container {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.preview-container img {
  width: 160px;
  height: auto;
  border: 2px solid rgba(255, 255, 255, 0.8);
  padding: 8px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.preview-container img:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.preview-container > div:hover img {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Instructions */
.instructions {
  font-size: 16px;
  color: #2c3e50;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 15px;
  border-right: 4px solid #667eea;
  font-weight: 500;
}

/* Rotation Controls */
.rotation-controls {
  margin: 25px 0;
  padding: 25px;
  background: linear-gradient(135deg, rgba(108, 117, 125, 0.1) 0%, rgba(90, 98, 104, 0.1) 100%);
  border-radius: 20px;
  border: 1px solid rgba(108, 117, 125, 0.2);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.rotation-controls label {
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 20px;
  display: block;
  font-size: 1.1em;
}

.rotation-controls button {
  margin: 8px 12px 8px 0;
  padding: 12px 20px;
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  font-size: 14px;
}

.rotation-controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.rotation-controls button:last-child {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  margin-right: 0;
}

.rotation-controls button:last-child:hover {
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

/* Batch Controls */
.batch-controls {
  margin: 20px 0;
  padding: 20px;
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
  border-radius: 15px;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

/* Crop Options */
.crop-options {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.crop-options label {
  margin-right: 20px;
  font-weight: 500;
  color: #2c3e50;
  cursor: pointer;
}

.crop-position {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.crop-position label {
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}

.crop-position select {
  padding: 12px;
  border-radius: 10px;
  border: 2px solid #e1e8ed;
  font-size: 16px;
  font-family: 'Cairo', sans-serif;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.crop-position select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Social Share */
.social-share {
  margin: 30px 0;
  padding: 30px;
  background: linear-gradient(135deg, rgba(248, 249, 250, 0.9) 0%, rgba(248, 249, 250, 0.7) 100%);
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.social-share h3 {
  color: #2c3e50;
  margin-bottom: 25px;
  font-size: 1.3em;
  font-weight: 600;
}

.share-buttons {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.facebook-btn {
  background: linear-gradient(135deg, #1877f2 0%, #166fe5 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(24, 119, 242, 0.3);
}

.twitter-btn {
  background: linear-gradient(135deg, #1da1f2 0%, #1991db 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(29, 161, 242, 0.3);
}

.instagram-btn {
  background: linear-gradient(135deg, #e4405f 0%, #d63384 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(228, 64, 95, 0.3);
}

.share-buttons button {
  padding: 15px 30px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  font-size: 16px;
  min-width: 120px;
}

.share-buttons button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.share-buttons button:hover::before {
  width: 300px;
  height: 300px;
}

.share-buttons button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Features Section */
.features-section {
  text-align: center;
  margin-top: 50px;
  padding: 50px 40px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border-radius: 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(40, 167, 69, 0.3);
}

.features-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

.features-section h2 {
  margin-bottom: 40px;
  color: white;
  font-size: 2em;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  position: relative;
  z-index: 2;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin: 40px 0;
  position: relative;
  z-index: 2;
}

.feature-item {
  background: rgba(255, 255, 255, 0.15);
  padding: 30px 25px;
  border-radius: 20px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.feature-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-item:hover::before {
  opacity: 1;
}

.feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.2);
  background: rgba(255, 255, 255, 0.2);
}

.feature-item h3 {
  margin: 0 0 15px 0;
  font-size: 1.3em;
  font-weight: 600;
  color: white;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.feature-item p {
  margin: 0;
  opacity: 0.95;
  font-size: 1em;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.stats {
  margin-top: 40px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 2;
}

.stats p {
  margin: 15px 0;
  font-size: 1.2em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Animations */
@keyframes pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4); }
  50% { box-shadow: 0 15px 40px rgba(255, 107, 107, 0.6); }
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-header {
    padding: 12px 0;
  }

  .header-container {
    padding: 0 15px;
    gap: 15px;
  }

  .logo img {
    width: 40px;
    height: 40px;
  }

  .site-title h1 {
    font-size: 1.4em;
  }

  .site-tagline {
    font-size: 0.8em;
  }

  .main-navigation {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1000;
  }

  .main-navigation.active {
    display: block;
  }

  .nav-menu {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 15px 20px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .container {
    margin: 10px;
    padding: 25px;
  }

  h1 {
    font-size: 1.8em;
  }

  .size-inputs {
    flex-direction: column;
  }

  .share-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .share-buttons button {
    width: 100%;
    max-width: 200px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .rotation-controls {
    padding: 20px;
  }

  .rotation-controls button {
    width: 100%;
    margin: 8px 0;
    padding: 15px;
  }

  .drop-zone {
    padding: 30px 20px;
  }

  .preview-container {
    padding: 15px;
    justify-content: center;
  }

  .preview-container img {
    width: 140px;
  }
}

@media (max-width: 480px) {
  .main-header {
    padding: 10px 0;
  }

  .header-container {
    padding: 0 10px;
    gap: 10px;
  }

  .logo img {
    width: 35px;
    height: 35px;
  }

  .site-title h1 {
    font-size: 1.2em;
  }

  .site-tagline {
    font-size: 0.75em;
  }

  .main-navigation {
    padding: 15px;
  }

  .nav-link {
    padding: 12px 15px;
    font-size: 0.9em;
  }

  .container {
    margin: 5px;
    padding: 20px;
  }

  h1 {
    font-size: 1.5em;
  }

  .features-section {
    padding: 30px 20px;
  }

  .social-share {
    padding: 20px;
  }

  .form-section {
    padding: 20px;
  }
}