/**
 * Tournament Table Styles
 * Mein Turnierplan Plugin
 */

/* Admin preview styles */
#mtrn-preview {
  overflow-x: auto;
}

#mtrn-preview .mtrn-tournament-table {
  margin: 10px 0;
}

/* Admin two-column layout */
.mtrn-admin-two-column-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding-block: 8px;
}

.mtrn-admin-column {
  flex: 1;
  min-width: 0; /* Allows flex items to shrink below their content width */
}

.mtrn-admin-column-left {
  flex: 1.1; /* Settings take slightly more space */
}

.mtrn-admin-column-right {
  position: sticky;
  top: 0;
  flex: 0.9; /* Preview takes slightly less space */
}

.mtrn-admin-column h3 {
  margin-top: 0;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ddd;
  font-size: 14px;
  font-weight: 600;
}

.mtrn-admin-clear {
  clear: both;
}

/* Responsive design for admin layout */
@media (max-width: 1366px) {
  .mtrn-admin-two-column-layout {
    flex-direction: column;
    gap: 15px;
  }

  .mtrn-admin-column-left,
  .mtrn-admin-column-right {
    flex: none;
    width: 100%;
  }
}

/* Ensure form table in settings column is responsive */
.mtrn-admin-column-left .form-table {
  width: 100%;
  max-width: none;
}

.mtrn-admin-column-left .form-table th {
  width: 35%;
  padding-right: 10px;
}

.mtrn-admin-column-left .form-table td {
  width: 65%;
}

/* Group Header */
.form-table .mtrn-group-header-wrapper {
  padding: 0;
}
.form-table .mtrn-group-header {
  margin: 20px 0 10px 0;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #23282d;
  border-bottom: 1px solid #ddd;
}

/* Field: Number */
input[type="number"].regular-text {
  width: 64px;
}

/* Preview section styling */
.mtrn-admin-column-right #mtrn-preview {
  border: 1px solid #ddd;
  padding: 15px;
  background-color: #f9f9fa;
  border-radius: 4px;
  min-height: 200px;
}

/* Adjust preview for smaller screens within the column */
@media (max-width: 1400px) {
  .mtrn-admin-column-right #mtrn-preview {
    overflow-x: auto;
  }

  .mtrn-admin-column-right .mtrn-tournament-table {
    font-size: 11px;
  }

  .mtrn-admin-column-right .mtrn-tournament-table th,
  .mtrn-admin-column-right .mtrn-tournament-table td {
    padding: 3px 5px;
  }
}

/* Generated Shortcode Field */
.mtrn-generated-shortcode-wrapper {
  margin-bottom: 15px;
}
.mtrn-generated-shortcode__label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}
.mtrn-generated-shortcode__field {
  width: 100%;
  height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Segoe UI Mono", "Ubuntu Mono", monospace;
  font-size: 12px;
  padding: 8px;
  border: 1px solid #ddd;
  background-color: #f9f9f9;
}
.mtrn-generated-shortcode__btn {
  width: 100%;
  margin-bottom: 10px;
}
.mtrn-generated-shortcode__btn-icon {
  vertical-align: middle;
  margin-right: 5px;
}

.mtrn-generated-shortcode__copy-success {
  color: #46b450;
  margin-top: 8px;
  text-align: center;
}
.mtrn-generated-shortcode__copy-success-icon {
  vertical-align: middle;
}

.mtrn-generated-shortcode__message {
  margin-top: 10px;
  padding: 8px;
  border-radius: 3px;
}
.mtrn-generated-shortcode__message--warning {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}

/* Rotating animation for update icon */
.dashicons-update-alt-rotating {
  animation: rotation 1s infinite linear;
}

@keyframes rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(359deg);
  }
}


/* Empty preview */
.mtrn-admin-column-right #mtrn-preview .mtrn-empty-preview {
  min-width: 300px;
  max-width: 100%;
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  padding: 30px;
  background: #f8f9fa;
  border: 1px dashed #dee2e6;
  border-radius: 4px;
  text-align: center;
  color: #6c757d;
  font-size: 14px;
  line-height: 1.5;
}
.mtrn-admin-column-right #mtrn-preview .mtrn-empty-preview__icon {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  opacity: 0.6;
}
.mtrn-admin-column-right #mtrn-preview .mtrn-empty-preview strong {
  color: #343a40;
}
