/*
 * Tomanify Admin Styles
 *
 * @since 1.0.0
 */

/* Layout */
.tomanify-wrap { background:#fff; padding:20px; border-radius:6px; }
.tomanify-form h2 { margin-top:25px; color:#23282d; border-bottom:1px solid #ddd; padding-bottom:6px; }
.tomanify-tab-content { margin-top:20px; }
.tomanify-about { line-height:1.7; max-width:720px; }

/* Cards & Containers */
.tomanify-admin-container { margin-top:12px; }
.tomanify-card { background:#fff; padding:12px 16px; border:1px solid #e2e2e2; border-radius:4px; margin:12px 0; }

/* Optional footer */
.tomanify-admin-footer { text-align:center; margin-top:40px; color:#888; }

/* Tables */
.tomanify-table--narrow { max-width:820px; }
.tomanify-table--medium { max-width:900px; }
.tomanify-table--wide   { max-width:1100px; }

.tomanify-col-img   { width:10%; }
.tomanify-col-title { width:30%; }
.tomanify-col-input { width:20%; }
.tomanify-col-final { width:20%; }

.tomanify-col-code     { width:16%; }
.tomanify-col-currency { width:34%; }
.tomanify-col-display  { width:25%; }

/* Inputs */
.tomanify-input { box-sizing:border-box; }
.tomanify-input-full { width:100%; }
.tomanify-w-90  { width:90px; }
.tomanify-w-140 { width:140px; }
.tomanify-maxw-700 { max-width:700px; }

/* Spacing Utilities */
.tomanify-mb-12 { margin-bottom:12px; }
.tomanify-mb-16 { margin-bottom:16px; }
.tomanify-mt-4  { margin-top:4px; }
.tomanify-mt-6  { margin-top:6px; }
.tomanify-mt-8  { margin-top:8px; }

.tomanify-mr-6  { margin-right:6px; }
.tomanify-mr-8  { margin-right:8px; }
.tomanify-mr-12 { margin-right:12px; }

.tomanify-ml-8 { margin-left:8px; }

/* Text Helpers */
.tomanify-text-muted { color:#666; }
.tomanify-fw-normal { font-weight:400; }
.tomanify-help { color:#666; margin:6px 0; }

/* Flex Helpers */
.tomanify-flex { display:flex; }
.tomanify-items-center { align-items:center; }
.tomanify-gap-8 { gap:8px; }

/* Thumbnails */
.tomanify-thumb {
  width:40px;
  height:40px;
  border-radius:4px;
  object-fit:cover;
  display:inline-block;
}
.tomanify-thumb--placeholder {
  background:#eee;
  border:1px solid #ccc;
}

/* Copy Feedback */
.tomanify-copy-done { display:none; color:green; margin-left:6px; }

/* Meta Box Layout */
.tomanify-meta { margin-top:4px; }
.tomanify-field { margin:8px 0; }
.tomanify-label { display:block; margin-bottom:4px; font-weight:600; }

/* ------------------------------
   RTL MODE
   ------------------------------ */

.tomanify-rtl { direction:rtl; text-align:right; }

.tomanify-rtl .tomanify-card,
.tomanify-rtl .tomanify-table--narrow,
.tomanify-rtl .tomanify-table--medium,
.tomanify-rtl .tomanify-table--wide {
  direction:rtl;
}

.tomanify-rtl .tomanify-input-full { text-align:right; }
.tomanify-rtl select { direction:rtl; }

/* Force font inherit for Persian/RTL */
.wrap.tomanify-rtl,
.wrap.tomanify-rtl * {
  font-family: inherit;
}

/* RTL Headings & Tabs */
.tomanify-rtl h1,
.tomanify-rtl h2,
.tomanify-rtl h3 { text-align:right; }

.tomanify-rtl .nav-tab-wrapper { direction:rtl; text-align:right; }
.tomanify-rtl .nav-tab {
  float:none;
  display:inline-block;
}

/* RTL Table headers */
.tomanify-rtl table.widefat thead th,
.tomanify-rtl .tomanify-table--narrow thead th,
.tomanify-rtl .tomanify-table--medium thead th,
.tomanify-rtl .tomanify-table--wide thead th {
  text-align:right;
}

/* RTL Labels & Help */
.tomanify-rtl .tomanify-label,
.tomanify-rtl .tomanify-help {
  text-align:right;
}

/* ------------------------------
   LTR MODE (when dashboard is RTL)
   ------------------------------ */

.tomanify-ltr { direction:ltr; text-align:left; }

.tomanify-ltr .tomanify-card,
.tomanify-ltr .tomanify-table--narrow,
.tomanify-ltr .tomanify-table--medium,
.tomanify-ltr .tomanify-table--wide {
  direction:ltr;
}

.tomanify-ltr h1,
.tomanify-ltr h2,
.tomanify-ltr h3 { text-align:left; }

.tomanify-ltr .tomanify-input-full { text-align:left; }
.tomanify-ltr select { direction:ltr; }

.tomanify-ltr .nav-tab-wrapper { direction:ltr; text-align:left; }
.tomanify-ltr .nav-tab {
  float:none;
  display:inline-block;
}

/* Backup tab */
.tomanify-backup-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.tomanify-backup-col { padding:4px; }

.tomanify-warning {
  background:#fff8e5;
  border:1px solid #f0c36d;
  color:#6b5200;
  padding:10px 12px;
  border-radius:4px;
  margin-bottom:12px;
}

@media (max-width:900px) {
  .tomanify-backup-grid { grid-template-columns:1fr; }
}

.tomanify-card input[type="file"] {
  display:block;
  margin-top:8px;
}

/* Fix WooCommerce metabox heading font inheritance */
.tomanify-rtl .postbox h2.hndle,
.tomanify-ltr .postbox h2.hndle,
.postbox.tomanify-meta h2.hndle {
    font-family: inherit;
}

/* License & Credits modal */
.tomanify-license-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.45);
	z-index: 100000;
}

.tomanify-license-overlay.is-open {
	display: flex;
}

.tomanify-license-modal {
	background: #fff;
	max-width: 720px;
	width: 100%;
	max-height: 80vh;
	overflow: auto;
	padding: 24px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	border-radius: 8px;
}

/* Close button */
.tomanify-license-close {
	border: 0;
	background: transparent;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	float: right;
}

.tomanify-license-modal h2 {
	margin-top: 0;
	margin-bottom: 16px;
}

.tomanify-license-modal h3 {
	margin-top: 24px;
	margin-bottom: 8px;
}

.tomanify-license-modal p {
	margin-bottom: 12px;
}

.tomanify-license-list {
	list-style: disc;
	padding-left: 20px;
	margin: 0 0 12px;
}

/* Respect plugin RTL/LTR helpers */
.tomanify-rtl .tomanify-license-modal {
	direction: rtl;
	text-align: right;
}

.tomanify-ltr .tomanify-license-modal {
	direction: ltr;
	text-align: left;
}

.tomanify-rtl .tomanify-license-list {
	padding-right: 20px;
	padding-left: 0;
}
