/* === Variables === */
:root {
  --primary:       #2563EB;
  --primary-dark:  #1D4ED8;
  --primary-light: #EFF6FF;
  --accent:        #0EA5E9;
  --accent-light:  #E0F2FE;
  --teal:          #0D9488;
  --teal-light:    #CCFBF1;
  --white:         #FFFFFF;
  --gray-50:       #F8FAFC;
  --gray-100:      #F1F5F9;
  --gray-200:      #E2E8F0;
  --gray-400:      #94A3B8;
  --gray-600:      #475569;
  --gray-800:      #1E293B;
  --error:         #EF4444;
  --error-light:   #FEF2F2;
  --success:       #10B981;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --shadow:        0 4px 24px rgba(37,99,235,0.08);
  --shadow-md:     0 8px 32px rgba(37,99,235,0.12);
  --transition:    0.2s ease;
  --font:          'Segoe UI', Arial, sans-serif;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.hidden { display: none !important; }

/* === Layout === */
.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === Header === */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 116px;
}
.logo img { height: 100px; width: auto; max-width: 100%; }
.lang-switch {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  padding: 6px 14px;
  border: 1.5px solid var(--primary);
  border-radius: 20px;
  transition: background var(--transition), color var(--transition);
}
.lang-switch:hover {
  background: var(--primary);
  color: var(--white);
  text-decoration: none;
}

/* === AdSense === */
.ad-container {
  width: 100%;
  background: var(--gray-100);
  height: 100px !important;
  max-height: 100px !important;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ad-container::before {
  content: 'פרסומת';
  position: absolute;
  font-size: 0.7rem;
  color: var(--gray-400);
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
}
.ad-container ins {
  min-height: 100px;
  width: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--gray-100),
    var(--gray-100) 10px,
    var(--gray-200) 10px,
    var(--gray-200) 20px
  );
}
.bentley-banner { text-align: center; margin-top: 32px; }
.bentley-banner img { max-width: 100%; height: auto; display: inline-block; border-radius: 8px; }

.ad-top  { border-bottom: 1px solid var(--gray-200); background: repeating-linear-gradient(-45deg, var(--gray-100), var(--gray-100) 10px, var(--gray-200) 10px, var(--gray-200) 20px); }
.ad-bottom { border-top: 1px solid var(--gray-200); margin-top: 40px; background: transparent; min-height: unset; display: block; padding: 0; }
.ad-bottom::before { display: none; }
.ad-bottom a { display: block; line-height: 0; }
.ad-bottom img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

/* === Notices === */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
}
.notice-success {
  background: #DCFCE7;
  color: #166534;
  border-bottom: 1px solid #BBF7D0;
}
.notice-success span { font-size: 1.1rem; }

/* === Upload Section === */
.upload-section { padding: 40px 0 20px; }
.upload-section h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--gray-800);
  text-align: center;
  margin-bottom: 8px;
}
.subtitle {
  text-align: center;
  color: var(--gray-600);
  font-size: 1rem;
  margin-bottom: 32px;
}

/* === Upload Card === */
.upload-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 40px;
}

/* === Drop Zone === */
.drop-zone {
  border: 2.5px dashed var(--gray-200);
  border-radius: var(--radius);
  background: var(--primary-light);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  position: relative;
  outline: none;
}
.drop-zone:hover,
.drop-zone:focus,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: #DBEAFE;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
}
.file-input {
  display: none;
}
.drop-icon { margin-bottom: 12px; display: flex; justify-content: center; }
.drop-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}
.or-text {
  display: block;
  color: var(--gray-400);
  font-size: 0.875rem;
  margin-bottom: 12px;
}
.file-hints {
  color: var(--gray-400);
  font-size: 0.8rem;
  margin-top: 12px;
}

/* Drop zone preview */
.drop-zone-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  text-align: left;
}
.lang-he .drop-zone-preview { direction: rtl; }
.preview-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.preview-info { flex: 1; overflow: hidden; }
.preview-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-size {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-400);
}
.btn-remove {
  background: var(--error-light);
  border: none;
  color: var(--error);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-remove:hover { background: #FECACA; }

/* === Expiry === */
.expiry-group { margin-top: 24px; }
.expiry-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-800);
  margin-bottom: 12px;
}
.expiry-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.expiry-option {
  cursor: pointer;
  flex: 1;
  min-width: 120px;
}
.expiry-option input[type="radio"] { display: none; }
.expiry-option span {
  display: block;
  text-align: center;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--white);
  transition: all var(--transition);
}
.expiry-option input:checked + span {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}
.expiry-option:hover span {
  border-color: var(--primary);
  color: var(--primary);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-browse {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
  font-size: 0.95rem;
  padding: 10px 28px;
}
.btn-browse:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-upload {
  width: 100%;
  margin-top: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--white);
  font-size: 1.05rem;
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}
.btn-upload:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}
.btn-upload:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-copy {
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-copy:hover, .btn-copy.copied {
  background: var(--primary);
  color: var(--white);
}

.btn-download {
  background: linear-gradient(135deg, var(--teal) 0%, var(--accent) 100%);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(13,148,136,0.25);
}
.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13,148,136,0.35);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}
.btn-secondary:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

/* === Upload Error === */
.upload-error {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--error-light);
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 500;
}

/* === Features === */
.features { margin-top: 32px; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feature-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.feature-item:hover { transform: translateY(-2px); }
.feature-icon { font-size: 2rem; margin-bottom: 10px; }
.feature-item h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--primary);
}
.feature-item p { font-size: 0.85rem; color: var(--gray-600); }

/* === View Section === */
.view-section { padding: 32px 0; }
.view-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.view-image-wrap {
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 200px;
  position: relative;
}
.view-image-wrap::after {
  content: '';
  position: absolute;
  inset: 24px;
  z-index: 1;
}
.view-image {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Stats bar */
.view-stats {
  display: flex;
  gap: 24px;
  padding: 14px 24px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--gray-600);
}
.stat-icon { font-size: 1rem; }

/* Share section */
.share-section { padding: 24px; }
.share-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--gray-800);
}
.share-group { margin-bottom: 16px; }
.share-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.share-input-row {
  display: flex;
  gap: 8px;
}
.share-input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--gray-600);
  background: var(--gray-50);
  outline: none;
  min-width: 0;
}
.share-input:focus { border-color: var(--primary); }

/* View Actions */
.view-actions {
  display: flex;
  gap: 12px;
  padding: 0 24px 24px;
  flex-wrap: wrap;
}
.view-actions .btn { flex: 1; min-width: 140px; }

/* Delete section */
.delete-section {
  padding: 0 24px 24px;
  border-top: 1px solid var(--gray-200);
  margin-top: 8px;
  padding-top: 20px;
}
.delete-copy-row { margin-bottom: 14px; }
.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--error);
  background: var(--error-light);
  border: 1.5px solid #FECACA;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-delete:hover {
  background: #FECACA;
  color: var(--error);
  text-decoration: none;
}

/* === Error / 404 === */
.error-section { padding: 80px 0; }
.error-card {
  text-align: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  box-shadow: var(--shadow);
}
.error-icon { font-size: 4rem; margin-bottom: 16px; }
.error-card h1 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--gray-800);
}
.error-card p {
  color: var(--gray-600);
  margin-bottom: 28px;
}

/* === Footer === */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 20px 0;
  margin-top: auto;
}
.footer-brands {
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--gray-400);
  justify-content: center;
}
.footer-brands span { font-weight: 600; }
.footer-brands a {
  color: var(--gray-400);
  transition: color var(--transition);
}
.footer-brands a:hover { color: var(--primary); text-decoration: none; }
.footer-brands-sep { color: var(--gray-200); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--gray-400);
  padding-top: 14px;
}
.footer-copy { display: flex; flex-direction: column; gap: 2px; }
.footer-copy a {
  color: var(--gray-400);
  text-decoration: underline;
}
.footer-copy a:hover { color: var(--primary); }
.footer-nav { display: flex; gap: 20px; }
.footer-nav a {
  color: var(--gray-400);
  transition: color var(--transition);
}
.footer-nav a:hover { color: var(--primary); text-decoration: none; }

/* Hebrew footer: copyright right, links left */
.lang-he .footer-inner { direction: rtl; }
.lang-he .footer-nav { margin-right: auto; }

/* === Progress bar (upload) === */
.upload-progress {
  width: 100%;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  margin-top: 16px;
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

/* === Upload success panel === */
.upload-success { text-align: center; padding: 8px 0; }
.success-check { font-size: 3rem; color: #22c55e; line-height: 1; margin-bottom: 12px; }
.upload-success h3 { font-size: 1.25rem; color: var(--gray-900); margin-bottom: 24px; }
.upload-success .share-group { text-align: start; }
.delete-token-box { background: #fef3c7; border: 1px solid #f59e0b; border-radius: 10px; padding: 16px; margin: 16px 0; text-align: start; }
.delete-token-box p { color: #92400e; font-weight: 600; margin-bottom: 12px; font-size: 0.9rem; }
.success-view-btn { display: block; margin-top: 20px; text-decoration: none; text-align: center; }

/* === RTL overrides === */
.lang-he .drop-zone-preview { text-align: right; }

/* === Responsive === */
@media (max-width: 600px) {
  .upload-card { padding: 20px 16px; }
  .drop-zone { padding: 28px 16px; }
  .features-grid { grid-template-columns: 1fr; gap: 12px; }
  .expiry-options { gap: 8px; }
  .expiry-option { min-width: calc(50% - 4px); flex: none; }
  .view-stats { gap: 12px; }
  .share-input-row { flex-direction: column; }
  .btn-copy { align-self: flex-start; }
  .view-actions { flex-direction: column; }
  .view-actions .btn { min-width: unset; }
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
  .footer-nav { flex-direction: column; gap: 8px; align-items: center; }
  .header-inner { height: 81px; }
  .logo img { height: 65px; width: auto; }
}

@media (max-width: 400px) {
  .expiry-option { min-width: 100%; }
}
