/* CSS Reset and Base Styles */
:root {
  --primary-color: #6d28d9;
  --primary-dark: #5b21b6;
  --secondary-color: #f59e0b;
  --dark-color: #1e293b;
  --light-color: #f8fafc;
  --gray-color: #94a3b8;
  --danger-color: #ef4444;
  --success-color: #10b981;
  --border-radius: 12px;
  --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', sans-serif;
  background-color: #f1f5f9;
  color: var(--dark-color);
  line-height: 1.6;
  direction: rtl;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container Styles */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  flex: 1;
}

/* Header Styles */
.app-header {
  padding: 20px 0;
  margin-bottom: 30px;
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--box-shadow);
  border: 3px solid white;
  transition: var(--transition);
}

.logo:hover {
  transform: scale(1.05);
}

.title-container h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.subtitle {
  color: var(--gray-color);
  font-size: 0.9rem;
}

/* Main Content Styles */
main {
  margin-bottom: 50px;
}

/* Input Section Styles */
.input-section {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
}

.prompt-wrapper {
  position: relative;
}

#promptInput {
  width: 100%;
  min-height: 150px;
  padding: 15px;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius);
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  resize: none;
  transition: var(--transition);
  margin-bottom: 20px;
}

#promptInput:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.2);
}

#promptInput::placeholder {
  color: var(--gray-color);
  opacity: 0.7;
}

.generation-options {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: space-between;
  align-items: center;
}

.model-selection {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-selection label {
  font-weight: 500;
  color: var(--dark-color);
}

.model-select {
  padding: 10px 15px;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius);
  font-family: 'Tajawal', sans-serif;
  background-color: white;
  cursor: pointer;
  transition: var(--transition);
}

.model-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.action-buttons {
  display: flex;
  gap: 10px;
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: var(--border-radius);
  font-family: 'Tajawal', sans-serif;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

button i {
  font-size: 0.9rem;
}

.primary {
  background-color: var(--primary-color);
  color: white;
}

.primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.secondary {
  background-color: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.secondary:hover {
  background-color: #f5f3ff;
}

/* Image Section Styles */
.image-section {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
}

.image-container {
  width: 100%;
  min-height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px dashed #e2e8f0;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
}

.placeholder {
  text-align: center;
  color: var(--gray-color);
  padding: 20px;
}

.placeholder i {
  font-size: 3rem;
  margin-bottom: 15px;
  color: #e2e8f0;
}

.placeholder p {
  font-size: 1.1rem;
}

#generatedImage {
  max-width: 100%;
  max-height: 600px;
  object-fit: contain;
  border-radius: var(--border-radius);
  display: none;
}

/* Image Actions Styles */
.image-actions {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
}

.action-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: space-between;
}

.action-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 10px 15px;
  font-size: 0.9rem;
}

.danger {
  background-color: var(--danger-color);
  color: white;
}

.danger:hover {
  background-color: #dc2626;
  transform: translateY(-2px);
}

.download {
  background-color: var(--success-color);
  color: white;
}

.download:hover {
  background-color: #059669;
  transform: translateY(-2px);
}

/* Features Section Styles */
.features-section {
  margin-bottom: 50px;
}

.section-title {
  text-align: center;
  font-size: 1.8rem;
  color: var(--dark-color);
  margin-bottom: 30px;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 50%;
  transform: translateX(50%);
  width: 80px;
  height: 3px;
  background-color: var(--primary-color);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}

.feature-card {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 30px;
  text-align: center;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  width: 70px;
  height: 70px;
  background-color: #ede9fe;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 20px;
}

.feature-icon i {
  font-size: 1.8rem;
  color: var(--primary-color);
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--dark-color);
}

.feature-card p {
  color: var(--gray-color);
  font-size: 0.95rem;
}

/* Footer Styles */
.app-footer {
  background-color: var(--dark-color);
  color: white;
  padding: 30px 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  color: white;
  font-size: 1.2rem;
  transition: var(--transition);
}

.social-links a:hover {
  color: var(--secondary-color);
  transform: translateY(-2px);
}

/* Loading State */
.loading {
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--border-radius);
}

/* Accessibility Styles */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .logo-container {
    flex-direction: column;
    text-align: center;
  }
  
  .generation-options {
    flex-direction: column;
    align-items: stretch;
  }
  
  .model-selection {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .action-buttons {
    width: 100%;
  }
  
  button {
    flex: 1;
    justify-content: center;
  }
  
  .action-groups {
    flex-direction: column;
  }
  
  .action-group {
    justify-content: center;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .input-section, .image-section, .image-actions {
    padding: 20px;
  }
  
  #promptInput {
    min-height: 120px;
  }
  
  .image-container {
    min-height: 300px;
  }
  
  .feature-card {
    padding: 20px;
  }
}

/* Animation Effects */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
  }
