﻿
    :root {
      --bg: #1a1f2e;
      --card: #242b3d;
      --text: #e6eef8;
      --muted: #9fb0c8;
      --accent: #1288cc;
      --accent-hover: #0d6ca3;
      --success: #4CAF50;
      --warning: #FF9800;
      --error: #F44336;
      --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      --radius: 16px;
      --shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
      --gradient: linear-gradient(135deg, #1288cc, #1288cc);
    }
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }
    html, body {
      height: 100%;
      font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
      background: linear-gradient(135deg, var(--bg), #151a28);
      color: var(--text);
      line-height: 1.6;
      overflow-x: hidden;
    }
    body {
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding: 20px;
      min-height: 100vh;
    }
    .card {
      background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
      border-radius: var(--radius);
      padding: 30px;
      max-width: 1400px;
      width: 100%;
      box-shadow: var(--shadow);
      animation: fadeIn 0.8s ease-out;
      border: 1px solid rgba(255,255,255,0.08);
      backdrop-filter: blur(20px);
      position: relative;
      overflow: hidden;
      margin: 20px 0;
    }
    .card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--accent), transparent);
      animation: shimmer 3s infinite;
    }
    .card::after {
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      width: 200%;
      height: 200%;
      background: radial-gradient(circle, rgba(0, 0, 0, 0.1) 0%, transparent 70%);
      opacity: 0;
      transition: opacity 0.5s ease;
      pointer-events: none;
    }
    .card:hover::after {
      opacity: 1;
    }
    h1 {
      margin: 0 0 30px;
      font-size: 32px;
      text-align: center;
      color: var(--accent);
      animation: slideDown 0.6s ease-out;
      text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 15px;
      font-weight: 700;
    }
    .grid {
      display: grid;
      grid-template-columns: 1fr 420px;
      gap: 30px;
    }
    .form-container {
      display: flex;
      flex-direction: column;
      gap: 25px;
      min-width: 0;
    }
    .form-section {
      background: rgba(255,255,255,0.03);
      border-radius: var(--radius);
      padding: 25px;
      border: 1px solid rgba(255,255,255,0.05);
      transition: var(--transition);
      overflow: hidden;
      position: relative;
    }
    .form-section::before {
      content: '';
      position: absolute;
      top: 0;
      right: 0;
      width: 3px;
      height: 0;
      background: var(--accent);
      transition: height 0.5s ease;
    }
    .form-section:hover::before {
      height: 100%;
    }
    .form-section:hover {
      border-color: rgba(255,255,255,0.1);
      transform: translateY(-5px);
      box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    }
    .section-title {
      font-size: 18px;
      margin-bottom: 20px;
      color: var(--accent);
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 600;
    }
    .section-title i {
      font-size: 20px;
      width: 24px;
      text-align: center;
    }
    .form-group {
      margin-bottom: 20px;
      width: 100%;
    }
    label {
      font-size: 14px;
      color: var(--muted);
      display: block;
      margin-bottom: 10px;
      font-weight: 500;
    }
    input[type="text"], textarea, select, input[type="number"], input[type="file"] {
      width: 100%;
      padding: 14px 18px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.05);
      color: var(--text);
      outline: none;
      font-size: 15px;
      transition: var(--transition);
      max-width: 100%;
      box-sizing: border-box;
    }
    select {
      appearance: none;
      background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: left 12px center;
      background-size: 16px;
      padding-left: 40px;
    }
    select option {
      background: var(--card);
      color: var(--text);
      padding: 10px;
    }
    input[type="text"]:focus, textarea:focus, select:focus, input[type="number"]:focus, input[type="file"]:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(18, 136, 204, 0.2);
      transform: translateY(-2px);
    }
    textarea {
      min-height: 120px;
      resize: vertical;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }
    .row {
      display: flex;
      gap: 15px;
      width: 100%;
      flex-wrap: wrap;
    }
    .btn {
      background: var(--accent);
      border: none;
      color: white;
      font-weight: 600;
      padding: 16px 24px;
      border-radius: 12px;
      cursor: pointer;
      transition: var(--transition);
      font-size: 15px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      flex: 1;
      min-width: 140px;
      position: relative;
      overflow: hidden;
    }
    .btn::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 ease;
    }
    .btn:hover::before {
      left: 100%;
    }
    .btn:hover {
      background: var(--accent-hover);
      transform: translateY(-5px);
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    }
    .btn:active {
      transform: translateY(-2px);
    }
    .btn-secondary {
      background: rgba(68, 68, 85, 0.7);
      color: white;
      backdrop-filter: blur(10px);
    }
    .btn-secondary:hover {
      background: rgba(85, 85, 102, 0.8);
    }
    .muted {
      color: var(--muted);
      font-size: 14px;
    }
    .preview-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 25px;
      padding: 30px;
      border-radius: var(--radius);
      background: linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
      border: 1px solid rgba(255,255,255,0.05);
      animation: fadeIn 0.8s ease-out 0.2s both;
      position: relative;
      overflow: hidden;
      height: fit-content;
      min-width: 0;
    }
    .preview-container::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    }
    canvas {
      background: white;
      border-radius: 12px;
      transition: var(--transition);
      box-shadow: 0 8px 25px rgba(0,0,0,0.3);
      max-width: 100%;
      height: auto;
    }
    canvas:hover {
      transform: scale(1.03);
      box-shadow: 0 12px 30px rgba(0,0,0,0.4);
    }
    .small {
      font-size: 13px;
      color: var(--muted);
    }
    .controls {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      width: 100%;
    }
    .color-picker {
      display: flex;
      align-items: center;
      gap: 10px;
      flex: 1;
      min-width: 150px;
    }
    .color-picker span {
      min-width: 70px;
      white-space: nowrap;
    }
    .color-picker input {
      width: 50px;
      height: 50px;
      border-radius: 12px;
      border: 2px solid rgba(255,255,255,0.1);
      padding: 0;
      cursor: pointer;
      transition: var(--transition);
      flex-shrink: 0;
    }
    .color-picker input:hover {
      transform: scale(1.1);
      border-color: rgba(255,255,255,0.3);
    }
    .download-options {
      display: flex;
      flex-direction: column;
      gap: 12px;
      width: 100%;
    }
    .download-btn {
      padding: 14px 18px;
      border-radius: 12px;
      background: var(--accent);
      color: white;
      text-decoration: none;
      text-align: center;
      transition: var(--transition);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      font-weight: 500;
      backdrop-filter: blur(10px);
      position: relative;
      overflow: hidden;
    }
    .download-btn::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
      transition: left 0.5s ease;
    }
    .download-btn:hover::before {
      left: 100%;
    }
    .download-btn:hover {
      background: var(--accent-hover);
      transform: translateY(-3px);
      box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    }
    .info-box {
      padding: 15px 18px;
      border-radius: 12px;
      background: rgba(255,255,255,0.03);
      text-align: center;
      min-height: 60px;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      transition: var(--transition);
      word-break: break-word;
      backdrop-filter: blur(10px);
    }
    .success {
      background: rgba(46, 125, 50, 0.2);
      color: #81c784;
      border: 1px solid rgba(46, 125, 50, 0.3);
    }
    .warning {
      background: rgba(255, 152, 0, 0.2);
      color: #ffb74d;
      border: 1px solid rgba(255, 152, 0, 0.3);
    }
    .error {
      background: rgba(244, 67, 54, 0.2);
      color: #e57373;
      border: 1px solid rgba(244, 67, 54, 0.3);
    }
    .content-type-selector {
      display: flex;
      gap: 10px;
      margin-bottom: 20px;
      width: 100%;
      flex-wrap: wrap;
    }
    .type-btn {
      flex: 1;
      padding: 15px;
      text-align: center;
      background: rgba(255,255,255,0.05);
      border-radius: 10px;
      cursor: pointer;
      transition: var(--transition);
      border: 1px solid transparent;
      min-width: 90px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }
    .type-btn.active {
      background: rgba(18, 136, 204, 0.15);
      border-color: var(--accent);
      color: var(--accent);
      transform: translateY(-3px);
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    .type-btn:hover:not(.active) {
      background: rgba(255,255,255,0.08);
      transform: translateY(-2px);
    }
    .hidden {
      display: none;
    }
    .logo-controls {
      background: rgba(255,255,255,0.02);
      border-radius: 10px;
      padding: 18px;
      margin-top: 15px;
      border: 1px dashed rgba(255,255,255,0.1);
    }
    .logo-preview {
      width: 90px;
      height: 90px;
      border-radius: 10px;
      background: rgba(255,255,255,0.05);
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 15px auto;
      overflow: hidden;
      border: 1px solid rgba(255,255,255,0.1);
    }
    .logo-preview img {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
    }
    .logo-remove {
      background: rgba(244, 67, 54, 0.2);
      color: #e57373;
      border: none;
      padding: 10px 15px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 13px;
      margin-top: 10px;
      width: 100%;
      transition: var(--transition);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .logo-remove:hover {
      background: rgba(244, 67, 54, 0.3);
      transform: translateY(-2px);
    }
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(30px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @keyframes slideDown {
      from { opacity: 0; transform: translateY(-40px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @keyframes pulse {
      0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7); }
      70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
      100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
    }
    @keyframes shimmer {
      0% { opacity: 0; }
      50% { opacity: 1; }
      100% { opacity: 0; }
    }
    .pulse {
      animation: pulse 2s infinite;
    }
    @media (max-width: 1200px) {
      .grid {
        grid-template-columns: 1fr;
        gap: 25px;
      }
      .preview-container {
        order: -1;
        max-width: 500px;
        margin: 0 auto;
      }
      .card {
        padding: 25px;
      }
    }
    @media (max-width: 768px) {
      body {
        padding: 15px;
        align-items: flex-start;
      }
      .card {
        padding: 20px;
        border-radius: 14px;
        margin: 10px 0;
      }
      h1 {
        font-size: 26px;
        margin-bottom: 25px;
      }
      .row {
        flex-direction: column;
        gap: 15px;
      }
      .color-picker {
        justify-content: space-between;
      }
      .form-section {
        padding: 20px;
      }
      .btn {
        min-width: 100%;
      }
    }
    @media (max-width: 480px) {
      body {
        padding: 10px;
      }
      .card {
        padding: 18px;
        border-radius: 12px;
      }
      h1 {
        font-size: 24px;
        margin-bottom: 20px;
        flex-direction: column;
        gap: 10px;
      }
      .grid {
        gap: 20px;
      }
      .form-container {
        gap: 20px;
      }
      .preview-container {
        padding: 20px;
      }
      .btn, .download-btn {
        padding: 14px 16px;
        font-size: 14px;
      }
      .form-section {
        padding: 18px;
      }
      input[type="text"], textarea, select, input[type="number"], input[type="file"] {
        padding: 12px 14px;
      }
    }
    @media (max-width: 360px) {
      h1 {
        font-size: 22px;
      }
      .color-picker {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
      }
      .color-picker input {
        width: 100%;
        max-width: 60px;
      }
      .content-type-selector {
        flex-direction: column;
      }
      .type-btn {
        min-width: 100%;
      }
    }
    @media (min-width: 1400px) {
      .card {
        max-width: 1500px;
      }
      .grid {
        grid-template-columns: 1fr 450px;
      }
    }
    .qr-test-btn {
      background: rgba(76, 175, 80, 0.2);
      color: #81c784;
      border: 1px solid rgba(76, 175, 80, 0.3);
    }
    .qr-test-btn:hover {
      background: rgba(76, 175, 80, 0.3);
    }
    .advanced-options {
      display: none;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    .advanced-options.expanded {
      display: block;
      opacity: 1;
    }
    .toggle-advanced {
      background: transparent;
      color: var(--muted);
      border: none;
      padding: 10px 15px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 15px;
      transition: var(--transition);
      width: 100%;
      justify-content: center;
    }
    .toggle-advanced:hover {
      color: var(--accent);
      background: rgba(255,255,255,0.05);
    }
    .qr-stats {
      display: flex;
      justify-content: space-between;
      margin-top: 15px;
      font-size: 13px;
      color: var(--muted);
      width: 100%;
    }
    .qr-stats span {
      background: rgba(255,255,255,0.05);
      padding: 6px 10px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .qr-actions {
      display: flex;
      gap: 10px;
      width: 100%;
    }
    .qr-actions .btn {
      flex: 1;
    }
    .qr-type-icon {
      font-size: 20px;
    }
    .qr-preview-container {
      position: relative;
      display: inline-block;
    }
    .qr-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.7);
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 12px;
      opacity: 0;
      transition: var(--transition);
      pointer-events: none;
    }
    .qr-preview-container:hover .qr-overlay {
      opacity: 1;
    }
    .qr-overlay-btn {
      background: var(--accent);
      color: white;
      border: none;
      padding: 10px 18px;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 600;
      pointer-events: auto;
      transition: var(--transition);
    }
    .qr-overlay-btn:hover {
      background: var(--accent-hover);
      transform: translateY(-3px);
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    }
    .template-gallery {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      margin-top: 15px;
    }
    .template-item {
      background: rgba(255,255,255,0.05);
      border-radius: 10px;
      padding: 12px;
      cursor: pointer;
      transition: var(--transition);
      text-align: center;
      border: 1px solid transparent;
    }
    .template-item:hover {
      background: rgba(255,255,255,0.08);
      border-color: rgba(255,255,255,0.1);
      transform: translateY(-3px);
    }
    .template-item.active {
      border-color: var(--accent);
      background: rgba(18, 136, 204, 0.15);
      transform: translateY(-3px);
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    .template-preview {
      width: 70px;
      height: 70px;
      margin: 0 auto 10px;
      border-radius: 8px;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      transition: var(--transition);
    }
    .template-name {
      font-size: 12px;
      color: var(--muted);
      font-weight: 500;
    }
    .floating-shapes {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: -1;
    }
    .shape {
      position: absolute;
      background: var(--accent);
      opacity: 0.05;
      border-radius: 50%;
      animation: float 15s infinite linear;
    }
    .shape:nth-child(1) {
      width: 100px;
      height: 100px;
      top: 10%;
      left: 10%;
      animation-delay: 0s;
    }
    .shape:nth-child(2) {
      width: 150px;
      height: 150px;
      top: 60%;
      right: 10%;
      animation-delay: -5s;
    }
    .shape:nth-child(3) {
      width: 80px;
      height: 80px;
      bottom: 20%;
      left: 20%;
      animation-delay: -10s;
    }
    @keyframes float {
      0% { transform: translateY(0px); }
      50% { transform: translateY(-10px); }
      100% { transform: translateY(0px); }
    }
    /* مودال عرض VCard كنص منسق */
    .vcard-modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.7);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
      padding: 20px;
      box-sizing: border-box;
    }
    .vcard-modal.active {
      opacity: 1;
      pointer-events: all;
    }
    .vcard-content {
      background: var(--card);
      border-radius: var(--radius);
      padding: 30px;
      max-width: 600px;
      width: 100%;
      box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
      transform: translateY(30px);
      transition: transform 0.3s ease;
      position: relative;
      max-height: 90vh;
      overflow-y: auto;
    }
    .vcard-modal.active .vcard-content {
      transform: translateY(0);
    }
    .vcard-close {
      position: absolute;
      top: 15px;
      left: 15px;
      background: none;
      border: none;
      color: var(--muted);
      font-size: 20px;
      cursor: pointer;
      transition: var(--transition);
      z-index: 10;
    }
    .vcard-close:hover {
      color: var(--accent);
    }
    .vcard-header {
      text-align: center;
      margin-bottom: 25px;
      padding-top: 10px;
    }
    .vcard-title {
      font-size: 24px;
      color: var(--accent);
      margin-bottom: 10px;
      word-break: break-word;
    }
    .vcard-subtitle {
      color: var(--muted);
      font-size: 16px;
      word-break: break-word;
    }
    .vcard-info {
      display: flex;
      flex-direction: column;
      gap: 15px;
    }
    .vcard-field {
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 15px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 10px;
      transition: var(--transition);
      text-align: right;
    }
    .vcard-field:hover {
      background: rgba(255, 255, 255, 0.08);
    }
    .vcard-field-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .vcard-field-label {
      font-size: 14px;
      color: var(--muted);
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .vcard-field-value {
      font-size: 16px;
      color: var(--text);
      word-break: break-word;
      margin-top: 5px;
      direction: rtl;
      text-align: right;
    }
    .vcard-actions {
      display: flex;
      gap: 10px;
      margin-top: 25px;
      flex-wrap: wrap;
    }
    .vcard-actions .btn {
      flex: 1;
      min-width: 120px;
    }
    .vcard-copy-btn {
      background: rgba(255,255,255,0.05);
      border: none;
      color: var(--muted);
      padding: 8px 12px;
      border-radius: 6px;
      cursor: pointer;
      transition: var(--transition);
      font-size: 12px;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .vcard-copy-btn:hover {
      background: var(--accent);
      color: white;
    }
    .vcard-text-display {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 10px;
      padding: 20px;
      margin-top: 20px;
      text-align: right;
      direction: rtl;
      font-family: monospace;
      white-space: pre-wrap;
      word-break: break-word;
      position: relative;
    }
    .vcard-text-copy {
      position: absolute;
      top: 10px;
      left: 10px;
      background: rgba(255,255,255,0.1);
      border: none;
      color: var(--muted);
      padding: 6px 10px;
      border-radius: 6px;
      cursor: pointer;
      transition: var(--transition);
      font-size: 12px;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .vcard-text-copy:hover {
      background: var(--accent);
      color: white;
    }
    @media (max-width: 768px) {
      .vcard-content {
        padding: 20px;
        max-height: 85vh;
      }
      .vcard-field {
        padding: 12px;
      }
      .vcard-actions {
        flex-direction: column;
      }
      .vcard-actions .btn {
        min-width: 100%;
      }
    }
    @media (max-width: 480px) {
      .vcard-content {
        padding: 15px;
      }
      .vcard-title {
        font-size: 20px;
      }
      .vcard-subtitle {
        font-size: 14px;
      }
      .vcard-field-value {
        font-size: 14px;
      }
    }
  
