/* Redirect Manager Admin Styles */

.rm-container {
  width: 100%;
  margin: 20px 0;
}

.rm-form-section {
  background: #fff;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #ccd0d4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.rm-form-section h2 {
  margin-top: 0;
}

.rm-table-section {
  background: #fff;
  padding: 20px;
  border: 1px solid #ccd0d4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.rm-table-section h2 {
  margin-top: 0;
}

/* Form Elements */
.required {
  color: #d63638;
}

#rm-redirect-form .form-table th {
  width: 200px;
  font-weight: 600;
}

#destination-url-row {
  transition: opacity 0.3s ease;
}

/* Filters */
.rm-filters {
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.rm-filters input[type="text"],
.rm-filters select {
  max-width: 300px;
}

/* Table Styles */
.wp-list-table.redirects-table {
  border: 1px solid #c3c4c7;
}

.column-id {
  width: 60px;
  text-align: center;
}

.column-source {
  width: auto;
}

.column-destination {
  width: auto;
}

.column-code {
  width: 120px;
  text-align: center;
}

.column-creator {
  width: 150px;
}

.column-date {
  width: 150px;
}

.column-actions {
  width: 150px;
  text-align: center;
}

.text-center {
  text-align: center;
}

/* Status Code Badges */
.rm-status-code {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}

.rm-status-code.code-308 {
  background: #e5f5fa;
  color: #0073aa;
  border: 1px solid #b8dce8;
}

.rm-status-code.code-410 {
  background: #fef7f1;
  color: #d63638;
  border: 1px solid #f6d5d3;
}

/* Action Buttons */
.rm-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-start;
}

.button-edit,
.button-delete {
  padding: 4px 10px;
  font-size: 12px;
  height: auto;
  line-height: 1.5;
}

.button-delete {
  background: #d63638;
  border-color: #d63638;
  color: #fff;
}

.button-delete:hover,
.button-delete:focus {
  background: #b32d2e;
  border-color: #b32d2e;
  color: #fff;
}

.button-view {
  background: #2271b1;
  border-color: #2271b1;
  color: #fff;
}

.button-view:hover,
.button-view:focus {
  background: #135e96;
  border-color: #135e96;
  color: #fff;
}

/* Pagination */
#pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}

.displaying-num {
  margin-right: auto;
  color: #646970;
}

.pagination-link {
  padding: 6px 12px;
  text-decoration: none;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  background: #fff;
  color: #2271b1;
  transition: all 0.2s ease;
}

.pagination-link:hover {
  background: #f6f7f7;
  border-color: #8c8f94;
  color: #135e96;
}

.pagination-link.current {
  background: #2271b1;
  color: #fff;
  border-color: #2271b1;
  cursor: default;
  pointer-events: none;
}

.pagination-link:not([href]) {
  color: #646970;
  border-color: #dcdcde;
  cursor: default;
}

/* Code Elements */
code {
  background: #f0f0f1;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  color: #2c3338;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
  .rm-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .rm-filters input[type="text"],
  .rm-filters select,
  .rm-filters button {
    max-width: 100%;
    width: 100%;
  }

  .wp-list-table tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #c3c4c7;
  }

  .wp-list-table thead {
    display: none;
  }

  .wp-list-table td {
    display: block;
    text-align: right;
    padding: 10px;
    border-bottom: 1px solid #f0f0f1;
  }

  .wp-list-table td:before {
    content: attr(data-label);
    float: left;
    font-weight: 600;
  }

  .rm-actions {
    justify-content: flex-start;
  }

  #pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .displaying-num {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
  }
}

/* Loading State */
.rm-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Success/Error Messages */
.rm-message {
  padding: 12px;
  margin: 15px 0;
  border-left: 4px solid;
  border-radius: 3px;
}

.rm-message.success {
  background: #ecf7ed;
  border-color: #46b450;
  color: #1e4620;
}

.rm-message.error {
  background: #fef7f1;
  border-color: #d63638;
  color: #3c2a2a;
}

/* Meta Box Styles */
.redirection-manager-meta-box select,
.redirection-manager-meta-box input[type="url"] {
  margin-top: 5px;
}

.redirection-manager-meta-box p {
  margin: 10px 0;
}

/* Empty State */
.rm-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #646970;
}

.rm-empty-state svg {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.rm-empty-state h3 {
  font-size: 18px;
  margin: 0 0 10px;
}

.rm-empty-state p {
  margin: 0;
  font-size: 14px;
}

/* Custom Modal Styles */
.rm-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.rm-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rm-modal-fade-in 0.2s ease-out;
}

.rm-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.rm-modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: rm-modal-slide-in 0.3s ease-out;
  z-index: 100001;
}

.rm-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #dcdcde;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f6f7f7;
}

.rm-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1d2327;
}

.rm-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #646970;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.rm-modal-close:hover {
  background: #dcdcde;
  color: #1d2327;
}

.rm-modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.rm-modal-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #2c3338;
}

.rm-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #dcdcde;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f6f7f7;
}

.rm-modal-cancel,
.rm-modal-confirm {
  min-width: 80px;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rm-modal-cancel {
  background: #fff;
  border: 1px solid #dcdcde;
  color: #2c3338;
}

.rm-modal-cancel:hover {
  background: #f6f7f7;
  border-color: #8c8f94;
}

/* Modal Types */
.rm-modal.type-info .rm-modal-title {
  color: #2271b1;
}

.rm-modal.type-success .rm-modal-title {
  color: #00a32a;
}

.rm-modal.type-warning .rm-modal-title {
  color: #dba617;
}

.rm-modal.type-error .rm-modal-title {
  color: #d63638;
}

.rm-modal.type-error .rm-modal-confirm {
  background: #d63638;
  border-color: #d63638;
  color: #fff;
}

.rm-modal.type-error .rm-modal-confirm:hover {
  background: #b32d2e;
  border-color: #b32d2e;
}

/* Animations */
@keyframes rm-modal-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes rm-modal-slide-in {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

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

/* Responsive */
@media screen and (max-width: 600px) {
  .rm-modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .rm-modal-header,
  .rm-modal-body,
  .rm-modal-footer {
    padding: 16px;
  }

  .rm-modal-title {
    font-size: 16px;
  }
}