@use 'variables' as vars;

// Hide the WordPress standard heading since we have our custom header
.wrap .wp-heading-inline {
  display: none;
}

.llms-header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: vars.$background-color-dark;
  border-radius: 4px;
  padding: 1rem;
  .llms-header-page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: vars.$color-brand;
  }

  .author-branding {
    display: flex;
    align-items: center;
    justify-content: center;

    

    svg {
      height: 50px;
    }
  }
}

.ambiscale-llms-friendly-admin-page {

  @media (min-width: 768px) {
    display: flex;
    flex-direction: row;
    gap: 2rem;
  }

  .nav-tab-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;

    .nav-tab {
      margin-left: 0;
    }
  }

  .form-table {
    .label-radio {
      display: inline-block;
      margin-bottom: 0.5rem;
    }
  }

  .settings-content {
    flex: 2.5;

    .post-type-row {
      display: flex;
      flex-direction: row;
      gap: 1rem;
    }

    input[type="text"]::placeholder,
    textarea::placeholder {
      color: vars.$text-light-color;
    }
  }

  .general-tab-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    @media (min-width: 768px) {
      flex-direction: row;
      gap: 2rem;
    }

    .general-tab-content {
      flex: 1;
      min-width: 0; // Prevents flex overflow issues
    }

    .plugin-description-sidebar {
      flex: 0 0 300px; // Fixed width for better consistency
      background-color: vars.$background-light-color-2;
      border: 1px solid vars.$border-color;
      padding: 1rem;
      height: max-content;

      @media (min-width: 768px) {
        position: sticky;
        top: 3rem;
        flex: 0 0 350px; // Slightly wider on desktop
      }

      @media (max-width: 767px) {
        order: 2; // Show sidebar below content on mobile
        flex: 1;
      }

      .sidebar-status-section {
        margin-bottom: 1.5rem;

        h4 {
          margin-top: 0;
          margin-bottom: 0.75rem;
          color: vars.$text-color;
          font-size: 1.1rem;
        }

        .llms-fancy-table {
          margin: 0.5rem 0 1rem 0;
          font-size: 0.9rem;

          th, td {
            padding: 0.5rem;
          }
        }

        .sidebar-cta-section {
          text-align: center;

          .sidebar-status-button {
            width: 100%;
            margin-bottom: 0.5rem;
          }

          .description {
            font-size: 0.85rem;
            margin: 0;
            text-align: left;
          }
        }
      }
    }
  }

  .preview-content {
    background-color: vars.$background-light-color;
    white-space: pre-wrap;
    padding: 1rem;
    margin: 1rem 0;
  }

  .llms-fancy-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: vars.$background-light-color;
    box-shadow: 0 0 0.625rem rgba(0, 0, 0, 0.1);

    th,
    td {
      border: 1px solid vars.$border-light-color;
      padding: vars.$padding;
      text-align: left;
    }

    thead {
      background-color: vars.$background-color;
    }

    th {
      color: vars.$text-color;
      font-weight: bold;
      text-transform: uppercase;
    }
  }

  .llms-status {
    &-exists,
    &-writable {
      color: vars.$status-exists-color;
      font-weight: bold;
    }

    &-not-exists,
    &-not-writable {
      color: vars.$status-not-exists-color;
      font-weight: bold;
    }
  }

  .llms-file-link {
    margin-left: 0.625rem;
  }
}

// Sync functionality styles
.llms-progress-bar {
  width: 100%;
  height: 20px;
  background-color: #f1f1f1;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.llms-progress-fill {
  height: 100%;
  background-color: #0073aa;
  transition: width 0.3s ease;
}

.llms-sync-controls {
  margin: 15px 0;

  form {
    margin-right: 10px;
  }
}

.status-content-wrapper {
  margin-top: 20px;
}

.llms-status-success {
  color: #00a32a;
  font-weight: 600;
}

.llms-status-warning {
  color: #d63638;
  font-weight: 600;
}

.llms-status-info {
  color: #0073aa;
  font-weight: 600;
}

#continue-sync-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#stop-sync-btn {
  background-color: #d63638;
  border-color: #d63638;
  color: #fff;

  &:hover {
    background-color: #b32d2e;
    border-color: #b32d2e;
  }

  &:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #d63638;
  }
}

.notice-info {
  border-left-color: #0073aa;
}

// Global admin notice styling for Ambiscale LLMs Friendly notices across all admin pages
.ambiscale-llms-friendly-global-notice {
  font-size: 14px;
  
  a {
    font-weight: 600;
    text-decoration: none;
    margin-left: 5px;
    
    &:hover {
      text-decoration: underline;
    }
  }
}
