/* -------------- */
/* General layout */
/* -------------- */
.asrino-box {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin: 20px 0;
  background: #fff;
  direction: rtl;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.row label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.row input {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  text-align: left;
  direction: ltr;
  transition: border-color 0.3s;
}

.row input:focus {
  border-color: #007cba;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.price {
  padding: 10px 12px;
  background: #f8f9fa;
  border: 1px dashed #6c757d;
  border-radius: 6px;
  font-weight: bold;
  color: #28a745;
  font-size: 15px;
}

.balance {
  padding: 8px 12px;
  background: #e9ecef;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.balance:hover {
  background: #dee2e6;
  border-color: #adb5bd;
}

.actions {
  margin-top: 20px;
}

.btn-action,
.btn-action2 {
  display: block !important;
  width: 100% !important;
  text-align: center;
  background-color: var(--e-global-color-accent) !important;
  color: #fff !important;
  border: none;
  padding: 12px 20px;
  border-radius: 5px !important;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.btn-action:hover,
.btn-action2:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button.asrino-tab-btn.active {
  color: #222;
  background: #ffe470;
}

/* -------------- */
/*     Modal      */
/* -------------- */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  z-index: 9999;
  padding: 20px;
}

.modal-content {
  width: min(400px, 80vw);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header,
.modal-footer {
  padding: 16px 20px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dee2e6;
}

.modal-header strong {
  font-size: 18px;
  color: #333;
}

.modal-close {
  background: #0000 !important;
  color: red !important;
  border: none;
  cursor: pointer;
  transition: color 0.3s;
  border-radius: 500px !important;
}

.modal-close *{
  font-size: 54px !important;
}

.modal-close:hover {
  color: #FFF  !important;
  background: red  !important;
}

.modal-body {
  padding: 20px;
}

.modal-note {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 16px;
  line-height: 1.6;
  text-align: center;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  border-right: 4px solid #ffe470;
}

.modal-status {
  font-weight: bold;
  color: #333;
  margin-bottom: 16px;
  text-align: center;
  padding: 8px;
  border-radius: 4px;
}

.modal-status.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.modal-status.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.asrino-order-details-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.asrino-order-details-table tr {
  border-bottom: 1px solid #eee;
}

.asrino-order-details-table tr:last-child {
  border-bottom: none;
}

.asrino-order-details-table td {
  padding: 10px 8px;
  vertical-align: top;
}

.detail-label {
  font-weight: 600;
  color: #555;
  text-align: right;
  width: 40%;
}

.detail-value {
  color: #333;
  text-align: left;
  font-weight: 500;
}

.btn-cancel,
.btn-confirm {
  padding: 10px 20px;
  border-radius: 5px !important;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  font-weight: 600;
  min-width: 100px;
}

.btn-cancel {
  background: #6c757d;
  color: #fff;
}

.btn-cancel:hover {
  background: #545b62;
  transform: translateY(-1px);
}

.btn-confirm {
  color: #fff !important;
  background-color: var(--e-global-color-accent) !important;
}

.btn-confirm:hover:not(:disabled) {
  background-color: var(--e-global-color-secondary) !important;
  color: var(--e-global-color-accent) !important;
  transform: translateY(-1px);
}

.btn-confirm:disabled {
  background: #adb5bd;
  cursor: not-allowed;
  transform: none;
}

/* ------------- */
/* History table */
/* ------------- */

.asrino-history h3 {
  display: none;
}

.asrino-table {
  width: 100%;
  border-collapse: collapse;
  direction: rtl;
  font-size: 14px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 0;
}

.asrino-table thead {
  background: #f8f9fa;
}

.asrino-table thead th {
  padding: 12px 8px;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #dee2e6;
}

.asrino-total {
  background-color: #ffe470;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
  margin: 20px 0;
  color: #333;
  font-size: 16px;
}

.asrino-table td,
.asrino-table th,
table.asrino-table {
  color: #555 !important;
  border: none;
  padding: 8px;
}

.asrino-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #eee;
}

.asrino-table tr {
  transition: background-color 0.2s;
}

.asrino-table tr:hover {
  background-color: #f8f9fa;
}

.asrino-table tr:last-child td {
  border-bottom: none;
}

#filter_date_from,
#filter_date_to {
  width: 120px;
  padding: 6px 8px;
}

.asrino-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  margin-bottom: 0;
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.asrino-filters input,
.asrino-filters select {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.asrino-filters button,
.asrino-filters a.button {
  padding: 8px 16px;
  background-color: var(--e-global-color-secondary);
  color: white;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.asrino-filters button:hover,
.asrino-filters a.button:hover {
  background: var(--e-global-color-accent);
}

.asrino-filters a.button {
  background: #6c757d;
  color: #fff;
}

.asrino-filters a.button:hover {
  background: #545b62;
}

/* ---------------- */
/* buy or sell tabs */
/* ---------------- */

.asrino-tabs-wrapper {
  max-width: 500px;
  margin: 0 auto;
  font-family: inherit;
}

.asrino-tabs-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 8px;
  background-color: #f8f9fa;
  border-radius: 8px;
  gap: 8px;
}

.asrino-tab-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  background-color: #0000 !important;
  border-bottom: 2px solid transparent;
  border-radius: 5px !important;
  transition: all 0.3s ease;
  font-size: 14px;
}

.asrino-tab-btn:hover {
  background: #e9ecef;
  color: #333;
}

.asrino-tab-btn.active {
  background-color: var(--e-global-color-accent) !important;
  color: #333;
  border-bottom: 2px solid #007cba;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.asrino-tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.asrino-tab-panel.active {
  display: block;
}

@media (max-width: 768px) {
  .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .row label {
    margin-bottom: 4px;
  }

  .asrino-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group label {
    margin-bottom: 4px;
  }

  .asrino-tabs-header {
    flex-direction: column;
    gap: 8px;
  }

  .modal-content {
    width: 95vw;
    margin: 10px;
  }

  .modal-body {
    padding: 16px;
  }

  .asrino-order-details-table .detail-label,
  .asrino-order-details-table .detail-value {
    display: block;
    width: 100%;
    text-align: center;
  }

  .asrino-order-details-table tr {
    display: block;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
  }

  .asrino-order-details-table tr:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
}

.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007cba;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.tx-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.tx-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.tx-failed,
.tx-cancelled {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.tx-pending,
.tx-sent {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.tx-expired {
  background: #e2e3e5;
  color: #383d41;
  border: 1px solid #d6d8db;
}

/* ---------------- */
/*   Setting Page   */
/* ---------------- */
    .asrino-admin-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-top: 20px;
    }

    .asrino-settings-section {
        grid-column: 1;
    }

    .asrino-transactions-section {
        grid-column: 2;
    }

    .asrino-system-info {
        grid-column: 1 / -1;
    }

    .tx-status {
        padding: 4px 8px;
        border-radius: 3px;
        font-size: 12px;
        font-weight: bold;
    }

    .status-success {
        background: #d4edda;
        color: #155724;
    }

    .status-pending,
    .status-sent {
        background: #fff3cd;
        color: #856404;
    }

    .status-failed,
    .status-cancelled {
        background: #f8d7da;
        color: #721c24;
    }

    .status-expired {
        background: #e2e3e5;
        color: #383d41;
    }

    .tx-type {
        padding: 4px 8px;
        border-radius: 3px;
        font-size: 12px;
        font-weight: bold;
    }

    .tx-type.buy {
        background: #d1ecf1;
        color: #0c5460;
    }

    .tx-type.sell {
        background: #d4edda;
        color: #155724;
    }

    @media (max-width: 1200px) {
        .asrino-admin-container {
            grid-template-columns: 1fr;
        }

        .asrino-settings-section,
        .asrino-transactions-section {
            grid-column: 1;
        }
    }