body {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;

}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h2{
    font-size: 24px;
    text-align: center;
}

/* styles.css */

.icon-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin: 40px;
}

.icon-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    margin: 10px;
}

.app-icon {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.checkmark {
    display: none; 
    font-size: 24px; /* حجم العلامة */
    color: green; /* لون العلامة */
    position: absolute;
    top: -10px; /* وضع العلامة أعلى الأيقونة */
    right: -10px; /* وضع العلامة إلى يمين الأيقونة */
}

.checkmark-icon {
    display: none; 
    font-size: 24px; /* حجم العلامة */
    color: green; /* لون العلامة */
    position: absolute;
    top: -10px; /* وضع العلامة أعلى الأيقونة */
    right: -10px; /* وضع العلامة إلى يمين الأيقونة */
}

.icon-container.selected .app-icon {
    transform: scale(1.1); /* تكبير الأيقونة المختارة */
    border: 2px solid #007bff; /* إضافة حدود للأيقونة المختارة */
}

.icon-container.selected .checkmark {
    display: inline; /* عرض العلامة عند اختيار الأيقونة */
}

.icon-container.selected .checkmark-icon {
    display: inline; /* عرض العلامة عند اختيار الأيقونة */
}

.template-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.card {
    width: 300px;
    border: 1px solid #ccc;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    position: relative;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: scale(1.02);
}

/* نمط القالب المختار */
.card.selected {
    border: 3px solid #007bff; /* حدود زرقاء */
    background-color: #f0f8ff; /* خلفية فاتحة */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* تأثير ظل */
    transform: scale(1.05); /* تكبير القالب المختار */
}

.checkmark {
    display: none;
    color: green;
    font-size: 48px;
    position: absolute;
    top: 10px;
    right: 10px;
    font-weight: bold;
    
}

.card.selected .checkmark {
    display: inline;
    
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    overflow-x: auto;
    gap: 5px;
    padding: 10px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ccc;
}

.tab-btn {
    padding: 10px 15px;
    border: none;
    background-color: #2c3e50; /* رمادي داكن */
    color: #ecf0f1; /* أبيض رمادي فاتح */
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 6px;
    transition: background-color 0.2s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-btn:hover {
    background-color: #34495e; /* داكن أكتر عند الهوفر */
    transform: scale(1.03);
}

.tab-btn.active {
    background-color: #16a085; /* أخضر داكن للتبويب النشط */
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* تخصيص المعاينة */
.customization-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.control-panel {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.phone-preview {
    position: relative;
    background: #1a1a1a;
    border-radius: 30px;
    padding: 20px;
}

.phone-frame {
    width: 375px;
    height: 812px;
    background: #000000;
    border-radius: 40px;
    padding: 10px;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

#previewFrame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 30px;
}

/* تحسينات التفاعل */
input[type="color"] {
    padding: 0;
    border: none;
    width: 50px;
    height: 50px;
    cursor: pointer;
}

input, textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

button {
    background-color: #145a32; /* أخضر داكن */
    color: white;
    padding: 12px 24px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

button:hover {
    background-color:#1e8449 ; /* أغمق شوية عند الـ hover */
    transform: translateY(-2px);
}

.phone-preview {
    position: relative;
    width: 100%;
    height: 812px; /* ارتفاع الجهاز الافتراضي */
    perspective: 1000px; /* إضافة عمق للتدوير */
    display: flex;
    justify-content: center; /* توسيط أفقي */
    align-items: center; /* توسيط عمودي */
}

.phone-frame {
    width: 375px;
    height: 812px;
    transition: all 0.3s;
    transform-style: preserve-3d; /* الحفاظ على الأبعاد الثلاثية */
    position: relative;
}

.phone-frame.landscape {
    transform: rotate(-0deg) translateY(-0%);
    transform-origin: center;
    width: 812px;
    height: 375px;
    margin-top: (812 - 375)/2; /* (812 - 375)/2 للتوسيط الرأسي */
    align-items: center;
    justify-content: center;
}

/* تصميم الخيارات */
.option-selector {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
}

.option-selector label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.option-selector input[type="radio"] {
    margin-left: 5px;
}

/* تصميم الحقول */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

textarea#customHtml {
    width: 100%;
    height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: monospace;
    resize: vertical;
}

/* في styles.css */
.loading, .error {
    padding: 20px;
    text-align: center;
    font-size: 18px;
  }
  
  .loading {
    color: #007bff;
  }
  
  .error {
    color: #dc3545;
  }

  .webview {
    left: 0px !important;

    margin-left: 280px !important;
    width: calc(100% - 280px) !important;
    height: 100vh !important;
    border: none !important;
    position: absolute !important;
    top: 0 !important;
}

#progress {
    margin-top: 20px;
    font-size: 16px;
    color: #f0b429;
}
#download-button {
    display: none;
    margin-top: 20px;
}
#error-message {
    display: none;
    color: red;
    margin-top: 20px;
}



#loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    padding: 20px;
    color: white;
    border-radius: 5px;
}

#downloadLink {
    display: none;
    padding: 12px 25px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 15px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.next-btn {
    display: block;
    margin: 30px auto;
    padding: 12px 24px;
    font-size: 1rem;
    background-color: #145a32;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
  }
  
  .next-btn:hover {
    background-color: #145a32;
  }

@media (orientation: landscape) {
    .sidebar {
        position: absolute;
        top: 60px;
        left: 0;
        width: 280px;
    }
    
    .webview {
        left: 0;
        margin-left: 0 !important;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .card {
      width: 100%;
    }
  
    h2 {
      font-size: 1.2rem;
    }
  
    .next-btn {
      width: 100%;
      font-size: 1rem;
    }

}