/*
 * Element Plus equivalents of the Element UI rules in theme-pay2india.css.
 * theme-pay2india.css is kept identical to the `development` branch; Element Plus
 * builds some controls differently (borders on wrappers, new class names), so the
 * same design is applied to those elements here. Load this file after it.
 */

/* inputs / textareas: Element Plus draws the border on .el-input__wrapper (box-shadow) */
body #layout-wrapper .el-input,
body #layout-wrapper .el-textarea {
  --el-input-border-color: var(--p2i-line);
  --el-input-hover-border-color: #b9d4d1;
  --el-input-focus-border-color: var(--p2i-blue);
  --el-input-bg-color: #fbfcfd;
  --el-input-text-color: var(--p2i-text);
}
body #layout-wrapper .el-input__wrapper {
  background: #fbfcfd;
  transition: box-shadow .2s, background .2s;
}
body #layout-wrapper .el-input__wrapper.is-focus {
  background: #fff;
  box-shadow: 0 0 0 1px var(--p2i-blue) inset, 0 0 0 3px rgba(13, 95, 89, .12);
}
body #layout-wrapper .el-textarea__inner:focus {
  box-shadow: 0 0 0 1px var(--p2i-blue) inset, 0 0 0 3px rgba(13, 95, 89, .12);
}
body #layout-wrapper .el-input-group--append > .el-input__wrapper { border-radius: 10px 0 0 10px; }
body #layout-wrapper .el-input-group__append { box-shadow: 0 1px 0 0 var(--p2i-line) inset, 0 -1px 0 0 var(--p2i-line) inset, -1px 0 0 0 var(--p2i-line) inset; }

/* selects: Element Plus 2.x uses .el-select__wrapper instead of an inner el-input */
body #layout-wrapper .el-select__wrapper {
  background: #fbfcfd; color: var(--p2i-text);
  box-shadow: 0 0 0 1px var(--p2i-line) inset;
  transition: box-shadow .2s, background .2s;
}
body #layout-wrapper .el-select__wrapper.is-hovering:not(.is-focused) { box-shadow: 0 0 0 1px #b9d4d1 inset; }
body #layout-wrapper .el-select__wrapper.is-focused {
  background: #fff;
  box-shadow: 0 0 0 1px var(--p2i-blue) inset, 0 0 0 3px rgba(13, 95, 89, .12);
}
body #layout-wrapper .el-select .el-select__caret { color: var(--p2i-muted); }

/* compact header search (Element UI size "mini" is "small" in Element Plus) */
body #layout-wrapper .card-header .col-md-9 .el-input--small .el-input__wrapper { height: 30px; font-size: 12px; }
body #layout-wrapper .card-header .col-md-9 .el-input--small .el-input__inner { height: 28px; line-height: 28px; }

/* radio buttons: checked state is .is-active / .el-radio-button__original-radio */
body #layout-wrapper .el-radio-button.is-active .el-radio-button__inner,
body #layout-wrapper .el-radio-button__original-radio:checked + .el-radio-button__inner {
  background: var(--p2i-blue); border-color: var(--p2i-blue); box-shadow: -1px 0 0 0 var(--p2i-blue); color: #fff;
}
.p2i-chip .el-radio-button.is-active .el-radio-button__inner,
.p2i-chip .el-radio-button__original-radio:checked + .el-radio-button__inner { background: var(--p2i-blue); color: #fff; box-shadow: none !important; }

/* switches use CSS variables in Element Plus */
body #layout-wrapper .el-switch.is-checked { --el-switch-on-color: var(--p2i-green); }

/* confirm dialogs ($confirm): warning icon class */
.el-message-box__status.el-message-box-icon--warning { color: var(--p2i-orange); }
.el-message-box { --el-messagebox-border-radius: 18px; }

/* message close button: absolutely positioned on the right like Element UI (theme sets right: 14px) */
html body .el-message .el-message__closeBtn { position: absolute; top: 50%; transform: translateY(-50%); margin: 0; }

/* custom-admin.css: `.el-input__inner { border-radius: 2px !important }` - in Element UI that
   element carried the border (inputs, selects, date ranges); in Element Plus it is the wrapper */
.el-input__wrapper,
.el-select__wrapper { border-radius: 2px !important; }
body #layout-wrapper .el-input-group--append > .el-input__wrapper { border-radius: 2px 0 0 2px !important; }

/* Element Plus renders a form label as <div> when it has no input to point at (e.g. file
   uploads); Element UI always rendered <label>. Give those divs the same label rules:
   Bootstrap `label { font-weight: 500; margin-bottom: .5rem }` and the theme's
   `body #layout-wrapper label { ... }` */
div.el-form-item__label { font-weight: 500; margin-bottom: .5rem; }
body #layout-wrapper div.el-form-item__label { font-weight: 600; color: var(--p2i-text); font-size: 13px; }

/* pagination: the current page is li.is-active in Element Plus (li.active in Element UI) */
body #layout-wrapper .el-pagination.is-background .el-pager li.is-active {
  background: var(--p2i-blue); color: #fff; box-shadow: 0 6px 12px var(--p2i-shadow);
}

/* custom-admin.css `.el-table--mini th { padding: 0 }` (now --small): Element Plus' own cell rule is
   more specific than it, so restate it at the same strength */
.el-table--small th.el-table__cell { padding: 0; }
