/* index.css - מערכת העיצוב המלאה עם חתימות (rentmate) */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;700;800&family=Outfit:wght@300;400;500;600;700&display=swap');


:root {
  --primary-color: var(--primary-color, hsl(216, 85%, 34%));
  --primary-hover: var(--primary-hover, hsl(216, 85%, 28%));
  --accent-color: var(--accent-teal, hsl(123, 46%, 34%));
  --accent-hover: var(--accent-teal, hsl(123, 46%, 34%));
  --bg-app: var(--bg-primary, hsl(216, 33%, 97%));
  --bg-card: var(--bg-secondary, hsl(0, 0%, 100%));
  --border-color: var(--border-color, hsl(200, 18%, 84%));
  --text-main: var(--text-primary, hsl(234, 66%, 30%));
  --text-muted: var(--text-secondary, hsl(200, 18%, 26%));
  --success-color: var(--success-green, hsl(123, 46%, 34%));
  --warning-color: var(--warning-color, hsl(35, 92%, 50%));
  --error-color: var(--error-red, hsl(0, 66%, 47%));
  --error-bg: rgba(220, 38, 38, 0.05);
  --warning-bg: rgba(217, 119, 6, 0.05);
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --paper-shadow: 0 20px 40px rgba(0, 0, 0, 0.06), 0 5px 15px rgba(0, 0, 0, 0.02);
  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}





body {
  font-family: 'Assistant', 'Heebo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  direction: rtl;
}


.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* כותרת האפליקציה */
.app-header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo svg {
  fill: var(--accent-color);
  width: 2rem;
  height: 2rem;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to left, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  color: var(--accent-color);
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 0.5rem;
  border: 1px solid rgba(217, 119, 6, 0.4);
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  vertical-align: middle;
}

/* פריסת המסך */
.workspace-layout {
  display: grid;
  grid-template-columns: 50% 50%;
  flex: 1;
  height: calc(100vh - 110px);
  overflow: hidden;
}

@media (max-width: 1024px) {
  .workspace-layout {
    grid-template-columns: 100%;
    height: auto;
    overflow: visible;
  }
}

/* פאנל עריכה - ימין */
.editor-panel {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  height: 100%;
  border-left: 1px solid var(--border-color);
  background-color: #f8fafc;
}

@media (max-width: 1024px) {
  .editor-panel {
    height: auto;
    overflow: visible;
  }
}

/* כרטיסי אקורדיון */
.accordion-section {
  transition: var(--transition-smooth);
}

.accordion-header:hover {
  background-color: #f1f5f9 !important;
}

.accordion-body {
  animation: slideDown 0.2s ease-out;
  border-top: 1px solid var(--border-color);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.wizard-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
}

/* טפסים ושדות */
.form-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--bg-app);
  padding-bottom: 0.4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

input, select, textarea {
  font-family: inherit;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  background-color: #ffffff;
  color: var(--text-main);
  font-size: 0.925rem;
  transition: var(--transition-smooth);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

/* כפתורים */
.btn {
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.925rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-success {
  background-color: var(--success-color);
  color: #ffffff;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 1.5px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: rgba(30, 41, 120, 0.03);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* בלוני הסבר - Tooltips */
.tooltip-trigger-icon {
  user-select: none;
  transition: var(--transition-smooth);
}

.tooltip-trigger-icon:hover {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
}

.tooltip-balloon {
  position: absolute;
  bottom: 125%;
  right: 0;
  background-color: #1e293b;
  color: #ffffff;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.775rem;
  font-weight: 400;
  width: 260px;
  z-index: 1000;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  line-height: 1.5;
  animation: fadeIn 0.15s ease-out;
}

.tooltip-balloon::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 15px;
  border-width: 6px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* לוחות חתימה ואימות זהות */
.signature-card-col {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.signature-pad-container {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.signature-canvas {
  background-color: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  cursor: crosshair;
  width: 100%;
  height: 120px;
  display: block;
}

.verification-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: bold;
}

.verification-status-badge.verified {
  background-color: #d1fae5;
  color: #065f46;
}

.verification-status-badge.unverified {
  background-color: #f3f4f6;
  color: #374151;
}

/* עיצוב החתימות בחוזה המודפס */
.contract-signature-img {
  max-height: 45px;
  max-width: 130px;
  display: block;
  margin: 0.25rem auto;
  mix-blend-mode: multiply; /* מסיר רקע לבן להשתלבות מושלמת בנייר */
}

.signature-placeholder {
  display: block;
  height: 45px;
  line-height: 45px;
  color: #94a3b8;
  font-size: 0.8rem;
  font-style: italic;
}

/* התראות משפטיות */
.compliance-alerts-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.alert-card {
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border-right: 4px solid;
  font-size: 0.875rem;
}

.alert-card.error {
  background-color: var(--error-bg);
  border-right-color: var(--error-color);
  color: #7f1d1d;
}

.alert-card.warning {
  background-color: var(--warning-bg);
  border-right-color: var(--warning-color);
  color: #78350f;
}

.alert-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.alert-content h5 {
  font-weight: 800;
  margin-bottom: 0.2;
}

/* פאנל תצוגה מקדימה - שמאל */
.preview-panel {
  background-color: #475569;
  padding: 2rem;
  overflow-y: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.preview-toolbar {
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  color: #ffffff;
}

.preview-title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-color);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* נייר החוזה */
.paper-sheet {
  background-color: #ffffff;
  width: 100%;
  max-width: 800px;
  min-height: 1130px;
  padding: 4.5rem 4rem;
  box-shadow: var(--paper-shadow);
  border-radius: 2px;
  color: #000000;
}

/* טבלת צדדים לחוזה */
.parties-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
.party-box-cell {
  border: 1px solid #1e293b;
  padding: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  background-color: #ffffff;
}
.party-box-cell:first-child {
  border-left: none;
}
.party-role-title {
  font-weight: 800;
  font-size: 1.05rem;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 8px;
  padding-bottom: 4px;
  color: #1e293b;
}

@media (max-width: 640px) {
  .paper-sheet {
    padding: 2rem 1.5rem;
  }
}

/* עיצוב החוזה בתוך הנייר */
.contract-document {
  font-family: 'David Libre', 'Times New Roman', serif;
  font-size: 1.05rem;
  line-height: 1.65;
}

.contract-header {
  text-align: center;
  margin-bottom: 2rem;
}

.contract-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  border-bottom: 3px double #000;
  display: inline-block;
  padding-bottom: 0.25rem;
}

.contract-section {
  margin-bottom: 1.25rem;
}

.contract-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.75rem 0 0.4rem;
}

.contract-section h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1rem;
  text-decoration: underline;
}

.contract-document p {
  margin-bottom: 0.5rem;
  text-align: justify;
  margin-right: 1.5rem; /* Indent sub-sections relative to headings */
  padding-right: 2.5rem; /* Hanging indent space */
  text-indent: -2.5rem; /* Pull first line back into the padding area */
}

/* Remove indentation for non-numbered paragraphs and special sections */
.declarations-section p, 
.contract-header p,
.signatures-area p,
.signatures-area td p,
.inventory-annex p,
.guarantees-annex p,
.audit-trail-annex p,
.party-details-block p {
  margin-right: 0 !important;
  padding-right: 0 !important;
  text-indent: 0 !important;
}

/* Double indentation for nested clauses (e.g. 2.2.1, 3.4.1) */
.contract-document p.nested-clause {
  margin-right: 3rem !important;
  padding-right: 3.2rem !important; /* Wider hanging indent space for longer numbers (e.g. 2.2.1.) */
  text-indent: -3.2rem !important;
}

/* Clause numbers style for extra clarity */
.clause-number {
  font-weight: 800;
  color: var(--primary-color);
  display: inline-block;
}

/* Stacked parties layout styling */
.party-details-block {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  padding: 4px 0;
}
.party-detail-line {
  margin-bottom: 3px;
}
.party-detail-line.sub-line {
  color: #334155;
  font-size: 0.9rem;
}

.party-role {
  font-style: italic;
  font-weight: bold;
}

.signatures-area {
  margin-top: 3rem;
  border-top: 1px dashed #ccc;
  padding-top: 1.5rem;
}

.empty-placeholder {
  background-color: #fef3c7;
  color: #b45309;
  font-weight: bold;
  padding: 0 0.25rem;
  border-radius: 2px;
}

.filled-value {
  color: #1e293b;
  font-weight: bold;
  border-bottom: 1px solid #94a3b8;
}

/* טאבים למובייל */
.mobile-view-tabs {
  display: none;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 5;
}

@media (max-width: 1024px) {
  .mobile-view-tabs {
    display: flex;
  }
  .mobile-hide {
    display: none !important;
  }
}

.mobile-tab-btn {
  flex: 1;
  text-align: center;
  padding: 0.85rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

.mobile-tab-btn.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
  background-color: rgba(217, 119, 6, 0.02);
}

/* עימוד הדפסה A4 נקי */
@media print {
  body, html {
    background-color: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .app-header, 
  .editor-panel, 
  .preview-toolbar, 
  .mobile-view-tabs,
  .btn,
  .progress-indicator-bar,
  .tooltip-trigger-icon,
  .tooltip-balloon,
  .compliance-alerts-container {
    display: none !important;
  }

  .workspace-layout {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .preview-panel {
    background: none !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
    display: block !important;
    width: 100% !important;
  }

  @page {
    margin: 20mm 15mm 20mm 15mm !important;
  }

  .paper-sheet {
    box-shadow: none !important;
    padding: 15mm 10mm !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    border-radius: 0 !important;
  }

  .contract-document {
    font-size: 11pt !important;
    line-height: 1.6 !important;
  }

  .contract-section {
    page-break-inside: avoid;
  }

  .signatures-area {
    page-break-inside: avoid;
  }

  .filled-value {
    color: #000000 !important;
    font-weight: bold !important;
    border-bottom: none !important;
  }
}
