/* Base Styles */
:root {
  --primary-color: #4f46e5;
  --secondary-color: #7c3aed;
  --accent-color: #8b5cf6;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --bg-primary: #f9fafb;
  --bg-secondary: #f3f4f6;
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease-in-out;
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'IBM Plex Sans Arabic', 'IBM Plex Sans', sans-serif;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  direction: rtl;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
}

/* Header Styles */
.creation-header {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo img {
  height: 40px;
  width: auto;
}

/* Progress Steps */
.progress-steps {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 80px;
  opacity: 0.5;
  transition: var(--transition);
}

.step.active {
  opacity: 1;
}

.step::after {
  content: '';
  position: absolute;
  top: 20px;
  right: calc(100% + 0.5rem);
  width: 1.5rem;
  height: 2px;
  background-color: var(--text-secondary);
  opacity: 0.3;
}

.step:first-child::after {
  display: none;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.step.active .step-number {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.step-label {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Creation Wrapper */
.creation-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  margin-top: 1rem;
}

/* Preview Section */
.preview-section {
  position: relative;
  height: calc(100vh - 200px);
  min-height: 600px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.device-mockup {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.device {
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: white;
  position: relative;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
}

.preview-placeholder i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  opacity: 0.7;
}

/* Wizard Section */
.wizard-section {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  height: calc(100vh - 200px);
  min-height: 600px;
  overflow-y: auto;
}

.wizard-step {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.wizard-step.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  background-color: #f9fafb;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Logo Upload */
.logo-upload-container {
  margin-top: 1rem;
}

.logo-preview {
  border: 2px dashed #e5e7eb;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  background-color: #f9fafb;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-preview:hover {
  border-color: var(--primary-color);
  background-color: #f3f4f6;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
}

.upload-placeholder i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

#logo-preview {
  max-width: 100%;
  max-height: 140px;
  border-radius: 4px;
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: rgba(79, 70, 229, 0.05);
}

.btn-next {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 0.75rem 2rem;
  margin-right: auto;
}

.btn-prev {
  background: #f3f4f6;
  color: var(--text-secondary);
  margin-left: 1rem;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  background: var(--text-primary);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease-in-out;
  z-index: 1000;
  max-width: 350px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .creation-wrapper {
    grid-template-columns: 1fr;
  }
  
  .preview-section,
  .wizard-section {
    height: auto;
    min-height: auto;
  }
  
  .wizard-section {
    margin-top: 2rem;
  }
}

@media (max-width: 640px) {
  .creation-header {
    flex-direction: column;
    text-align: center;
  }
  
  .progress-steps {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
  }
  
  .step {
    min-width: 60px;
  }
  
  .step::after {
    display: none;
  }
  
  .form-actions {
    flex-direction: column-reverse;
    gap: 1rem;
  }
  
  .btn-next,
  .btn-prev {
    width: 100%;
    margin: 0;
  }
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Template Grid */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.template-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  background: white;
}

.template-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.template-preview {
  height: 150px;
  background: #f3f4f6;
  position: relative;
  overflow: hidden;
}

.template-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-info {
  padding: 1rem;
  text-align: center;
}

.template-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.template-select-btn {
  width: 100%;
  padding: 0.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.template-select-btn:hover {
  background: var(--secondary-color);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}
