:root {
--a4-width: 210mm;
--a4-height: 297mm;
--a4-width-px: 794px;
--a4-height-px: 1123px;
--canvas-width: 297mm; /* Default landscape A4 */
--canvas-height: 210mm; /* Default landscape A4 */
--px-to-mm: 3.7795275591; /* Precise conversion factor */
}
* {
box-sizing: border-box;
}
body {
font-family: 'Cairo', sans-serif;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #f9fafb;
}
.arabic-font {
font-family: 'Cairo', sans-serif;
}
.design-canvas {
width: var(--canvas-width, 297mm);
height: var(--canvas-height, 210mm);
box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
background: white;
position: relative;
overflow: hidden;
margin: 0 auto;
transition: all 0.3s ease;
transform-origin: center center;
}
.design-element {
position: absolute;
cursor: move;
user-select: none;
transition: box-shadow 0.2s;
z-index: 10;
}
.design-element:hover {
box-shadow: 0 0 0 2px #3b82f6;
}
.design-element.selected {
box-shadow: 0 0 0 2px #3b82f6;
z-index: 100;
}
.design-element.selected::after {
content: '';
position: absolute;
top: -4px;
left: -4px;
right: -4px;
bottom: -4px;
border: 1px dashed #3b82f6;
pointer-events: none;
z-index: 1;
}
.text-element {
padding: 4px;
min-width: 50px;
min-height: 20px;
white-space: pre-wrap;
word-wrap: break-word;
}
.text-element.editing {
outline: 2px solid #3b82f6;
background: rgba(59, 130, 246, 0.05);
}
.resize-handle {
position: absolute;
width: 16px;
height: 16px;
background: #3b82f6;
border: 3px solid white;
border-radius: 50%;
cursor: nwse-resize;
bottom: -8px;
right: -8px;
opacity: 0;
transition: opacity 0.2s;
z-index: 2;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.design-element.selected .resize-handle {
opacity: 1;
}
.resize-handle:hover {
background: #2563eb;
transform: scale(1.1);
}
.delete-btn {
position: absolute;
top: -12px;
right: -12px;
width: 24px;
height: 24px;
background: #ef4444;
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0;
transition: opacity 0.2s;
font-size: 14px;
z-index: 3;
}
.design-element.selected .delete-btn {
opacity: 1;
}
.sidebar-item {
transition: all 0.2s;
cursor: pointer;
}
.sidebar-item:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.rtl {
direction: rtl;
text-align: right;
}
.ltr {
direction: ltr;
text-align: left;
}
.font-preview {
font-size: 14px;
padding: 8px;
border: 1px solid #e5e7eb;
border-radius: 4px;
cursor: pointer;
transition: all 0.2s;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.font-preview:hover {
border-color: #3b82f6;
background: #eff6ff;
}
.color-picker-wrapper {
position: relative;
}
.color-picker {
position: absolute;
top: 100%;
left: 0;
z-index: 50;
background: white;
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 16px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
display: none;
width: 280px;
}
.color-picker.show {
display: block;
}
.color-presets {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 8px;
margin-bottom: 16px;
}
.color-preset {
width: 32px;
height: 32px;
border-radius: 4px;
cursor: pointer;
border: 2px solid transparent;
transition: all 0.2s;
}
.color-preset:hover {
transform: scale(1.1);
border-color: #d1d5db;
}
.color-preset.active {
border-color: #3b82f6;
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}
.custom-color-section {
margin-top: 16px;
}
.custom-color-input {
width: 100%;
height: 40px;
border: 1px solid #d1d5db;
border-radius: 4px;
cursor: pointer;
}
.color-value-display {
margin-top: 8px;
padding: 8px;
background: #f3f4f6;
border-radius: 4px;
font-family: monospace;
font-size: 14px;
text-align: center;
}
.template-card {
transition: all 0.2s;
cursor: pointer;
}
.template-card:hover {
transform: translateY(-2px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.excel-preview {
max-height: 300px;
overflow-y: auto;
}
.excel-preview table {
width: 100%;
border-collapse: collapse;
}
.excel-preview th, .excel-preview td {
border: 1px solid #e5e7eb;
padding: 8px;
text-align: left;
}
.excel-preview th {
background: #f9fafb;
font-weight: 600;
}
.progress-bar {
transition: width 0.3s ease;
}
.background-element {
position: absolute !important;
top: 0 !important;
left: 0 !important;
width: 100% !important;
height: 100% !important;
z-index: 1 !important;
}
.background-element img {
width: 100% !important;
height: 100% !important;
object-fit: cover !important;
}
.certificate-container {
position: relative;
background: white;
overflow: hidden;
}
/* Enhanced font styles */
.font-inter { font-family: 'Inter', sans-serif; }
.font-cairo { font-family: 'Cairo', sans-serif; }
.font-playfair { font-family: 'Playfair Display', serif; }
.font-dancing { font-family: 'Dancing Script', cursive; }
.font-tajawal { font-family: 'Tajawal', sans-serif; }
.font-amiri { font-family: 'Amiri', serif; }
.font-markazi { font-family: 'Markazi Text', serif; }
.font-scheherazade { font-family: 'Scheherazade', serif; }
/* Language Dropdown Styles */
.lang-dropdown {
position: relative;
display: inline-block;
}
.lang-dropdown-content {
display: none;
position: absolute;
background-color: white;
min-width: 120px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1001;
border-radius: 0.375rem;
overflow: hidden;
margin-top: 0.25rem;
}
.lang-dropdown:hover .lang-dropdown-content {
display: block;
}
.lang-dropdown-content a {
color: #4b5563;
padding: 8px 12px;
text-decoration: none;
display: block;
transition: background-color 0.2s;
}
.lang-dropdown-content a:hover {
background-color: #f3f4f6;
}
.lang-btn {
background-color: rgba(255, 255, 255, 0.2);
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 0.375rem;
padding: 0.375rem 0.75rem;
font-size: 0.875rem;
font-weight: 500;
color: white;
display: flex;
align-items: center;
transition: all 0.2s;
}
.lang-btn:hover {
background-color: rgba(255, 255, 255, 0.3);
}
/* Header Styles */
.header-gradient {
background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
}
/* Button Styles */
.btn {
padding: 0.5rem 1rem;
border-radius: 0.375rem;
font-weight: 500;
transition: all 0.2s;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid transparent;
white-space: nowrap;
}
.btn-primary {
background-color: rgba(255, 255, 255, 0.2);
color: white;
border: 1px solid rgba(255, 255, 255, 0.3);
}
.btn-primary:hover {
background-color: rgba(255, 255, 255, 0.3);
}
.btn-secondary {
background-color: #f3f4f6;
color: #4b5563;
border: 1px solid #d1d5db;
}
.btn-secondary:hover {
background-color: #e5e7eb;
color: #374151;
}
.btn-secondary.active {
background-color: #4f46e5;
color: white;
border-color: #4f46e5;
}
.btn-success {
background-color: rgba(16, 185, 129, 0.8);
color: white;
border: 1px solid rgba(16, 185, 129, 0.9);
}
.btn-success:hover {
background-color: rgba(16, 185, 129, 0.9);
}
.btn-purple {
background-color: rgba(139, 92, 246, 0.8);
color: white;
border: 1px solid rgba(139, 92, 246, 0.9);
}
.btn-purple:hover {
background-color: rgba(139, 92, 246, 0.9);
}
.btn-blue {
background-color: rgba(59, 130, 246, 0.8);
color: white;
border: 1px solid rgba(59, 130, 246, 0.9);
}
.btn-blue:hover {
background-color: rgba(59, 130, 246, 0.9);
}
.btn-green {
background-color: rgba(16, 185, 129, 0.8);
color: white;
border: 1px solid rgba(16, 185, 129, 0.9);
}
.btn-green:hover {
background-color: rgba(16, 185, 129, 0.9);
}
/* Main layout */
.main-container {
display: flex;
height: calc(100vh - 4rem);
}
.canvas-area {
flex: 1;
overflow: auto;
background: #f9fafb;
padding: 2rem;
}
.sidebar {
width: 320px;
background: white;
overflow-y: auto;
}
.sidebar.ltr {
border-left: 1px solid #e5e7eb;
border-right: none;
}
.sidebar.rtl {
border-right: 1px solid #e5e7eb;
border-left: none;
}
/* RTL/LTR adjustments */
[dir="rtl"] .main-container {
flex-direction: row-reverse;
}
[dir="rtl"] .btn i {
margin-left: 0.5rem;
margin-right: 0;
}
[dir="ltr"] .btn i {
margin-right: 0.5rem;
margin-left: 0;
}
/* Modal styles */
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.modal-content {
background: white;
border-radius: 0.5rem;
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
max-width: 90%;
max-height: 90vh;
overflow: hidden;
}
/* Notification styles */
.notification {
position: fixed;
top: 1rem;
right: 1rem;
padding: 1rem 1.5rem;
border-radius: 0.5rem;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
z-index: 1002;
animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
from {
transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
.notification.success {
background-color: #10b981;
color: white;
}
.notification.error {
background-color: #ef4444;
color: white;
}
/* File input styling */
.file-input-wrapper {
position: relative;
overflow: hidden;
display: inline-block;
}
.file-input-wrapper input[type=file] {
position: absolute;
left: -9999px;
}
.file-input-label {
padding: 0.5rem 1rem;
border-radius: 0.375rem;
font-weight: 500;
transition: all 0.2s;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid transparent;
white-space: nowrap;
cursor: pointer;
background-color: rgba(255, 255, 255, 0.1);
color: white;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.file-input-label:hover {
background-color: rgba(255, 255, 255, 0.2);
}
/* تحسينات جديدة */
/* تحسين ظهور الأيقونات */
.sidebar-item i {
  font-size: 2rem;
  color: #4f46e5;
  margin-bottom: 0.5rem;
}
.sidebar-item:hover i {
  color: #6366f1;
}
/* تحسين أزرار المحاذاة والاتجاه */
.btn-secondary {
  background-color: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
}
.btn-secondary:hover {
  background-color: #e5e7eb;
  color: #374151;
}
.btn-secondary.active {
  background-color: #4f46e5;
  color: white;
  border-color: #4f46e5;
}
/* تحسين زر اختيار ملف Excel */
.excel-file-btn {
  background-color: #1d6f42; /* لون Excel الأخضر */
  color: white;
  border: 1px solid #165a33;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.excel-file-btn:hover {
  background-color: #165a33;
}
.excel-file-btn i {
  margin-left: 0.5rem;
}
/* تحسين ظهور عناصر التصميم عند السحب */
.design-element.dragging {
  opacity: 0.8;
  z-index: 1000;
  cursor: grabbing;
}
/* تحسين ظهور مقبض تغيير الحجم */
.resize-handle {
  background-color: #4f46e5;
  border: 3px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}
/* تحسين ظهور زر الحذف */
.delete-btn {
  background-color: #ef4444;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.delete-btn:hover {
  background-color: #dc2626;
}
/* تحسين ظهور لوحة الألوان */
.color-picker {
  border: 1px solid #d1d5db;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.color-picker input[type="color"] {
  height: 40px;
  border-radius: 0.25rem;
  border: 1px solid #d1d5db;
  cursor: pointer;
}
/* رسالة ترحيبية للشهادة الفارغة */
.welcome-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #9ca3af;
  pointer-events: none;
  z-index: 0;
}
.welcome-message i {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: #d1d5db;
}
.welcome-message p {
  font-size: 1.25rem;
  font-weight: 500;
}
/* استيراد تصميم */
.import-design-btn {
  background-color: #10b981;
  color: white;
  border: 1px solid #059669;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.import-design-btn:hover {
  background-color: #059669;
}
.import-design-btn i {
  margin-left: 0.5rem;
}
/* تحسين زر حفظ القالب */
.btn-save {
  background-color: #3b82f6 !important;
  color: white !important;
  border: 1px solid #2563eb !important;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3), 0 2px 4px -1px rgba(59, 130, 246, 0.2) !important;
  font-weight: 600 !important;
  padding: 0.625rem 1.25rem !important;
  border-radius: 0.5rem !important;
  transition: all 0.3s ease !important;
}
.btn-save:hover {
  background-color: #2563eb !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4), 0 4px 6px -2px rgba(59, 130, 246, 0.3) !important;
  transform: translateY(-1px) !important;
}
.btn-save:active {
  transform: translateY(0) !important;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3), 0 2px 4px -1px rgba(59, 130, 246, 0.2) !important;
}
.btn-save i {
  margin-left: 0.5rem;
}
/* تحسينات إضافية للألوان */
.color-display {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-preview {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
}
.color-hex {
  font-family: monospace;
  font-size: 14px;
}
/* تحسينات لعناصر النص */
.text-content {
  display: inline-block;
  width: 100%;
}
/* تأكد من تطبيق الألوان بشكل مباشر */
.text-element span {
  display: inline-block;
  width: 100%;
}
/* تحسينات جديدة لواجهة اختيار الألوان */
.color-button {
  width: 100%;
  height: 40px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.color-button:hover {
  border-color: #9ca3af;
}
.color-button-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-preview-small {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.color-hex-text {
  font-family: monospace;
  font-size: 14px;
  font-weight: 500;
}
.mix-blend-difference {
  mix-blend-mode: difference;
}
/* تحسينات جديدة لواجهة التحكم في حجم التصميم */
.size-control-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}
.size-option {
  position: relative;
  overflow: hidden;
}
.size-option.active {
  background-color: #eff6ff;
  border-color: #3b82f6;
}
.size-option.active::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 16px 16px 0;
  border-color: transparent #3b82f6 transparent transparent;
}
.size-option.active i {
  color: #3b82f6;
}
.custom-size-inputs {
  display: flex;
  gap: 0.5rem;
}
.custom-size-input {
  flex: 1;
}
.current-size-display {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.5rem;
  text-align: center;
}
/* تحسينات دقة المواقع */
.design-element {
  transform-origin: top left;
}
.text-element {
  line-height: 1.2;
}
/* Corner indicators for text elements */
.corner-indicator {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border: 2px solid white;
  border-radius: 50%;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}
.design-element.selected .corner-indicator {
  opacity: 1;
}
.corner-tl {
  top: -6px;
  left: -6px;
}
.corner-tr {
  top: -6px;
  right: -6px;
}
.corner-bl {
  bottom: -6px;
  left: -6px;
}
.corner-br {
  bottom: -6px;
  right: -6px;
}
/* Bounding box visualization */
.bounding-box {
  position: absolute;
  border: 1px dashed #3b82f6;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s;
}
.design-element.selected .bounding-box {
  opacity: 1;
}
/* Position info display */
.position-info {
  position: absolute;
  bottom: -30px;
  left: 0;
  background: rgba(59, 130, 246, 0.9);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
  white-space: nowrap;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.2s;
}
.design-element.selected .position-info {
  opacity: 1;
}
/* Mobile Detection and Message Styles */
.mobile-message {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  z-index: 9999;
  color: white;
  text-align: center;
  padding: 2rem;
  overflow-y: auto;
}
.mobile-message-content {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.mobile-message-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
}
.mobile-message h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  font-weight: 700;
}
.mobile-message p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  opacity: 0.9;
}
.mobile-illustration {
  width: 100%;
  max-width: 300px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.mobile-illustration i {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.8);
}
.mobile-illustration::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 120px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 1rem;
  left: 30px;
}
.mobile-illustration::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 120px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 0.5rem;
  right: 30px;
}
.desktop-only {
  display: none;
}
@media (min-width: 1024px) {
  .mobile-message {
    display: none !important;
  }
  .desktop-only {
    display: block;
  }
}
@media (max-width: 1023px) {
  .mobile-message {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .desktop-only {
    display: none;
  }
}
@media print {
body * {
visibility: hidden;
}
.print-area, .print-area * {
visibility: visible;
}
.print-area {
position: absolute;
left: 0;
top: 0;
}

  @media (max-width: 480px) {
    footer {
      font-size: 12px;
      padding: 8px;
    }
    footer span, footer a {
      display: block;
      margin: 3px 0;
    }
  }
}
/* Success card inside modal, pure CSS */
.modal .success-card{
  position:relative;
  padding:20px;
  background:linear-gradient(to right,#f0fdf4,#ecfdf5);
  border:2px solid #bbf7d0;
  border-radius:12px;
  box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);
  overflow:hidden;
  animation:sc-fade .6s ease-out forwards;
}
.modal .success-card__body{
  position:relative; z-index:10;
  display:flex; align-items:flex-start; gap:12px;
}
.modal .success-card__icon{
  flex-shrink:0; width:36px; height:36px;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,#4ade80,#10b981);
  border-radius:9999px;
  box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);
  animation:sc-pulse 2s ease-in-out infinite;
}
.modal .success-card__icon-svg{
  width:20px; height:20px;
  stroke:#fff; stroke-width:2;
  stroke-linecap:round; stroke-linejoin:round; fill:none;
}
.modal .success-card__text{ flex:1; }
.modal .success-card__title{
  font-size:1.125rem; font-weight:700; margin:0 0 6px;
  background:linear-gradient(to right,#14532d,#065f46);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  text-align:start;
}
.modal .success-card__desc{
  color:#166534; line-height:1.6; margin:0; text-align:start;
}
/* decorative circles */
.modal .success-card__dec{
  position:absolute; border-radius:50%; opacity:.3;
}
.modal .success-card__dec--tr{
  top:0; right:0; width:128px; height:128px;
  background-color:#bbf7d0; margin-right:-64px; margin-top:-64px;
}
.modal .success-card__dec--bl{
  bottom:0; left:0; width:96px; height:96px;
  background-color:#a7f3d0; margin-left:-48px; margin-bottom:-48px;
}
/* bottom bar */
.modal .success-card__bar{
  position:absolute; left:0; right:0; bottom:0; height:4px;
  background:linear-gradient(90deg,#34d399,#10b981,#34d399);
}
/* animations */
@keyframes sc-fade{from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)}}
@keyframes sc-pulse{0%,100%{transform:scale(1)} 50%{transform:scale(1.05)}}
/* reduced motion */
@media (prefers-reduced-motion: reduce){
  .modal .success-card{animation:none}
  .modal .success-card__icon{animation:none}
}
