*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #c0392b; --red-dk: #96281b;
  --bg: #f5f5f0; --card: #fff; --border: #e0ddd6;
  --text: #1a1a1a; --muted: #6b6b6b;
  --blue: #1d9bf0; --green: #25d366;
  --r: 10px;
}

body { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; background: var(--bg); color: var(--text); direction: rtl; font-size: 15px; line-height: 1.6; }

/* Header */
.site-header { background: var(--red); border-bottom: 3px solid var(--red-dk); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.header-inner { max-width: 900px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; height: 58px; }
.site-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 22px; }
.logo-text { font-size: 20px; font-weight: 800; color: #fff; }
.header-nav { display: flex; gap: 20px; }
.header-nav a { color: rgba(255,255,255,.85); text-decoration: none; font-size: 14px; font-weight: 600; padding: 4px 0; border-bottom: 2px solid transparent; transition: all .2s; }
.header-nav a:hover, .header-nav .nav-link:hover { color: #fff; border-bottom-color: rgba(255,255,255,.7); }

/* Hero */
.hero { background: linear-gradient(135deg, var(--red) 0%, #8b1e13 100%); padding: 40px 16px; text-align: center; }
.hero-inner { max-width: 600px; margin: 0 auto; }
.hero-title { font-size: 30px; font-weight: 900; color: #fff; margin-bottom: 10px; }
.hero-sub { font-size: 15px; color: rgba(255,255,255,.85); }
.hero-sub strong { color: #fff; }

/* Main */
.main { padding: 30px 0 60px; }
.container { max-width: 700px; margin: 0 auto; padding: 0 16px; }

/* Tabs */
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 5px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.tab { flex: 1; padding: 9px 4px; font-size: 13px; font-family: inherit; background: transparent; border: none; border-radius: 8px; color: var(--muted); cursor: pointer; transition: all .2s; font-weight: 600; }
.tab:hover { color: var(--text); background: var(--bg); }
.tab.active { background: var(--red); color: #fff; box-shadow: 0 2px 6px rgba(192,57,43,.35); }

.pane { display: none; }
.pane.active { display: block; }
.hidden { display: none !important; }

/* Card */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }

/* Form */
.field-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.input-row { display: flex; gap: 6px; align-items: center; }
.input { width: 100%; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--r); padding: 11px 14px; font-size: 14px; font-family: inherit; color: var(--text); transition: border-color .2s; outline: none; }
.input:focus { border-color: var(--red); }
.input::placeholder { color: #bbb; }
.textarea { resize: vertical; min-height: 110px; font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.7; }
.select { appearance: none; cursor: pointer; }
.btn-icon { flex-shrink: 0; width: 38px; height: 38px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--muted); transition: all .2s; }
.btn-icon:hover { background: #eee; color: var(--text); }

.custom-code-row { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.custom-code-row:focus-within { border-color: var(--red); }
.code-prefix { padding: 11px 12px; font-size: 12px; color: var(--muted); background: #ebe9e3; white-space: nowrap; border-left: 1px solid var(--border); }
.code-input { border: none; border-radius: 0; background: transparent; direction: ltr; }
.code-input:focus { outline: none; }
.hint { font-size: 12px; color: #bbb; margin-top: 5px; margin-bottom: 18px; }

/* Services */
.service-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; margin-bottom: 20px; }
.svc { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .2s; text-align: center; }
.svc:hover { border-color: #bbb; }
.svc.active { border-color: var(--red); background: #fdf0ee; }
.svc-icon { font-size: 16px; }
.svc-name { font-size: 11px; font-weight: 700; color: var(--text); }
.svc-desc { font-size: 10px; color: var(--muted); }
.svc.active .svc-name { color: var(--red); }

/* Buttons */
.btn-primary { width: 100%; padding: 13px; background: var(--red); color: #fff; border: none; border-radius: var(--r); font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer; transition: background .2s, transform .1s; }
.btn-primary:hover   { background: var(--red-dk); }
.btn-primary:active  { transform: scale(.98); }
.btn-primary:disabled{ opacity: .45; cursor: not-allowed; }
.btn-secondary { padding: 10px 16px; background: var(--bg); color: var(--text); border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; cursor: pointer; font-weight: 600; transition: background .2s; }
.btn-secondary:hover { background: #e8e8e3; }
.btn-sm { padding: 7px 14px; background: var(--bg); color: var(--text); border: 1.5px solid var(--border); border-radius: 7px; font-size: 12px; font-family: inherit; cursor: pointer; font-weight: 600; transition: all .2s; }
.btn-sm:hover { background: #e8e8e3; }
.btn-twitter  { background: #e8f5fe; color: var(--blue); border-color: #c5dff7; }
.btn-twitter:hover  { background: #d2ecfd; }
.btn-whatsapp { background: #e8fdf0; color: #128c7e; border-color: #b2e5cc; }
.btn-whatsapp:hover { background: #d4faeb; }
.btn-danger   { background: #fdf0ee; color: var(--red); border-color: #f5c5be; }
.btn-danger:hover   { background: #fbe3e0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Result */
.result-box { margin-top: 18px; background: #f9f9f7; border: 1.5px solid #d4edda; border-radius: 12px; padding: 16px; animation: fadeIn .3s ease; }
.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.result-label { font-size: 12px; font-weight: 700; color: #1e7e34; }
.result-url   { font-size: 20px; font-weight: 800; color: var(--red); word-break: break-all; margin-bottom: 6px; direction: ltr; text-align: right; }
.result-meta  { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Status */
.status { font-size: 13px; margin-top: 10px; min-height: 20px; text-align: center; font-weight: 600; }
.status.ok  { color: #1e7e34; }
.status.err { color: var(--red); }
.status.info{ color: var(--muted); }

/* Bulk */
.bulk-results { margin-top: 16px; }
.bulk-summary { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; display: flex; gap: 20px; font-size: 13px; font-weight: 700; }
.bulk-summary .stat { color: var(--muted); }
.bulk-summary .stat span { color: var(--text); }
.bulk-summary .stat.green span { color: #1e7e34; }
.bulk-summary .stat.red span   { color: var(--red); }
.bulk-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.bulk-item:last-child { border-bottom: none; }
.bulk-orig  { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.bulk-short { font-size: 13px; font-weight: 700; color: var(--red); white-space: nowrap; direction: ltr; }
.bulk-short.failed { color: #999; }

/* History */
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.history-empty  { text-align: center; color: var(--muted); font-size: 14px; padding: 30px 0; }
.history-item   { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.history-item:last-child { border-bottom: none; }
.history-short  { font-size: 14px; font-weight: 700; color: var(--red); flex: 1; word-break: break-all; direction: ltr; text-align: right; }
.history-orig   { font-size: 11px; color: #aaa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; direction: ltr; }
.history-svc    { font-size: 10px; background: #f0f0ec; color: var(--muted); padding: 2px 8px; border-radius: 20px; white-space: nowrap; font-weight: 700; }

/* Tips */
.tips-title { font-size: 17px; font-weight: 800; color: var(--red); margin-bottom: 20px; }
.tip-item   { display: flex; gap: 14px; margin-bottom: 20px; align-items: flex-start; }
.tip-num    { min-width: 30px; height: 30px; background: var(--red); color: #fff; border-radius: 50%; font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tip-item strong { display: block; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.tip-item p { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* Footer */
.site-footer { background: #1a1a1a; color: #888; text-align: center; padding: 20px 16px; font-size: 13px; }

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

@media (max-width: 500px) {
  .hero-title { font-size: 22px; }
  .header-nav { display: none; }
  .bulk-orig  { display: none; }
}
